Skip to main content
gamedev.net
🔒 Locked

Texture parameters

Started by Tompa 2 replies 300+ views
Original Post
Tompa
Tompa
This might be abit lame question, but... When you set the textureparameters glTexParameteri() , glTexEnvi() and so on... Do you people do this once for all textures or one time for every texture? I suppose you''re supposed to do it for every texture, but how does opengl know which texture one is referring too? There is no kind of identification in theese functions I mean. What I''m trying to do is light mapping with texture projection. And I''m not using the (I think)nVidea-only stuff with ARB in function names. Is that a better solution perhaps? Can anyone give me a hint/answer? Thanks!
Brother Bob
Brother Bob
TexParameter sets parameters specific to a texture, which is the texture currently bound by BindTexture. Usually, you set this once and leave it. TexEnv sets parameters specific to a texture unit, which is the texture unit activated by ActiveTexture. These parameters needs to be changed when you want to change the way textures and other colors are combined (for each "material", if you like).
Ilici
Ilici
Somebody pointed this to me some time ago:
You have to set glTexParam for every textures as it modifies it's property vector on the server side.

When you bind a texture it's properties (filtering, wrapping) are loaded from its property vector.

EDIT: damn beaten to it by 23 seconds



[ My Site ]
'I wish life was not so short,' he thought. 'Languages take such a time, and so do all the things one wants to know about.' - J.R.R Tolkien
/*ilici*/


[edited by - Ilici on October 17, 2003 9:11:00 AM]
Tompa
Tompa
Thanks!

Did anyone of you try to get a moving/dynamic spotlight with texture projection?

As it is now, it doesn''t work for me even if I know more after your answers. That is, I know what problem it''s not.

Topic Locked

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

Sign in to reply to this topic.