MCPcopy Create free account
hub / github.com/ZDoom/Raze / UpdateShadowMap

Method UpdateShadowMap

source/common/rendering/gl/gl_framebuffer.cpp:437–467  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

435}
436
437void OpenGLFrameBuffer::UpdateShadowMap()
438{
439 if (mShadowMap.PerformUpdate())
440 {
441 FGLDebug::PushGroup("ShadowMap");
442
443 FGLPostProcessState savedState;
444
445 static_cast<GLDataBuffer*>(screen->mShadowMap.mLightList)->BindBase();
446 static_cast<GLDataBuffer*>(screen->mShadowMap.mNodesBuffer)->BindBase();
447 static_cast<GLDataBuffer*>(screen->mShadowMap.mLinesBuffer)->BindBase();
448
449 GLRenderer->mBuffers->BindShadowMapFB();
450
451 GLRenderer->mShadowMapShader->Bind();
452 GLRenderer->mShadowMapShader->Uniforms->ShadowmapQuality = gl_shadowmap_quality;
453 GLRenderer->mShadowMapShader->Uniforms->NodesCount = screen->mShadowMap.NodesCount();
454 GLRenderer->mShadowMapShader->Uniforms.SetData();
455 static_cast<GLDataBuffer*>(GLRenderer->mShadowMapShader->Uniforms.GetBuffer())->BindBase();
456
457 glViewport(0, 0, gl_shadowmap_quality, 1024);
458 GLRenderer->RenderScreenQuad();
459
460 const auto& viewport = screen->mScreenViewport;
461 glViewport(viewport.left, viewport.top, viewport.width, viewport.height);
462
463 GLRenderer->mBuffers->BindShadowMapTexture(16);
464 FGLDebug::PopGroup();
465 screen->mShadowMap.FinishUpdate();
466 }
467}
468
469void OpenGLFrameBuffer::WaitForCommands(bool finish)
470{

Callers

nothing calls this directly

Calls 10

PerformUpdateMethod · 0.80
BindShadowMapFBMethod · 0.80
BindShadowMapTextureMethod · 0.80
FinishUpdateMethod · 0.80
BindBaseMethod · 0.45
BindMethod · 0.45
NodesCountMethod · 0.45
SetDataMethod · 0.45
GetBufferMethod · 0.45
RenderScreenQuadMethod · 0.45

Tested by

no test coverage detected