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

Method Filter

trinity/Tr2ReflectionProbe.cpp:347–381  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

345}
346
347void Tr2ReflectionProbe::Filter( Tr2RenderContext& renderContext )
348{
349 if( !IsValid() )
350 return;
351
352 {
353 GPU_REGION( renderContext, "Reflection Pre Filter" );
354
355 if( m_hollywoodMode )
356 {
357 m_preFilterEffect->SetParameter( s_backLightColorName, Vector4( m_backlightColor ) );
358 m_preFilterEffect->SetParameter( s_backLightContrastName, m_backlightContrast );
359 m_preFilterEffect->SetParameter( s_viewDirectionName, Tr2Renderer::GetInverseViewTransform().GetZ() );
360
361 m_copyMipEffect->SetParameter( s_backLightColorName, Vector4( m_backlightColor ) );
362 m_copyMipEffect->SetParameter( s_backLightContrastName, m_backlightContrast );
363 m_copyMipEffect->SetParameter( s_viewDirectionName, Tr2Renderer::GetInverseViewTransform().GetZ() );
364 }
365
366 Tr2Renderer::RunComputeShader( m_preFilterEffect, FILTER_SIZE * 2 / 8, FILTER_SIZE * 2 / 8, 6, renderContext );
367 }
368
369 {
370 GPU_REGION( renderContext, "Reflection Filter Mip Generation" );
371 m_preFilterTarget->GenerateMipMaps();
372 }
373 {
374 GPU_REGION( renderContext, "Reflection Main Filter" );
375 Tr2Renderer::RunComputeShader( m_filterEffect, FILTER_GROUP_DIM, 6, 1, renderContext );
376 }
377 {
378 GPU_REGION( renderContext, "Copy Mip" );
379 Tr2Renderer::RunComputeShader( m_copyMipEffect, FILTER_SIZE * 2 / 8, FILTER_SIZE * 2 / 8, 6, renderContext );
380 }
381}
382
383void Tr2ReflectionProbe::RunFilter()
384{

Callers

nothing calls this directly

Calls 5

IsValidFunction · 0.70
Vector4Class · 0.50
SetParameterMethod · 0.45
GetZMethod · 0.45
GenerateMipMapsMethod · 0.45

Tested by

no test coverage detected