Grab tanHalfFovy from the projection matrix

This commit is contained in:
Magnus Norddahl 2016-09-09 09:47:46 +02:00
parent e025f6e54b
commit 11725c435e

View file

@ -158,7 +158,7 @@ void FGLRenderer::AmbientOccludeScene()
bool multisample = gl_multisample > 1;
//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 invFocalLenY = tanHalfFovy;
float nDotVBias = clamp(bias, 0.0f, 1.0f);