🔒 Locked
Multitexturing and lighting?
Advertisement
Original Post
Texture env mode is not bound to texture, it's a state. It stays the same until you change it.
Ahh, I had a feeling that's what it was. All the articles I read had it as bound to the texture like glTexParameter options. Let me get back in there and play around with that some more. Thanks for the help.
EDIT - Does glTexParameter actually apply to the currently bound texture with multitexturing? All the examples show glGenTex, glBindTex, glTexParam, gluCreate2DMipmp and then doing it again for other textures, then rendering by setting the current unit, enabling texturing, binding the texture, then repeating for other units, and finally rendering the object. I'm sticking the glTexEnv calls while the units are selected, right before rendering. Is that approach correct?
EDIT - Does glTexParameter actually apply to the currently bound texture with multitexturing? All the examples show glGenTex, glBindTex, glTexParam, gluCreate2DMipmp and then doing it again for other textures, then rendering by setting the current unit, enabling texturing, binding the texture, then repeating for other units, and finally rendering the object. I'm sticking the glTexEnv calls while the units are selected, right before rendering. Is that approach correct?
I'm interested too. It is not clear in the tutorials.
However, from my little experience I would say that no, it is not correct. You should set all the glTexParam and Env stuff for each material and texture unit.
I think that gluCreate2DMipmaps has to be called once, though.
Please can anyone tell how should be done?
However, from my little experience I would say that no, it is not correct. You should set all the glTexParam and Env stuff for each material and texture unit.
I think that gluCreate2DMipmaps has to be called once, though.
Please can anyone tell how should be done?
I'll try to make things clear:
glActiveTexture changes the current texture unit. Most texturing functions and enables affect the current texture unit only.
glTexEnv changes a state of the texture unit.
glBindTexture binds a texture object to a texture unit.
glTexParameter changes the state of texture objects. The modified texture object is the one currently bound on the active texture unit. Once you set your filtering options on a given texture, you do not have to set it again. But if you want to go from LINEAR to NEAREST, you have to bind the texture object before changing the parameter.
glActiveTexture changes the current texture unit. Most texturing functions and enables affect the current texture unit only.
glTexEnv changes a state of the texture unit.
glBindTexture binds a texture object to a texture unit.
glTexParameter changes the state of texture objects. The modified texture object is the one currently bound on the active texture unit. Once you set your filtering options on a given texture, you do not have to set it again. But if you want to go from LINEAR to NEAREST, you have to bind the texture object before changing the parameter.
Opengl.org just confirmed what you said. The glTexParameter values are indeed stored with the texture object.
[Edited by - Chozo on November 12, 2004 11:35:52 AM]
Topic Locked
This topic has been locked by a moderator. New replies are not allowed.
Sign in to reply to this topic.
Advertisement