I’m trying to get a nice lens flare going, and I need it to fade out when something gets between it and the camera. The most obvious solution involes obtaining the screen position of the lens flare, checking the depth buffer value at that position and then comparing with the depth value of the flare position.
My problem is this: glReadPixels. I knew it was slow, but I didn’t think it was this slow! I’ve found that just reading the depth buffer value for a single screen position roughly quarters my frame rate.
Can anybody suggest another way of doing this ?
Thanks in advance.