Adding ray tracing toggle to mesh component UI

Adding ray tracing toggle to mesh component UI

Signed-off-by: windbagjacket <nibor@ntlworld.com>
This commit is contained in:
windbagjacket
2022-01-11 13:21:12 +00:00
parent f09055af42
commit 71732c1f45
3 changed files with 7 additions and 2 deletions
@@ -76,6 +76,7 @@ namespace AZ
->Field("SortKey", &MeshComponentConfig::m_sortKey)
->Field("ExcludeFromReflectionCubeMaps", &MeshComponentConfig::m_excludeFromReflectionCubeMaps)
->Field("UseForwardPassIBLSpecular", &MeshComponentConfig::m_useForwardPassIblSpecular)
->Field("IsRayTracingEnabled", &MeshComponentConfig::m_isRayTracingEnabled)
->Field("LodType", &MeshComponentConfig::m_lodType)
->Field("LodOverride", &MeshComponentConfig::m_lodOverride)
->Field("MinimumScreenCoverage", &MeshComponentConfig::m_minimumScreenCoverage)
@@ -382,6 +383,7 @@ namespace AZ
meshDescriptor.m_modelAsset = m_configuration.m_modelAsset;
meshDescriptor.m_useForwardPassIblSpecular = m_configuration.m_useForwardPassIblSpecular;
meshDescriptor.m_requiresCloneCallback = RequiresCloning;
meshDescriptor.m_isRayTracingEnabled = m_configuration.m_isRayTracingEnabled;
m_meshHandle = m_meshFeatureProcessor->AcquireMesh(meshDescriptor, materials);
m_meshFeatureProcessor->ConnectModelChangeEventHandler(m_meshHandle, m_changeEventHandler);
@@ -392,7 +394,7 @@ namespace AZ
m_meshFeatureProcessor->SetMeshLodConfiguration(m_meshHandle, GetMeshLodConfiguration());
m_meshFeatureProcessor->SetExcludeFromReflectionCubeMaps(m_meshHandle, m_configuration.m_excludeFromReflectionCubeMaps);
m_meshFeatureProcessor->SetVisible(m_meshHandle, m_isVisible);
m_meshFeatureProcessor->SetRayTracingEnabled(m_meshHandle, meshDescriptor.m_isRayTracingEnabled);
// [GFX TODO] This should happen automatically. m_changeEventHandler should be passed to AcquireMesh
// If the model instance or asset already exists, announce a model change to let others know it's loaded.
HandleModelChange(m_meshFeatureProcessor->GetModel(m_meshHandle));