Jump to content
  • Advertisement

Archived

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

spud

NeHe Bumpmapping Tutorial (#22) Question

This topic is 5726 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

When you "invert" the bumpmap, are you creating a "negative image" of the bumpmap?

Share this post


Link to post
Share on other sites
Advertisement
Yes, in this section :


glGenTextures(3, invbump); // Create Three Textures

// Create Nearest Filtered Texture
glBindTexture(GL_TEXTURE_2D, invbump[0]);
glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MAG_FILTER,GL_NEAREST);
glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MIN_FILTER,GL_NEAREST);
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB8, Image->sizeX, Image->sizeY, 0, GL_RGB, GL_UNSIGNED_BYTE, Image->data);

// Create Linear Filtered Texture
glBindTexture(GL_TEXTURE_2D, invbump[1]);
glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MAG_FILTER,GL_LINEAR);
glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MIN_FILTER,GL_LINEAR);
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB8, Image->sizeX, Image->sizeY, 0, GL_RGB, GL_UNSIGNED_BYTE, Image->data);

// Create MipMapped Texture
glBindTexture(GL_TEXTURE_2D, invbump[2]);
glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MAG_FILTER,GL_LINEAR);
glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MIN_FILTER,GL_LINEAR_MIPMAP_NEAREST);
gluBuild2DMipmaps(GL_TEXTURE_2D, GL_RGB8, Image->sizeX, Image->sizeY, GL_RGB, GL_UNSIGNED_BYTE, Image->data);

glPixelTransferf(GL_RED_SCALE,1.0f); // Scale RGB Back To 100% Again
glPixelTransferf(GL_GREEN_SCALE,1.0f);
glPixelTransferf(GL_BLUE_SCALE,1.0f);


========================
Leyder Dylan
http://ibelgique.ifrance.com/Slug-Production/

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

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

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!