Say I have a texture sitting in video memory and somewhere hidden inside this texture maybe one or more pixels with a particular color. In c++ I want to call a function on this gltexture to check for the presence of this color and simply return true or false. What is the fastest way to do this?
Share
I guess the best performance/simplicity ratio would be to keep a copy on the CPU and test each texel, optionnaly with SSE.
You can also do it in OpenGL :
I’m not sure of the performance of this, but it’s likely to by the fastest you’ll get on the GPU side. Note that while fast, this method has lag : you usually only get the occlusion query’s result 1 or 2 frames later (you can also busy wait, though).