I want to output depth from a POV at fragments whose coordinates are from another POV.
In fact, I want to display objects from my camera POV, but for each fragment, I want to render depth from another camera POV.
Is that possible ?
I will try to explain myself better.
In fact, I have some object seen from my main POV, the one used to display objects.
I would like render those objects exactly but from another POV, in order to get depth and some other things.
You want the depth at each position visible from camera A relative to another cameras position B?
If that’s what you want, that’s possible by projecting the fragments onto the 2. camera in a fragment shader. That’s also done for shadowmapping, maybe you want to look up how that’s done and if it helps with your problem.
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
glClear(GL_DEPTH_BUFFER_BIT); //Clear depth only
glColorMask(FALSE, FALSE, FALSE, FALSE); //Will disable color writes
glColorMask(TRUE, TRUE, TRUE, TRUE);
In fact, what I need is much more complex than that, and I drop off this idea because of its complexity (FMN) in my case, which is far from RT.
But thanks everyone for your answers, it may help others (or me, another time!)