Counting texels using a fragment shader

Posted by Brett on Stack Overflow See other posts from Stack Overflow or by Brett
Published on 2010-04-13T10:18:57Z Indexed on 2010/04/13 10:23 UTC
Read the original article Hit count: 528

Filed under:
|
|
|
|

Hi,
I have two textures generated using a fragment shader. I want to be able to count the number of texels in each texture that are above some colour intensity. My question is how can this be done? My initial thought is to count these texels using the fragment shader before generating the texture. However, this would require some sort of global counter. I can't use occlusion queries because the textures are created from other textures. I'm using OpenGL 2.1. Any ideas appreciated.
Thanks

© Stack Overflow or respective owner

Related posts about opengl

Related posts about fragment