I collect a depthbuffer from a scene. I notice however that when the camera and the scene's objects stay at the same position and the camera only rotates, the depthbuffer collects different results, e.g. an object shown on the side of the screen has different depth than when shown in the middle. This might be a feature of OpenGL, but even then, how can I correct for this? What to take in account?
I linearize my depth with the following function:
float linearize(float depth) {
float zNear = 0.1;
float zFar = 100.0;
return (2.0 * zNear) / (zFar + zNear - depth * (zFar - zNear));
}
I checked the near and far values they're supposed to be okay.