I used FBO to render the depth buffer to a texture. Now I need to find the min value stored in that texture. My first approach was to render the texture in the frame buffer and then call glReadPixels() to store the value on an array and then find the min value in the array. That’s so slow because of passing from gpu to cpu with glReadPixels().
Does anybody nows how could I did faster?