Normal Map Filtering

Hi,

what kind of filtering do you use for normal maps?
I always disable stuff like anisotropic filtering but how
do you setup GL_TEXTURE_MIN_FILTER and GL_TEXTURE_MAG_FILTER?

I guess bilinear and trilinear filtering are a bad choice
when dealing with normals stored as rgb values, right?

Thanks!

trilinear/aniso is not so bad as sharp bump detail will be smoothed, which avoid a lot a aliasing when you have sharp speculars. Might want to widen the specular exponent along as well if you aim for perfection.

I would say test both, rendering side to side on exact same animated scene.

Ok thanks!

Binilear/trilinear filtering is usually used for normal maps as well. Anisotropic filtering may be less useful, though it may provide better results in certain scenarios.

You can and should use filtering with normal maps. But you should take extra care when computing mipmaps for normal maps. For example, you should normalize the normals. NVIDIA texture tools has a special mode for normal maps. And if you really want to get things more “right”, this can be worth reading:

http://blog.selfshadow.com/2011/07/22/specular-showdown/

Wouldn’t be the correct way to normalize the normals
in the shader after reading them with texture2D()?

I mean even if they are normalized in the mip maps
the trilinear interpolation between the mip map
levels would produce denormalized normals, right?

Btw how can one normalize the mipmaps when generating
them with glGenerateMipMap in hardware?

Wouldn’t be the correct way to normalize the normals
in the shader after reading them with texture2D()?

I mean even if they are normalized in the mip maps
the trilinear interpolation between the mip map
levels would produce denormalized normals, right?

You want the data in the texture to be as accurate as possible, so that the filtering won’t add too much distortion to it.

Btw how can one normalize the mipmaps when generating
them with glGenerateMipMap in hardware?

You don’t. If you need mipmaps generated a special way, you have to generate them yourself.