Applying Antialiasing to PNG texture

Hello guys,

I hope you all are fine!

I’m using a StandardMaterial with a diffuseTexture.hasAlpha = true to simulate a decal on glass objects. It is working well, but I didn’t find a way to apply antialiasing to this texture and avoid this effect:

Is there any way to do it natively?

Thank you in advance for your help!

A repro in the Playground would definitely help.

Are you using alpha blending or alpha testing? Also, are you using trilinear filtering with your texture?

@Evgeni_Popov, sorry for the late… I just created a playground showing this behavior:

As you can see, I’m using a texture with a low resolution (approx: 200x200). Still, I wonder if there is a way to reduce this antialiasing effect on alpha materials with Standard BabylonJS materials.

Thank you very much for your help!

You can try to enable alpha blending:

2 Likes

@Evgeni_Popov, thank you very much, this is precisely what I was looking for

1 Like

@Evgeni_Popov, just a tiny note… it works well, but it seems there are issues when combined with transparent objects. In my case, the result varies according to the camera angle. For now, I’ll keep it as before.


Yes, it is the problem with transparent materials…

See Transparent Rendering | Babylon.js Documentation for more context and solutions.

2 Likes