Kefniark Posted July 17, 2018 Share Posted July 17, 2018 Hello o/ Since few days, I have a weird visual artifact that bug me and I cant find if I'm doing something wrong or if it's a BabylonJS issue. This demo show different setup with 5x5 quad next to each other. https://www.babylonjs-playground.com/#WDLERZ If I use a simple texture, everything looks fine and I can use seamless textures without trouble. But at the moment I try to use an atlas and set the UVs, I get weird line between my tiles. And this persist even if I merge all meshes together. Is there something special in BabylonJS about Uvs that I don't get ? Does anyone know where these line come from and how to make them disappear? Thank you Quote Link to comment Share on other sites More sharing options...
Guest Posted July 17, 2018 Share Posted July 17, 2018 Hello this is not a bug but more how texture sampling works: https://www.babylonjs-playground.com/#WDLERZ#1 Because of filtering the pixels around every pixel are sampled to produce the bilinear filtering. Not a problem when you are on full picture size but when they are pixel outside you have to compensate Quote Link to comment Share on other sites More sharing options...
Kefniark Posted July 17, 2018 Author Share Posted July 17, 2018 Ha ok, I though about that but it was happening with every type of sampling (nearest, trilinear), so I kinda excluded this hypothesis. Is there any clean way to compensate for it or is it magic value based only? Even if its less visible, it's still there with really low camera angle Quote Link to comment Share on other sites More sharing options...
Guest Posted July 17, 2018 Share Posted July 17, 2018 this should be the size of a texel: 1/width and 1/height Kefniark 1 Quote Link to comment Share on other sites More sharing options...
Kefniark Posted July 17, 2018 Author Share Posted July 17, 2018 Thanks, it works fine. frontUVs: new BABYLON.Vector4(epsilon, 0.5 + epsilon, 0.25 - epsilon, 0.75 - epsilon) The lines are gone and both texture look similar ? Quote Link to comment Share on other sites More sharing options...
Guest Posted July 17, 2018 Share Posted July 17, 2018 You can then flag this post as solved Quote Link to comment Share on other sites More sharing options...
Kefniark Posted July 17, 2018 Author Share Posted July 17, 2018 Hummm can I do such a thing? ? I cant find the option anywhere ^^ Quote Link to comment Share on other sites More sharing options...
JohnK Posted July 17, 2018 Share Posted July 17, 2018 4 minutes ago, Kefniark said: Hummm can I do such a thing? ? I cant find the option anywhere ^^ Hi and welcome to the forum. Kefniark 1 Quote Link to comment Share on other sites More sharing options...
DylanD Posted July 17, 2018 Share Posted July 17, 2018 2 hours ago, Kefniark said: Hummm can I do such a thing? ? I cant find the option anywhere ^^ make a tag named solved, add item prefix solved to that tag 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.