PDA

View Full Version : Texture Parameter Scope



dhm
01-17-2005, 07:53 AM
Hi All,

Been looking for an answer to this in several books but can't actually find it - just little hints at how it works.

I am wondering the scoping of specifying texture parameters using functions such as glTexParameteri and glTexParameterf (e.g. specifying MIN and MAG filters for bilinear, trlinear filtering and anisotropic filtering).

By this I mean if they are called are they configured for the current texture (bound by glBindTexture) only. Or are they bound to the current texture unit (changed using multitexture extension function).

Do I need to call these for each texture object I create?
Or just once per texture unit I am using?

I have tried writing some test code and they seem to imply that they are per texture unit, unless I am not binding the textures correctly when specifying them.

Thanks in advance for the help.
dhm

mikael_aronsson
01-17-2005, 09:51 PM
As far as I know it goes to the current texture unit, so you only need to set it one time.

zeckensack
01-18-2005, 02:22 AM
No!
glTexParameter modifies the bound object (on the currently active unit, in the multitexturing case).
glTexEnvParameter and glTexEnv modify the current texture unit.

mikael_aronsson
01-18-2005, 03:21 AM
Of course it does, some day I will have to learn to read....

dhm
01-18-2005, 09:04 AM
Hi,

Thanks for your response. I'll have a go and testing it again, and checking my calls to glBindTexture prior to retrieving filtering parameters.

Cheers,
dhm