MCPcopy Create free account
hub / github.com/carbonengine/trinity / RenderShadows

Method RenderShadows

trinity/Tr2VolumetricsRenderer.cpp:1115–1145  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1113}
1114
1115void Tr2VolumetricsRenderer::RenderShadows(
1116 const EveComponentRegistry& registry,
1117 const Tr2TextureAL& shadowMap,
1118 Tr2RenderContext& renderContext )
1119{
1120 auto volumetricsCount = registry.ComponentCount<ITr2VolumetricRenderable>();
1121 if( !shadowMap.IsValid() || !m_castShadows )
1122 {
1123 return;
1124 }
1125 auto accumulator = m_batches.get();
1126
1127 registry.ProcessComponents<ITr2VolumetricRenderable>( [&accumulator]( ITr2VolumetricRenderable* volumetric ) { volumetric->GetVolumetricShadowBatches( accumulator ); } );
1128
1129 if( m_batches->GetBatchCount() )
1130 {
1131 GPU_REGION( renderContext, "Volumetric Shadows" );
1132
1133 m_batches->Finalize();
1134
1135 renderContext.m_esm.PushRenderTarget( shadowMap );
1136 renderContext.m_esm.PushDepthStencilBuffer( Tr2TextureAL() );
1137
1138 renderContext.m_esm.ApplyStandardStates( Tr2EffectStateManager::RM_ALPHA );
1139 renderContext.RenderBatches( m_batches.get(), BlueSharedString( "Shadow" ) );
1140 m_batches->Clear();
1141
1142 renderContext.m_esm.PopRenderTarget();
1143 renderContext.m_esm.PopDepthStencilBuffer();
1144 }
1145}
1146
1147void Tr2VolumetricsRenderer::UpdateVariableStore()
1148{

Callers

nothing calls this directly

Calls 13

getMethod · 0.80
GetBatchCountMethod · 0.80
FinalizeMethod · 0.80
ApplyStandardStatesMethod · 0.80
RenderBatchesMethod · 0.80
PopDepthStencilBufferMethod · 0.80
Tr2TextureALClass · 0.70
IsValidMethod · 0.45
PushRenderTargetMethod · 0.45
ClearMethod · 0.45

Tested by

no test coverage detected