Decals and materials anisotropic filtering difference, why?

Why is an image looking so different in OpenGL if it applied as a decals vs as a material?

One is smooth up close while the other is smooth on a distance:



Hi @Holo,

The first image might be because of an oversight in how we set the texture filtering on normal textures vs. decal textures. I’ll look into it.

The zoomed out images look different for another reason. In order for anisotropic filtering to work OpenGL needs information on the derivative of the texture coordinates in screen-space. It basically needs to know in what direction and by how much does the U and V coordinate change as we move on the screen from left to right, up and down. For a normal texture which is applied according to the texture coordinates on the triangles, this is easy to calculate and OpenGL does it automatically, under the hood.

However, when we apply decals we can use any arbitrary calculation to determine the texture coordinate at a pixel. This means we have to explicitly tell OpenGL the derivative at each pixel, and for several decal calculations this becomes unnecessarily complicated. Therefore, the decals look worse from far away.

Perhaps in the not too distance future we can look at this again and try to improve it.


Thanks for the answer and no worries, I just wondered why they were different and if it was a “bug” or another reason. Thanks for clearing it up and cool if you can fix part of it.