AlexGR Posted December 20, 2017 Share Posted December 20, 2017 Hello. When I try to use png with transparency it has a very thin line where the image ends. You can see in the following example the texture has a thin grey line on the bottom side but the actual png image is completely transparent at these pixels. It might not be visible at first glance, but make the viewport of the Playground bigger and you should notice it. The line shows up on both chrome and firefox but is more visible with chrome. https://playground.babylonjs.com/#AMU9TG#1 Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted December 20, 2017 Share Posted December 20, 2017 is the texture power of 2? If not babylon.js will rescale it for you Quote Link to comment Share on other sites More sharing options...
inteja Posted December 20, 2017 Share Posted December 20, 2017 I think this is due to mipmappoing/filtering - the blurring bleeds through to the opposite edge - like a wrap-around effect. If you ensure there's always adequate gap between the opaque part of the texture and the edge then you won't see this bleed through. Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted December 20, 2017 Share Posted December 20, 2017 Also try to force clamping: https://playground.babylonjs.com/#AMU9TG#2 (my problem is that I cannot see the issue ) Quote Link to comment Share on other sites More sharing options...
AlexGR Posted December 20, 2017 Author Share Posted December 20, 2017 Thank you so much! The 2 clamping lines you added actually fixed the problem. topbar_material.diffuseTexture.wrapU = BABYLON.Texture.CLAMP_ADDRESSMODE; topbar_material.diffuseTexture.wrapV = BABYLON.Texture.CLAMP_ADDRESSMODE; Jfyi here is a zoomed pic showing the problem without the clamping: https://imgur.com/6YO8Cjm GameMonetize 1 Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted December 21, 2017 Share Posted December 21, 2017 Great! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.