Jump to content
  • Advertisement
Sign in to follow this  
castellp

OpenGL opengl Histogram

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

Hi folks, I'm trying to compute the histogram in a off-screen rendering to a texture. I'm just doing the simpliest sample, a white square in a black screen. The problem is that the texture is created and works fine but when I compute the histogram it has no sense, and it shows me different results each time. Once I have the texture I use the following code: glEnable(GL_HISTOGRAM); glEnable(GL_TEXTURE_2D); glHistogram(GL_HISTOGRAM, HISTOGRAM_SIZE, GL_RGB, GL_TRUE); glCopyTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, 0, 0, mypbuffer.width, mypbuffer.height); glGetHistogram(GL_HISTOGRAM, GL_FALSE, GL_RGB, GL_UNSIGNED_INT, histoGram); glResetHistogram(GL_HISTOGRAM); glDisable(GL_TEXTURE_2D); glDisable(GL_HISTOGRAM); Any idea? Thanks in advance.

Share this post


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

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