- move view and projection matrices to DrawInfo.

This commit is contained in:
Christoph Oelckers 2018-06-21 20:54:34 +02:00
commit 1967165633
27 changed files with 80 additions and 94 deletions

View file

@ -81,7 +81,7 @@ void FGLRenderer::PostProcessScene(int fixedcm, const std::function<void()> &aft
//
//-----------------------------------------------------------------------------
void FGLRenderer::AmbientOccludeScene()
void FGLRenderer::AmbientOccludeScene(float m5)
{
FGLDebug::PushGroup("AmbientOccludeScene");
@ -94,7 +94,7 @@ void FGLRenderer::AmbientOccludeScene()
float aoStrength = gl_ssao_strength;
//float tanHalfFovy = tan(fovy * (M_PI / 360.0f));
float tanHalfFovy = 1.0f / gl_RenderState.mProjectionMatrix.get()[5];
float tanHalfFovy = 1.0f / m5;
float invFocalLenX = tanHalfFovy * (mBuffers->GetSceneWidth() / (float)mBuffers->GetSceneHeight());
float invFocalLenY = tanHalfFovy;
float nDotVBias = clamp(bias, 0.0f, 1.0f);