Archived

This topic is now archived and is closed to further replies.

Using TexUnv without Textures

This topic is 5131 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hello! I''ve got the following problem: I want to use the TexEnv of a Texture Unit without a texture but I''m afraid of performance loss:
glActiveTexture(GL_TEXTURE0);
glBindTexture(GL_TEXTURE_CUBE_MAP, NormCubeMap);
glEnable(GL_TEXTURE_CUBE_MAP);

glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_COMBINE);
glTexEnvi(GL_TEXTURE_ENV, GL_COMBINE_RGB, GL_DOT3_RGB);
glTexEnvi(GL_TEXTURE_ENV, GL_SOURCE0, GL_TEXTURE0);
glTexEnvi(GL_TEXTURE_ENV, GL_SOURCE1, GL_TEXTURE1);

glActiveTexture(GL_TEXTURE1);
glBindTexture(GL_TEXTURE_2D, Bump);
glEnable(GL_TEXTURE_2D);

glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_COMBINE);
glTexEnvi(GL_TEXTURE_ENV, GL_COMBINE_RGB, GL_MODULATE);
glTexEnvi(GL_TEXTURE_ENV, GL_SOURCE0, GL_PREVIOUS);
glTexEnvi(GL_TEXTURE_ENV, GL_SOURCE1, GL_PREVIOUS);

glActiveTexture(GL_TEXTURE2);
glBindTexture(GL_TEXTURE_2D, nomap);
glEnable(GL_TEXTURE_2D);

glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_COMBINE);
glTexEnvi(GL_TEXTURE_ENV, GL_COMBINE_RGB, GL_MODULATE);
glTexEnvi(GL_TEXTURE_ENV, GL_SOURCE0, GL_PREVIOUS);
glTexEnvi(GL_TEXTURE_ENV, GL_SOURCE1, GL_PREVIOUS);

Here I use Texture Unit 2 only for taking the square of Texture Unit 1. But if I disable textureing the Texture Environment won''t work. But how can I use this Texture Unit only for Texture Env. I don''t pay the cost of sampling a texture here... Thanks for any help! -------------------------------------------------------- "If it looks good, it is good computer graphics" "If it looks like computer graphics, it is bad computer graphics" Corrail corrail@gmx.at ICQ#59184081

Share this post


Link to post
Share on other sites