- moved the last remaining function from gl_shadowmap.cpp elsewhere so that the file can be deleted.

This commit is contained in:
Christoph Oelckers 2018-10-28 17:09:22 +01:00
commit e6efee61b1
7 changed files with 61 additions and 98 deletions

View file

@ -60,6 +60,7 @@
#include "hwrenderer/data/hw_viewpointbuffer.h"
#include "r_videoscale.h"
#include "r_data/models/models.h"
#include "gl/renderer/gl_postprocessstate.h"
EXTERN_CVAR(Int, screenblocks)
EXTERN_CVAR(Bool, cl_capfps)
@ -177,6 +178,38 @@ void FGLRenderer::EndOffscreen()
glBindFramebuffer(GL_FRAMEBUFFER, mOldFBID);
}
//===========================================================================
//
//
//
//===========================================================================
void FGLRenderer::UpdateShadowMap()
{
if (mShadowMap.PerformUpdate())
{
FGLDebug::PushGroup("ShadowMap");
FGLPostProcessState savedState;
mBuffers->BindShadowMapFB();
mShadowMapShader->Bind(NOQUEUE);
mShadowMapShader->Uniforms->ShadowmapQuality = gl_shadowmap_quality;
mShadowMapShader->Uniforms.Set();
glViewport(0, 0, gl_shadowmap_quality, 1024);
RenderScreenQuad();
const auto &viewport = screen->mScreenViewport;
glViewport(viewport.left, viewport.top, viewport.width, viewport.height);
mBuffers->BindShadowMapTexture(16);
FGLDebug::PopGroup();
mShadowMap.FinishUpdate();
}
}
//-----------------------------------------------------------------------------
//
// renders the view
@ -230,7 +263,7 @@ sector_t *FGLRenderer::RenderView(player_t* player)
fovratio = ratio;
}
mShadowMap.Update();
UpdateShadowMap();
retsec = RenderViewpoint(r_viewpoint, player->camera, NULL, r_viewpoint.FieldOfView.Degrees, ratio, fovratio, true, true);
}
All.Unclock();