فهرست منبع

Atom Tools: Removing shadow catcher application from lighting presets

Signed-off-by: Guthrie Adams <[email protected]>
Guthrie Adams 3 سال پیش
والد
کامیت
a86e9d6d99

+ 0 - 128
AutomatedTesting/LightingPresets/greenwich_park_02.lightingconfig.json

@@ -1,128 +0,0 @@
-{
-    "configurations": [
-        {
-            "displayName": "Greenwich Park 02",
-            "skyboxImageAsset": {
-                "assetId": {
-                    "guid": "{3B78EA69-7CF0-56A7-A49A-110B88412666}",
-                    "subId": 1000
-                },
-                "assetHint": "lightingpresets/greenwich_park_02_4k_iblskyboxcm.exr.streamingimage"
-            },
-            "iblSpecularImageAsset": {
-                "assetId": {
-                    "guid": "{3B78EA69-7CF0-56A7-A49A-110B88412666}",
-                    "subId": 2000
-                },
-                "assetHint": "lightingpresets/greenwich_park_02_4k_iblskyboxcm_iblspecular.exr.streamingimage"
-            },
-            "iblDiffuseImageAsset": {
-                "assetId": {
-                    "guid": "{3B78EA69-7CF0-56A7-A49A-110B88412666}",
-                    "subId": 3000
-                },
-                "assetHint": "lightingpresets/greenwich_park_02_4k_iblskyboxcm_ibldiffuse.exr.streamingimage"
-            },
-            "iblExposure": 0.0,
-            "skyboxExposure": 0.0,
-            "exposure": {
-                "compensateValue": 0.0,
-                "exposureControlType": 0,
-                "lightAdaptationSensitivity": 0.949999988079071,
-                "lightAdaptationScale": 0.8500000238418579,
-                "lightAdaptationSpeedLimit": 8.0,
-                "darkAdaptationSensitivity": 0.949999988079071,
-                "darkAdaptationScale": 0.8500000238418579,
-                "darkAdaptationSpeedLimit": 8.0,
-                "lightDarkExposureBorder": 0.0,
-                "autoExposureMin": -10.0,
-                "autoExposureMax": 10.0,
-                "eyeAdaptationDelayTime": 0.5
-            },
-            "lights": [
-                {
-                    "direction": [
-                        -1.0,
-                        -0.75,
-                        -0.5
-                    ],
-                    "color": [
-                        1.0,
-                        1.0,
-                        1.0,
-                        1.0
-                    ],
-                    "intensity": 1.0,
-                    "shadowCascadeCount": 4,
-                    "shadowRatioLogarithmUniform": 1.0,
-                    "shadowFarClipDistance": 20.0,
-                    "shadowmapSize": "Size2048",
-                    "enableShadowDebugColoring": false
-                }
-            ],
-            "shadowCatcherOpacity": 0.20000000298023225
-        },
-        {
-            "displayName": "Greenwich Park 02 (Alt)",
-            "skyboxImageAsset": {
-                "assetId": {
-                    "guid": "{3B78EA69-7CF0-56A7-A49A-110B88412666}",
-                    "subId": 3000
-                },
-                "assetHint": "lightingpresets/greenwich_park_02_4k_iblskyboxcm_ibldiffuse.exr.streamingimage"
-            },
-            "iblSpecularImageAsset": {
-                "assetId": {
-                    "guid": "{3B78EA69-7CF0-56A7-A49A-110B88412666}",
-                    "subId": 2000
-                },
-                "assetHint": "lightingpresets/greenwich_park_02_4k_iblskyboxcm_iblspecular.exr.streamingimage"
-            },
-            "iblDiffuseImageAsset": {
-                "assetId": {
-                    "guid": "{3B78EA69-7CF0-56A7-A49A-110B88412666}",
-                    "subId": 3000
-                },
-                "assetHint": "lightingpresets/greenwich_park_02_4k_iblskyboxcm_ibldiffuse.exr.streamingimage"
-            },
-            "iblExposure": 0.0,
-            "skyboxExposure": 0.0,
-            "exposure": {
-                "compensateValue": 0.0,
-                "exposureControlType": 0,
-                "lightAdaptationSensitivity": 0.949999988079071,
-                "lightAdaptationScale": 0.8500000238418579,
-                "lightAdaptationSpeedLimit": 8.0,
-                "darkAdaptationSensitivity": 0.949999988079071,
-                "darkAdaptationScale": 0.8500000238418579,
-                "darkAdaptationSpeedLimit": 8.0,
-                "lightDarkExposureBorder": 0.0,
-                "autoExposureMin": -10.0,
-                "autoExposureMax": 10.0,
-                "eyeAdaptationDelayTime": 0.5
-            },
-            "lights": [
-                {
-                    "direction": [
-                        -1.0,
-                        -0.75,
-                        -0.5
-                    ],
-                    "color": [
-                        1.0,
-                        1.0,
-                        1.0,
-                        1.0
-                    ],
-                    "intensity": 1.0,
-                    "shadowCascadeCount": 4,
-                    "shadowRatioLogarithmUniform": 1.0,
-                    "shadowFarClipDistance": 20.0,
-                    "shadowmapSize": "Size2048",
-                    "enableShadowDebugColoring": false
-                }
-            ],
-            "shadowCatcherOpacity": 0.10000000149011612
-        }
-    ]
-}

+ 1 - 3
Gems/Atom/Feature/Common/Code/Include/Atom/Feature/Utils/LightingPreset.h

@@ -95,9 +95,7 @@ namespace AZ
                 DirectionalLightFeatureProcessorInterface* directionalLightFeatureProcessor,
                 const Camera::Configuration& cameraConfig,
                 AZStd::vector<DirectionalLightFeatureProcessorInterface::LightHandle>& lightHandles,
-                Data::Instance<AZ::RPI::Material> shadowCatcherMaterial = nullptr,
-                RPI::MaterialPropertyIndex shadowCatcherOpacityPropertyIndex = RPI::MaterialPropertyIndex(),
-                bool enableAlternateSkybox = false) const;
+                bool enableAlternateSkybox) const;
         };
 
         using LightingPresetPtr = AZStd::shared_ptr<LightingPreset>;

+ 0 - 7
Gems/Atom/Feature/Common/Code/Source/Utils/LightingPreset.cpp

@@ -143,8 +143,6 @@ namespace AZ
             DirectionalLightFeatureProcessorInterface* directionalLightFeatureProcessor,
             const Camera::Configuration& cameraConfig,
             AZStd::vector<DirectionalLightFeatureProcessorInterface::LightHandle>& lightHandles,
-            Data::Instance<RPI::Material> shadowCatcherMaterial,
-            RPI::MaterialPropertyIndex shadowCatcherOpacityPropertyIndex,
             bool enableAlternateSkybox) const
         {
             if (iblFeatureProcessor)
@@ -204,11 +202,6 @@ namespace AZ
                     lightHandles.push_back(lightHandle);
                 }
             }
-
-            if (shadowCatcherMaterial && shadowCatcherOpacityPropertyIndex.IsValid())
-            {
-                shadowCatcherMaterial->SetPropertyValue(shadowCatcherOpacityPropertyIndex, m_shadowCatcherOpacity);
-            }
         }
     } // namespace Render
 } // namespace AZ

+ 6 - 1
Gems/Atom/Tools/MaterialCanvas/Code/Source/Viewport/MaterialCanvasViewportWidget.cpp

@@ -361,7 +361,12 @@ namespace MaterialCanvas
         const bool enableAlternateSkybox = viewportRequests->GetAlternateSkyboxEnabled();
         viewportRequests->GetLightingPreset().ApplyLightingPreset(
             iblFeatureProcessor, m_skyboxFeatureProcessor, exposureControlSettingInterface, m_directionalLightFeatureProcessor,
-            cameraConfig, m_lightHandles, m_shadowCatcherMaterial, m_shadowCatcherOpacityPropertyIndex, enableAlternateSkybox);
+            cameraConfig, m_lightHandles, enableAlternateSkybox);
+
+        if (m_shadowCatcherMaterial && m_shadowCatcherOpacityPropertyIndex.IsValid())
+        {
+            m_shadowCatcherMaterial->SetPropertyValue(m_shadowCatcherOpacityPropertyIndex, viewportRequests->GetLightingPreset().m_shadowCatcherOpacity);
+        }
     }
 
     void MaterialCanvasViewportWidget::UpdateModel(MaterialCanvasViewportRequests* viewportRequests)

+ 6 - 1
Gems/Atom/Tools/MaterialEditor/Code/Source/Viewport/MaterialViewportWidget.cpp

@@ -371,7 +371,12 @@ namespace MaterialEditor
         const bool enableAlternateSkybox = viewportRequests->GetAlternateSkyboxEnabled();
         viewportRequests->GetLightingPreset().ApplyLightingPreset(
             iblFeatureProcessor, m_skyboxFeatureProcessor, exposureControlSettingInterface, m_directionalLightFeatureProcessor,
-            cameraConfig, m_lightHandles, m_shadowCatcherMaterial, m_shadowCatcherOpacityPropertyIndex, enableAlternateSkybox);
+            cameraConfig, m_lightHandles, enableAlternateSkybox);
+
+        if (m_shadowCatcherMaterial && m_shadowCatcherOpacityPropertyIndex.IsValid())
+        {
+            m_shadowCatcherMaterial->SetPropertyValue(m_shadowCatcherOpacityPropertyIndex, viewportRequests->GetLightingPreset().m_shadowCatcherOpacity);
+        }
     }
 
     void MaterialViewportWidget::UpdateModel(MaterialViewportRequests* viewportRequests)

+ 0 - 128
Gems/AtomLyIntegration/CommonFeatures/Assets/EnvHDRi/photo_studio_01.lightingconfig.json

@@ -1,128 +0,0 @@
-{
-    "configurations": [
-        {
-            "displayName": "Photo Studio 01",
-            "skyboxImageAsset": {
-                "assetId": {
-                    "guid": "{B78C84E9-45BE-5A50-8898-177B33B8DA84}",
-                    "subId": 1000
-                },
-                "assetHint": "envhdri/photo_studio_01_4k_iblskyboxcm.exr.streamingimage"
-            },
-            "iblSpecularImageAsset": {
-                "assetId": {
-                    "guid": "{B78C84E9-45BE-5A50-8898-177B33B8DA84}",
-                    "subId": 2000
-                },
-                "assetHint": "envhdri/photo_studio_01_4k_iblskyboxcm_iblspecular.exr.streamingimage"
-            },
-            "iblDiffuseImageAsset": {
-                "assetId": {
-                    "guid": "{B78C84E9-45BE-5A50-8898-177B33B8DA84}",
-                    "subId": 3000
-                },
-                "assetHint": "envhdri/photo_studio_01_4k_iblskyboxcm_ibldiffuse.exr.streamingimage"
-            },
-            "iblExposure": 0.0,
-            "skyboxExposure": 0.0,
-            "exposure": {
-                "compensateValue": 0.0,
-                "exposureControlType": 0,
-                "lightAdaptationSensitivity": 0.949999988079071,
-                "lightAdaptationScale": 0.8500000238418579,
-                "lightAdaptationSpeedLimit": 8.0,
-                "darkAdaptationSensitivity": 0.949999988079071,
-                "darkAdaptationScale": 0.8500000238418579,
-                "darkAdaptationSpeedLimit": 8.0,
-                "lightDarkExposureBorder": 0.0,
-                "autoExposureMin": -10.0,
-                "autoExposureMax": 10.0,
-                "eyeAdaptationDelayTime": 0.5
-            },
-            "lights": [
-                {
-                    "direction": [
-                        0.15000000596046449,
-                        -0.15000000596046449,
-                        -1.0
-                    ],
-                    "color": [
-                        1.0,
-                        1.0,
-                        1.0,
-                        1.0
-                    ],
-                    "intensity": 1.0,
-                    "shadowCascadeCount": 4,
-                    "shadowRatioLogarithmUniform": 1.0,
-                    "shadowFarClipDistance": 20.0,
-                    "shadowmapSize": "Size2048",
-                    "enableShadowDebugColoring": false
-                }
-            ],
-            "shadowCatcherOpacity": 0.25
-        },
-        {
-            "displayName": "Photo Studio 01 (Alt)",
-            "skyboxImageAsset": {
-                "assetId": {
-                    "guid": "{B78C84E9-45BE-5A50-8898-177B33B8DA84}",
-                    "subId": 3000
-                },
-                "assetHint": "envhdri/photo_studio_01_4k_iblskyboxcm_ibldiffuse.exr.streamingimage"
-            },
-            "iblSpecularImageAsset": {
-                "assetId": {
-                    "guid": "{B78C84E9-45BE-5A50-8898-177B33B8DA84}",
-                    "subId": 2000
-                },
-                "assetHint": "envhdri/photo_studio_01_4k_iblskyboxcm_iblspecular.exr.streamingimage"
-            },
-            "iblDiffuseImageAsset": {
-                "assetId": {
-                    "guid": "{B78C84E9-45BE-5A50-8898-177B33B8DA84}",
-                    "subId": 3000
-                },
-                "assetHint": "envhdri/photo_studio_01_4k_iblskyboxcm_ibldiffuse.exr.streamingimage"
-            },
-            "iblExposure": 0.0,
-            "skyboxExposure": 0.0,
-            "exposure": {
-                "compensateValue": 0.0,
-                "exposureControlType": 0,
-                "lightAdaptationSensitivity": 0.949999988079071,
-                "lightAdaptationScale": 0.8500000238418579,
-                "lightAdaptationSpeedLimit": 8.0,
-                "darkAdaptationSensitivity": 0.949999988079071,
-                "darkAdaptationScale": 0.8500000238418579,
-                "darkAdaptationSpeedLimit": 8.0,
-                "lightDarkExposureBorder": 0.0,
-                "autoExposureMin": -10.0,
-                "autoExposureMax": 10.0,
-                "eyeAdaptationDelayTime": 0.5
-            },
-            "lights": [
-                {
-                    "direction": [
-                        0.15000000596046449,
-                        -0.15000000596046449,
-                        -1.0
-                    ],
-                    "color": [
-                        1.0,
-                        1.0,
-                        1.0,
-                        1.0
-                    ],
-                    "intensity": 1.0,
-                    "shadowCascadeCount": 4,
-                    "shadowRatioLogarithmUniform": 1.0,
-                    "shadowFarClipDistance": 20.0,
-                    "shadowmapSize": "Size2048",
-                    "enableShadowDebugColoring": false
-                }
-            ],
-            "shadowCatcherOpacity": 0.15000000596046449
-        }
-    ]
-}

+ 1 - 1
Gems/AtomLyIntegration/CommonFeatures/Code/Source/SharedPreview/SharedPreviewContent.cpp

@@ -147,7 +147,7 @@ namespace AZ
 
                     preset->ApplyLightingPreset(
                         iblFeatureProcessor, skyboxFeatureProcessor, exposureControlSettingInterface, directionalLightFeatureProcessor,
-                        cameraConfig, lightHandles);
+                        cameraConfig, lightHandles, false);
                 }
             }
         }

+ 1 - 1
Gems/AtomLyIntegration/EMotionFXAtom/Code/Tools/EMStudio/AnimViewportRenderer.cpp

@@ -374,6 +374,6 @@ namespace EMStudio
 
         preset->ApplyLightingPreset(
             iblFeatureProcessor, m_skyboxFeatureProcessor, exposureControlSettingInterface, m_directionalLightFeatureProcessor,
-            cameraConfig, m_lightHandles, nullptr, AZ::RPI::MaterialPropertyIndex::Null, false);
+            cameraConfig, m_lightHandles, false);
     }
 } // namespace EMStudio