Skip to main content
gamedev.net
🔒 Locked

BindTexture, Texenv, and Texparameter

Started by WarAmp 1 reply 1.5k views
Original Post
WarAmp
WarAmp
Hi all, I was just wondering if someone could clarify something for me: After I call glBindTexture, are ALL TexEnv and TexParameter states remembered for that specific Texture? If I simply Bind that texture again later, will GL recall all the Env and Paramter settings I specified for it before? Or do I have to specifiy them all each time I bind a texture? (If they are differnet from the previous settings) Thanks for any info.
Waramp.Before you insult a man, walk a mile in his shoes.That way, when you do insult him, you'll be a mile away, and you'll have his shoes.
urayami
urayami
Hi. I know TexParameter* states are upheld because you enable certain filtering with textures via TexParameter* and the filtering may be different for different textures, but whatever filtering was specified at the time of texture creation is used. (If none is specified, there are defaults I believe; for filtering, I believe the default is point sampling or GL_NEAREST.) TexEnv* states are also upheld. I''m not completely sure if OpenGL just takes the last set states (or defaults, if none were set) and uses those for each subsequent texture generation or if after each texture generation, the states are set back to the default and must be reset appropriately to bind another texture.
Also, the end-user might have some of the texture options you set for the texture turned off. For example, if you use trilinear sampling or GL_LINEAR_MIMAP_LINEAR. The end-user might have that disabled. In this situation, I imagine it would try to do bilinear sampling in the place of trilinear, but I am not sure. Does anyone know what would happen in a case such as this?

In short WarAmp, yes, OpenGL will remember what settings you had for the texture when you initially generated it, and subsequent texture binds for that texture will use the states you initially set. I just didn''t want to sound absolute since I imagine there might be cases where this is not so. I''m sure someone else can elaborate better than I have if you''re interested.

~Urayami
~Urayami
WarAmp
WarAmp
hmm I was pretty sure that the TexParameter stuff was re-used, but I wasnt sure about hte TexEnv states. Thanks for the reply urayami. I guess I will reorganize some code and hope for the best
Waramp.Before you insult a man, walk a mile in his shoes.That way, when you do insult him, you'll be a mile away, and you'll have his shoes.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.