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

Function ApplyDistortion

trinity/Eve/EveSpaceSceneRenderDriver.cpp:58–70  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

56}
57
58void ApplyDistortion( const Tr2TextureAL& destination, const Tr2TextureAL& distortion, Tr2GpuResourcePool& gpuResourcePool, const Tr2EffectPtr& effect, Tr2RenderContext& renderContext )
59{
60 auto backBufferCopy = gpuResourcePool.GetTempTexture( "backBufferCopy", destination.GetWidth(), destination.GetHeight(), destination.GetFormat(), Tr2GpuUsage::COPY_DESTINATION | Tr2GpuUsage::SHADER_RESOURCE );
61 backBufferCopy->CopySubresourceRegion( {}, destination, {}, renderContext );
62
63 BeginRenderPass( renderContext, { destination }, {} );
64 renderContext.m_esm.ApplyStandardStates( Tr2EffectStateManager::RM_FULLSCREEN );
65 effect->SetParameter( BlueSharedString( "BlitCurrent" ), backBufferCopy );
66 effect->SetParameter( BlueSharedString( "TexDistortion" ), distortion );
67 Tr2Renderer::DrawFullScreenWithShader( renderContext, effect );
68 effect->SetParameter( BlueSharedString( "BlitCurrent" ), Tr2TextureAL{} );
69 effect->SetParameter( BlueSharedString( "TexDistortion" ), Tr2TextureAL{} );
70}
71
72struct TimeSection
73{

Callers 1

ExecuteMethod · 0.85

Calls 8

BeginRenderPassFunction · 0.85
GetTempTextureMethod · 0.80
ApplyStandardStatesMethod · 0.80
GetWidthMethod · 0.45
GetHeightMethod · 0.45
GetFormatMethod · 0.45
CopySubresourceRegionMethod · 0.45
SetParameterMethod · 0.45

Tested by

no test coverage detected