Texture bleeding & best approach

Hi,

I’m using texture atlas (1 row, 6 columns, 384x128px) for my greedy meshing, and been struggling with texture bleeding on the mesh faces.

approaches:

  1. I added an offset/padding on the texture atlas, however it may bleed if camera distance is great.

  2. I create a new DefaultRenderingPipeline, and set fxaaEnabled = true. There are almost no texture bleeding now. (No offset needed here)

  3. Disable antialias. Removes texture bleeding. (No offset needed here)

Any suggestions for me ?

//Olav

More suggestions in

1 Like

Although I’m new to Babylon, here are a couple tips regarding content creation that are usually best practices to avoid bleeding that perhaps ould help.

The higher the image resolution of the texture the larger the pixel padding around each uv island should be.

You should generally make sure that the islands color is expanded, or at least the empty space between islands isn’t “empty”. Should be in a color as close to whats in the closest uv island as possible.

If the bleeding happens when the camera gets further away from the object that sounds like theres some sort of LOD kicking in.

AA usually works by blending a jagged line of pixels with their neighboring pixel, so I think that sounds expected.

As a general rule of thumb I would avoid textures that arent 1:1 square and divisible by 2. 16px *16, 516 *516, 1024 *1024 ,etc…

2 Likes