@ -115,10 +115,6 @@ namespace AZ
// all faces of the cubemap have been rendered, invoke the callback
// all faces of the cubemap have been rendered, invoke the callback
m_callback ( m_environmentCubeMapPass - > GetTextureData ( ) , m_environmentCubeMapPass - > GetTextureFormat ( ) ) ;
m_callback ( m_environmentCubeMapPass - > GetTextureData ( ) , m_environmentCubeMapPass - > GetTextureFormat ( ) ) ;
// remove the pipeline
m_scene - > RemoveRenderPipeline ( m_environmentCubeMapPipelineId ) ;
m_environmentCubeMapPass = nullptr ;
// restore exposures
// restore exposures
sceneSrg - > SetConstant ( m_globalIblExposureConstantIndex , m_previousGlobalIblExposure ) ;
sceneSrg - > SetConstant ( m_globalIblExposureConstantIndex , m_previousGlobalIblExposure ) ;
sceneSrg - > SetConstant ( m_skyBoxExposureConstantIndex , m_previousSkyBoxExposure ) ;
sceneSrg - > SetConstant ( m_skyBoxExposureConstantIndex , m_previousSkyBoxExposure ) ;
@ -223,6 +219,16 @@ namespace AZ
}
}
}
}
void ReflectionProbe : : OnRenderEnd ( )
{
if ( m_environmentCubeMapPass & & m_environmentCubeMapPass - > IsFinished ( ) )
{
// remove the cubemap pipeline
// Note: this must be done here (not in Simulate) to avoid a race condition with other feature processors
m_scene - > RemoveRenderPipeline ( m_environmentCubeMapPipelineId ) ;
m_environmentCubeMapPass = nullptr ;
}
}
void ReflectionProbe : : SetTransform ( const AZ : : Transform & transform )
void ReflectionProbe : : SetTransform ( const AZ : : Transform & transform )
{
{
@ -282,7 +288,7 @@ namespace AZ
AZ : : RPI : : RenderPipelineDescriptor environmentCubeMapPipelineDesc ;
AZ : : RPI : : RenderPipelineDescriptor environmentCubeMapPipelineDesc ;
environmentCubeMapPipelineDesc . m_mainViewTagName = " MainCamera " ;
environmentCubeMapPipelineDesc . m_mainViewTagName = " MainCamera " ;
environmentCubeMapPipelineDesc . m_renderSettings . m_multisampleState . m_samples = 4 ;
environmentCubeMapPipelineDesc . m_renderSettings . m_multisampleState = RPI : : RPISystemInterface : : Get ( ) - > GetApplicationMultisampleState ( ) ;
environmentCubeMapPipelineDesc . m_renderSettings . m_size . m_width = RPI : : EnvironmentCubeMapPass : : CubeMapFaceSize ;
environmentCubeMapPipelineDesc . m_renderSettings . m_size . m_width = RPI : : EnvironmentCubeMapPass : : CubeMapFaceSize ;
environmentCubeMapPipelineDesc . m_renderSettings . m_size . m_height = RPI : : EnvironmentCubeMapPass : : CubeMapFaceSize ;
environmentCubeMapPipelineDesc . m_renderSettings . m_size . m_height = RPI : : EnvironmentCubeMapPass : : CubeMapFaceSize ;