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

Method GetVelocityMapIfNeeded

trinity/Eve/EveSpaceSceneRenderDriver.cpp:653–670  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

651}
652
653Tr2GpuResourcePool::Texture EveSpaceSceneRenderDriver::GetVelocityMapIfNeeded( const TextureSize2D& size, const Span<TempOutput>& outputs )
654{
655 USE_MAIN_THREAD_RENDER_CONTEXT();
656 auto upscalingInfo = renderContext.GetUpscalingInfo( m_upscalingContext ? m_upscalingContext->GetID() : Tr2UpscalingAL::INVALID_CONTEXT_ID );
657 bool needsVelocityMap = m_settings.antiAliasingQuality != AntiAliasingQuality::Disabled || ( upscalingInfo.technique != Tr2UpscalingAL::NONE && upscalingInfo.temporal );
658 auto namedOutput = FindNamedOutput( outputs, "VelocityMap" );
659 Tr2GpuResourcePool::Texture velocityMap;
660 if( needsVelocityMap || m_settings.forceVelocityMap || namedOutput )
661 {
662 auto texture = m_gpuResourcePool.GetTempTexture( "velocityMap", size, ImageIO::PIXEL_FORMAT_R16G16_FLOAT, Tr2GpuUsage::RENDER_TARGET | Tr2GpuUsage::SHADER_RESOURCE );
663 if( namedOutput )
664 {
665 namedOutput->texture = texture;
666 }
667 return texture;
668 }
669 return {};
670}
671
672Tr2GpuResourcePool::Texture EveSpaceSceneRenderDriver::GetNormalMapIfNeeded( const TextureSize2D& size, const Span<TempOutput>& outputs )
673{

Callers

nothing calls this directly

Calls 4

FindNamedOutputFunction · 0.85
GetTempTextureMethod · 0.80
GetUpscalingInfoMethod · 0.45
GetIDMethod · 0.45

Tested by

no test coverage detected