Jump to content
  • Advertisement
Sign in to follow this  

GL_DEPTH_COMPONENT Question

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

With GL_DEPTH_COMPONENT being used with this function. glCopyTexImage2D(GL_TEXTURE_2D, 0, GL_DEPTH_COMPONENT, 0, 0, WATER_TEXTURE_SIZE, WATER_TEXTURE_SIZE, 0); I have a rgb texture setup and was wondering should I be using a 8bit greyscale texture instead? Or will GL just map the same value to all three channels or just Red channel? I am not sure how this works. Thanks for any help in clearing this up.

Share this post


Link to post
Share on other sites
Advertisement
Yes the internal format should be GL_DEPTH_COMPONENT but the external format can also be a GL_DEPTH_COMPONENT (for example a 24 bit depth component).

This is how I do to create shadow maps:
glTexImage2D( GL_TEXTURE_2D, 0, GL_DEPTH_COMPONENT24, m_size, m_size,
0, GL_DEPTH_COMPONENT, GL_UNSIGNED_BYTE, NULL );

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • 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!