Grab tanHalfFovy from the projection matrix

This commit is contained in:
Magnus Norddahl 2016-09-09 09:47:46 +02:00
parent f6bede8374
commit 8861b1aaff

View file

@ -168,7 +168,7 @@ void FGLRenderer::AmbientOccludeScene()
bool multisample = gl_multisample > 1; bool multisample = gl_multisample > 1;
//float tanHalfFovy = tan(fovy * (M_PI / 360.0f)); //float tanHalfFovy = tan(fovy * (M_PI / 360.0f));
float tanHalfFovy = 1.0f / 1.33333302f; // 1.0f / gl_RenderState.mProjectionMatrix.get()[5]; float tanHalfFovy = 1.0f / gl_RenderState.mProjectionMatrix.get()[5];
float invFocalLenX = tanHalfFovy * (mBuffers->GetSceneWidth() / (float)mBuffers->GetSceneHeight()); float invFocalLenX = tanHalfFovy * (mBuffers->GetSceneWidth() / (float)mBuffers->GetSceneHeight());
float invFocalLenY = tanHalfFovy; float invFocalLenY = tanHalfFovy;
float nDotVBias = clamp(bias, 0.0f, 1.0f); float nDotVBias = clamp(bias, 0.0f, 1.0f);