Jump to content
  • Advertisement

Archived

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

Corrail

Using TexUnv without Textures

This topic is 5441 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
Advertisement

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!