浏览代码

Made sure any IBL is cleared when closing a sample. There were some cases where the IBL from one sample could persist when opening another sample, for example when going directly from the Mesh sample to the Parallax sample.

Signed-off-by: santorac <[email protected]>
santorac 3 年之前
父节点
当前提交
3494fe1ebb
共有 1 个文件被更改,包括 3 次插入0 次删除
  1. 3 0
      Gem/Code/Source/CommonSampleComponentBase.cpp

+ 3 - 0
Gem/Code/Source/CommonSampleComponentBase.cpp

@@ -121,6 +121,7 @@ namespace AtomSampleViewer
     {
         AZ::Render::SkyBoxFeatureProcessorInterface* skyboxFeatureProcessor = AZ::RPI::Scene::GetFeatureProcessorForEntityContextId<AZ::Render::SkyBoxFeatureProcessorInterface>(m_entityContextId);
         AZ::Render::DirectionalLightFeatureProcessorInterface* directionalLightFeatureProcessor = AZ::RPI::Scene::GetFeatureProcessorForEntityContextId<AZ::Render::DirectionalLightFeatureProcessorInterface>(m_entityContextId);
+        AZ::Render::ImageBasedLightFeatureProcessorInterface* iblFeatureProcessor = AZ::RPI::Scene::GetFeatureProcessorForEntityContextId<AZ::Render::ImageBasedLightFeatureProcessorInterface>(m_entityContextId);
 
         for (AZ::Render::DirectionalLightFeatureProcessorInterface::LightHandle& handle : m_lightHandles)
         {
@@ -137,6 +138,8 @@ namespace AtomSampleViewer
 
         skyboxFeatureProcessor->Enable(false);
 
+        iblFeatureProcessor->Reset();
+
         AZ::TransformNotificationBus::MultiHandler::BusDisconnect();
         AZ::EntityBus::MultiHandler::BusDisconnect();
     }