Easy question...What is bias param in textureXD?

As the heading says, I’m wondering what the bias parameter of textureXD is for? I can’t seem to find any documentation for it.

Thanks,

STU!

If you have mipmaps then GPU automatically selects one of mipmap when applying texture to polygon. Bias parameter can offset the mipmap number.
If bias is 0.0 then current mipmap is used.
If bias is 1.0 then smaller bitmap is used.
If bias is -1.0 then larger mipmap is used.
Of course values like 0.5 or -3.5 are also allowed.
A little performance hint - calling texture2D with bias specified (even if it’s 0.0) is much slower than calling texture2D without bias. This is true on GeForce6 - I’m not sure about other GPU’s.

This seems usefull for reflective surfaces that have have varying reflection sharpness/blurriness.

Slightly off topic:

Is there a way to ‘clamp’ the mipmap level of a texture (without using shaders)?

Say you have a 256x256 mipmapped texture, can you set a fixed max mipmap level so under all circumstances colors are sampled from level 2 (64x64) or lower, but not higher levels?

Originally posted by remdul:

Say you have a 256x256 mipmapped texture, can you set a fixed max mipmap level so under all circumstances colors are sampled from level 2 (64x64) or lower, but not higher levels?

Look at the GL_TEXTURE_BASE_LEVEL, GL_TEXTURE_MAX_LEVEL, GL_TEXTURE_MIN_LOD and GL_TEXTURE_MAX_LOD texture parameters. I do not know however, if they are hw accelerated.

Thanks, yes I was looking for those.

GL_TEXTURE_MIN_LOD does the trick.

All are fully hw accelerated on a GeForce 6200.

This topic was automatically closed 183 days after the last reply. New replies are no longer allowed.