[Question] Texture colour interpolation with transparent pixel

Dear experts,

I am facing an issue related to texture rendering with alpha/transparent edges.

I can see there are two options for interpolation Linear and Nearest. Most of the cases, linear is preferred as it provides smoother transfer signal.

Nearest

Linear

However, when there are areas with very weak signal, there will be holes (represented by texture with transparent colour). When enable linear, these will be a very noticeable dark edge which may confused the user. This situation will become more critical when there are many coverage holes in a complicated environment.

Please can anyone give some advice, how i can let the interpolation for example skip the pixels with transparency? I have tried an “alpha test” threshold, but it is very hard to define its value and it generates different effect at different location.

Texture Colour Interpolation | Babylon.js Playground

Would it be better to use alpha blending then? This way you could have a smooth transition

Something along these lines:
Texture Colour Interpolation | Babylon.js Playground

1 Like

Thanks @Deltakosh for your quick reply as always :grinning:s.

Alpha blender looks definitely better, I will test out more complex scenarios to see the results.

Will get back to you of my findings.

Thanks again.

1 Like