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.
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.
Thanks for the ideas,
I found a simple way I think is the most efficient. I initially thought occlusion queries could only be used with geometry but they can also be used with textures.
discard
texels below required
color intensity