diff --git a/src/gi/include/Gi.h b/src/gi/include/Gi.h index 59caeccc..a94dcc89 100644 --- a/src/gi/include/Gi.h +++ b/src/gi/include/Gi.h @@ -115,7 +115,6 @@ namespace gtl bool progressiveAccumulation; GiScene* scene; uint32_t mediumStackSize; - uint32_t maxVolumeWalkLength; }; struct GiGeomCacheParams @@ -137,6 +136,7 @@ namespace gtl uint32_t rrBounceOffset; float rrInvMinTermProb; float maxSampleValue; + uint32_t maxVolumeWalkLength; float backgroundColor[4]; GiDomeLight* domeLight; GiScene* scene; diff --git a/src/gi/shaders/interface/rp_main.h b/src/gi/shaders/interface/rp_main.h index 8c5e4b5c..62ac99d5 100644 --- a/src/gi/shaders/interface/rp_main.h +++ b/src/gi/shaders/interface/rp_main.h @@ -99,7 +99,8 @@ struct PushConstants GI_FLOAT lightIntensityMultiplier; GI_UINT clipRangePacked; GI_FLOAT sensorExposure; - /* 3 floats free */ + GI_UINT maxVolumeWalkLength; // NOTE: can be quantized + /* 2 floats free */ }; const GI_UINT BLAS_PAYLOAD_BITFLAG_IS_DOUBLE_SIDED = (1 << 0); diff --git a/src/gi/src/Gi.cpp b/src/gi/src/Gi.cpp index c0c57abf..ecf612c6 100644 --- a/src/gi/src/Gi.cpp +++ b/src/gi/src/Gi.cpp @@ -1155,7 +1155,6 @@ namespace gtl .depthOfField = params.depthOfField, .filterImportanceSampling = params.filterImportanceSampling, .materialCount = params.materialCount, - .maxVolumeWalkLength = params.maxVolumeWalkLength, .nextEventEstimation = nextEventEstimation, .progressiveAccumulation = params.progressiveAccumulation, .reorderInvocations = s_deviceFeatures.rayTracingInvocationReorder, @@ -1462,7 +1461,8 @@ namespace gtl .rrInvMinTermProb = params.rrInvMinTermProb, .lightIntensityMultiplier = params.lightIntensityMultiplier, .clipRangePacked = glm::packHalf2x16(glm::vec2(params.camera.clipStart, params.camera.clipEnd)), - .sensorExposure = params.camera.exposure + .sensorExposure = params.camera.exposure, + .maxVolumeWalkLength = params.maxVolumeWalkLength }; std::vector buffers; diff --git a/src/gi/src/GlslShaderGen.cpp b/src/gi/src/GlslShaderGen.cpp index f67739b1..35d3c18c 100644 --- a/src/gi/src/GlslShaderGen.cpp +++ b/src/gi/src/GlslShaderGen.cpp @@ -126,8 +126,6 @@ namespace gtl stitcher.appendDefine("PROGRESSIVE_ACCUMULATION"); } - stitcher.appendDefine("MAX_VOLUME_WALK_LENGTH", (int32_t) params.maxVolumeWalkLength); - fs::path filePath = m_shaderPath / fileName; if (!stitcher.appendSourceFile(filePath)) { diff --git a/src/gi/src/GlslShaderGen.h b/src/gi/src/GlslShaderGen.h index 7f466e3d..869fee86 100644 --- a/src/gi/src/GlslShaderGen.h +++ b/src/gi/src/GlslShaderGen.h @@ -71,7 +71,6 @@ namespace gtl bool depthOfField; bool filterImportanceSampling; uint32_t materialCount; - uint32_t maxVolumeWalkLength; bool nextEventEstimation; bool progressiveAccumulation; bool reorderInvocations; diff --git a/src/gi/src/main.cpp b/src/gi/src/main.cpp index d71ae08d..e1b77130 100644 --- a/src/gi/src/main.cpp +++ b/src/gi/src/main.cpp @@ -138,8 +138,7 @@ TEST_CASE_FIXTURE(GraphicalTestFixture, "EmptyScene") .nextEventEstimation = false, .progressiveAccumulation = true, .scene = m_scene, - .mediumStackSize = 1, - .maxVolumeWalkLength = 7 + .mediumStackSize = 1 }; GiShaderCache* shaderCache = giCreateShaderCache(shaderCacheParams); @@ -178,6 +177,7 @@ TEST_CASE_FIXTURE(GraphicalTestFixture, "EmptyScene") .rrBounceOffset = 255, .rrInvMinTermProb = 0.0f, .maxSampleValue = 100.0f, + .maxVolumeWalkLength = 7, .backgroundColor = { 0.5f, 0.5f, 0.5f, 1.0f }, .domeLight = nullptr, .scene = m_scene diff --git a/src/hdGatling/renderPass.cpp b/src/hdGatling/renderPass.cpp index e3027e83..d1cb8808 100644 --- a/src/hdGatling/renderPass.cpp +++ b/src/hdGatling/renderPass.cpp @@ -437,8 +437,7 @@ void HdGatlingRenderPass::_Execute(const HdRenderPassStateSharedPtr& renderPassS .nextEventEstimation = _settings.find(HdGatlingSettingsTokens->nextEventEstimation)->second.Get(), .progressiveAccumulation = _settings.find(HdGatlingSettingsTokens->progressiveAccumulation)->second.Get(), .scene = _scene, - .mediumStackSize = (uint32_t) _settings.find(HdGatlingSettingsTokens->mediumStackSize)->second.Get(), - .maxVolumeWalkLength = (uint32_t) _settings.find(HdGatlingSettingsTokens->maxVolumeWalkLength)->second.Get() + .mediumStackSize = (uint32_t) _settings.find(HdGatlingSettingsTokens->mediumStackSize)->second.Get() }; _shaderCache = giCreateShaderCache(shaderParams); @@ -487,6 +486,7 @@ void HdGatlingRenderPass::_Execute(const HdRenderPassStateSharedPtr& renderPassS .rrBounceOffset = VtValue::Cast(_settings.find(HdGatlingSettingsTokens->rrBounceOffset)->second).Get(), .rrInvMinTermProb = VtValue::Cast(_settings.find(HdGatlingSettingsTokens->rrInvMinTermProb)->second).Get(), .maxSampleValue = VtValue::Cast(_settings.find(HdGatlingSettingsTokens->maxSampleValue)->second).Get(), + .maxVolumeWalkLength = VtValue::Cast(_settings.find(HdGatlingSettingsTokens->maxVolumeWalkLength)->second).Get(), .backgroundColor = { backgroundColor[0], backgroundColor[1], backgroundColor[2], backgroundColor[3] }, .domeLight = renderParam->ActiveDomeLight(), .scene = _scene