diff --git a/com.unity.render-pipelines.high-definition/Runtime/Material/AxF/AxFRayTracing.hlsl b/com.unity.render-pipelines.high-definition/Runtime/Material/AxF/AxFRayTracing.hlsl index 18c9085669c..27ac39058a8 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/Material/AxF/AxFRayTracing.hlsl +++ b/com.unity.render-pipelines.high-definition/Runtime/Material/AxF/AxFRayTracing.hlsl @@ -1,11 +1,11 @@ -float3 SampleSpecularBRDF(BSDFData bsdfData, float2 sample, float3 viewWS) +float3 SampleSpecularBRDF(BSDFData bsdfData, float2 theSample, float3 viewWS) { float roughness = PerceptualRoughnessToRoughness(bsdfData.perceptualRoughness); float3x3 localToWorld = GetLocalFrame(bsdfData.normalWS); float NdotL, NdotH, VdotH; float3 sampleDir; - SampleGGXDir(sample, viewWS, localToWorld, roughness, sampleDir, NdotL, NdotH, VdotH); + SampleGGXDir(theSample, viewWS, localToWorld, roughness, sampleDir, NdotL, NdotH, VdotH); return sampleDir; } diff --git a/com.unity.render-pipelines.high-definition/Runtime/Material/Eye/EyeRaytracing.hlsl b/com.unity.render-pipelines.high-definition/Runtime/Material/Eye/EyeRaytracing.hlsl index 38373f1bf56..0aff3082ac6 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/Material/Eye/EyeRaytracing.hlsl +++ b/com.unity.render-pipelines.high-definition/Runtime/Material/Eye/EyeRaytracing.hlsl @@ -1,10 +1,10 @@ -float3 SampleSpecularBRDF(BSDFData bsdfData, float2 sample, float3 viewWS) +float3 SampleSpecularBRDF(BSDFData bsdfData, float2 theSample, float3 viewWS) { float roughness = PerceptualRoughnessToRoughness(bsdfData.perceptualRoughness); float3x3 localToWorld = GetLocalFrame(bsdfData.normalWS); float NdotL, NdotH, VdotH; float3 sampleDir; - SampleGGXDir(sample, viewWS, localToWorld, roughness, sampleDir, NdotL, NdotH, VdotH); + SampleGGXDir(theSample, viewWS, localToWorld, roughness, sampleDir, NdotL, NdotH, VdotH); return sampleDir; } diff --git a/com.unity.render-pipelines.high-definition/Runtime/Material/Fabric/FabricRaytracing.hlsl b/com.unity.render-pipelines.high-definition/Runtime/Material/Fabric/FabricRaytracing.hlsl index 4c93889e4e1..2ac4784a438 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/Material/Fabric/FabricRaytracing.hlsl +++ b/com.unity.render-pipelines.high-definition/Runtime/Material/Fabric/FabricRaytracing.hlsl @@ -1,4 +1,4 @@ -float3 SampleSpecularBRDF(BSDFData bsdfData, float2 sample, float3 viewWS) +float3 SampleSpecularBRDF(BSDFData bsdfData, float2 theSample, float3 viewWS) { float roughness = PerceptualRoughnessToRoughness(bsdfData.perceptualRoughness); float3x3 localToWorld; @@ -12,7 +12,7 @@ float3 SampleSpecularBRDF(BSDFData bsdfData, float2 sample, float3 viewWS) } float NdotL, NdotH, VdotH; float3 sampleDir; - SampleGGXDir(sample, viewWS, localToWorld, roughness, sampleDir, NdotL, NdotH, VdotH); + SampleGGXDir(theSample, viewWS, localToWorld, roughness, sampleDir, NdotL, NdotH, VdotH); return sampleDir; } diff --git a/com.unity.render-pipelines.high-definition/Runtime/Material/Hair/HairRayTracing.hlsl b/com.unity.render-pipelines.high-definition/Runtime/Material/Hair/HairRayTracing.hlsl index 46ec54c843f..8c5b3755968 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/Material/Hair/HairRayTracing.hlsl +++ b/com.unity.render-pipelines.high-definition/Runtime/Material/Hair/HairRayTracing.hlsl @@ -1,11 +1,11 @@ -float3 SampleSpecularBRDF(BSDFData bsdfData, float2 sample, float3 viewWS) +float3 SampleSpecularBRDF(BSDFData bsdfData, float2 theSample, float3 viewWS) { float roughness = PerceptualRoughnessToRoughness(bsdfData.perceptualRoughness); float3x3 localToWorld = GetLocalFrame(bsdfData.normalWS); float NdotL, NdotH, VdotH; float3 sampleDir; - SampleGGXDir(sample, viewWS, localToWorld, roughness, sampleDir, NdotL, NdotH, VdotH); + SampleGGXDir(theSample, viewWS, localToWorld, roughness, sampleDir, NdotL, NdotH, VdotH); return sampleDir; } diff --git a/com.unity.render-pipelines.high-definition/Runtime/Material/Lit/LitPathTracing.hlsl b/com.unity.render-pipelines.high-definition/Runtime/Material/Lit/LitPathTracing.hlsl index 3ec50c5253f..1b1a93966a2 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/Material/Lit/LitPathTracing.hlsl +++ b/com.unity.render-pipelines.high-definition/Runtime/Material/Lit/LitPathTracing.hlsl @@ -43,7 +43,7 @@ void ProcessBSDFData(PathIntersection pathIntersection, BuiltinData builtinData, #endif } -bool CreateMaterialData(PathIntersection pathIntersection, BuiltinData builtinData, BSDFData bsdfData, inout float3 shadingPosition, inout float sample, out MaterialData mtlData) +bool CreateMaterialData(PathIntersection pathIntersection, BuiltinData builtinData, BSDFData bsdfData, inout float3 shadingPosition, inout float theSample, out MaterialData mtlData) { // Alter values in the material's bsdfData struct, to better suit path tracing mtlData.bsdfData = bsdfData; @@ -95,7 +95,7 @@ bool CreateMaterialData(PathIntersection pathIntersection, BuiltinData builtinDa #ifdef _MATERIAL_FEATURE_SUBSURFACE_SCATTERING float subsurfaceWeight = mtlData.bsdfWeight[0] * mtlData.bsdfData.subsurfaceMask * (1.0 - pathIntersection.maxRoughness); - mtlData.isSubsurface = sample < subsurfaceWeight; + mtlData.isSubsurface = theSample < subsurfaceWeight; if (mtlData.isSubsurface) { // We do a full, ray-traced subsurface scattering computation here: @@ -121,11 +121,11 @@ bool CreateMaterialData(PathIntersection pathIntersection, BuiltinData builtinDa mtlData.bsdfWeight[0] = max(mtlData.bsdfWeight[0] - subsurfaceWeight, BSDF_WEIGHT_EPSILON); mtlData.bsdfWeight /= mtlData.subsurfaceWeightFactor; - sample -= subsurfaceWeight; + theSample -= subsurfaceWeight; } // Rescale the sample we used for the SSS selection test - sample /= mtlData.subsurfaceWeightFactor; + theSample /= mtlData.subsurfaceWeightFactor; #endif return true; diff --git a/com.unity.render-pipelines.high-definition/Runtime/Material/Lit/LitRaytracing.hlsl b/com.unity.render-pipelines.high-definition/Runtime/Material/Lit/LitRaytracing.hlsl index 3b580bf736d..f41e3693372 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/Material/Lit/LitRaytracing.hlsl +++ b/com.unity.render-pipelines.high-definition/Runtime/Material/Lit/LitRaytracing.hlsl @@ -1,4 +1,4 @@ -float3 SampleSpecularBRDF(BSDFData bsdfData, float2 sample, float3 viewWS) +float3 SampleSpecularBRDF(BSDFData bsdfData, float2 theSample, float3 viewWS) { float roughness = PerceptualRoughnessToRoughness(bsdfData.perceptualRoughness); float3x3 localToWorld; @@ -12,7 +12,7 @@ float3 SampleSpecularBRDF(BSDFData bsdfData, float2 sample, float3 viewWS) } float NdotL, NdotH, VdotH; float3 sampleDir; - SampleGGXDir(sample, viewWS, localToWorld, roughness, sampleDir, NdotL, NdotH, VdotH); + SampleGGXDir(theSample, viewWS, localToWorld, roughness, sampleDir, NdotL, NdotH, VdotH); return sampleDir; } diff --git a/com.unity.render-pipelines.high-definition/Runtime/Material/StackLit/StackLitRayTracing.hlsl b/com.unity.render-pipelines.high-definition/Runtime/Material/StackLit/StackLitRayTracing.hlsl index b99b75e4c18..360e9b48b63 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/Material/StackLit/StackLitRayTracing.hlsl +++ b/com.unity.render-pipelines.high-definition/Runtime/Material/StackLit/StackLitRayTracing.hlsl @@ -1,4 +1,4 @@ -float3 SampleSpecularBRDF(BSDFData bsdfData, float2 sample, float3 viewWS) +float3 SampleSpecularBRDF(BSDFData bsdfData, float2 theSample, float3 viewWS) { float roughness = bsdfData.roughnessAT; float3x3 localToWorld; @@ -12,7 +12,7 @@ float3 SampleSpecularBRDF(BSDFData bsdfData, float2 sample, float3 viewWS) } float NdotL, NdotH, VdotH; float3 sampleDir; - SampleGGXDir(sample, viewWS, localToWorld, roughness, sampleDir, NdotL, NdotH, VdotH); + SampleGGXDir(theSample, viewWS, localToWorld, roughness, sampleDir, NdotL, NdotH, VdotH); return sampleDir; } diff --git a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/PathTracing/Shaders/PathTracingLight.hlsl b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/PathTracing/Shaders/PathTracingLight.hlsl index 00fcd6ab653..37b48c469f7 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/PathTracing/Shaders/PathTracingLight.hlsl +++ b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/PathTracing/Shaders/PathTracingLight.hlsl @@ -224,23 +224,23 @@ float GetDistantLightWeight(LightList list) return list.distantWeight / list.distantCount; } -bool PickLocalLights(LightList list, inout float sample) +bool PickLocalLights(LightList list, inout float theSample) { - if (sample < list.localWeight) + if (theSample < list.localWeight) { // We pick local lighting - sample /= list.localWeight; + theSample /= list.localWeight; return true; } // Otherwise, distant lighting - sample = (sample - list.localWeight) / list.distantWeight; + theSample = (theSample - list.localWeight) / list.distantWeight; return false; } -bool PickDistantLights(LightList list, inout float sample) +bool PickDistantLights(LightList list, inout float theSample) { - return !PickLocalLights(list, sample); + return !PickLocalLights(list, theSample); } float3 GetPunctualEmission(LightData lightData, float3 outgoingDir, float dist) diff --git a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/PathTracing/Shaders/PathTracingVolume.hlsl b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/PathTracing/Shaders/PathTracingVolume.hlsl index 3786095d11e..2867ba0e339 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/PathTracing/Shaders/PathTracingVolume.hlsl +++ b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/PathTracing/Shaders/PathTracingVolume.hlsl @@ -10,7 +10,7 @@ float ComputeHeightFogMultiplier(float height) return ComputeHeightFogMultiplier(height, _HeightFogBaseHeight, _HeightFogExponents); } -bool SampleVolumeScatteringPosition(inout float sample, inout float t, inout float pdf, out bool sampleLocalLights) +bool SampleVolumeScatteringPosition(inout float theSample, inout float t, inout float pdf, out bool sampleLocalLights) { sampleLocalLights = false; @@ -28,14 +28,14 @@ bool SampleVolumeScatteringPosition(inout float sample, inout float t, inout flo if (localWeight < 0.0) return false; - sampleLocalLights = sample < localWeight; + sampleLocalLights = theSample < localWeight; if (sampleLocalLights) { tMax = min(tMax, tFog); if (tMin >= tMax) return false; - sample /= localWeight; + theSample /= localWeight; pdfVol *= localWeight; } else @@ -43,8 +43,8 @@ bool SampleVolumeScatteringPosition(inout float sample, inout float t, inout flo tMin = 0.0; tMax = tFog; - sample -= localWeight; - sample /= 1.0 - localWeight; + theSample -= localWeight; + theSample /= 1.0 - localWeight; pdfVol *= 1.0 - localWeight; } #else @@ -57,11 +57,11 @@ bool SampleVolumeScatteringPosition(inout float sample, inout float t, inout flo const float transmittanceTMax = max(exp(-tMax * sigmaT), 0.01); const float transmittanceThreshold = t < FLT_MAX ? 1.0 - min(0.5, transmittanceTMax) : 1.0; - if (sample >= transmittanceThreshold) + if (theSample >= transmittanceThreshold) { // Re-scale the sample - sample -= transmittanceThreshold; - sample /= 1.0 - transmittanceThreshold; + theSample -= transmittanceThreshold; + theSample /= 1.0 - transmittanceThreshold; // Adjust the pdf pdf *= 1.0 - transmittanceThreshold; @@ -70,7 +70,7 @@ bool SampleVolumeScatteringPosition(inout float sample, inout float t, inout flo } // Re-scale the sample - sample /= transmittanceThreshold; + theSample /= transmittanceThreshold; // Adjust the pdf pdf *= pdfVol * transmittanceThreshold; @@ -79,7 +79,7 @@ bool SampleVolumeScatteringPosition(inout float sample, inout float t, inout flo { // Linear sampling float deltaT = tMax - tMin; - t = tMin + sample * deltaT; + t = tMin + theSample * deltaT; // Adjust the pdf pdf /= deltaT; @@ -87,7 +87,7 @@ bool SampleVolumeScatteringPosition(inout float sample, inout float t, inout flo else { // Exponential sampling - float transmittance = transmittanceTMax + sample * (1.0 - transmittanceTMax); + float transmittance = transmittanceTMax + theSample * (1.0 - transmittanceTMax); t = -log(transmittance) / sigmaT; // Adjust the pdf diff --git a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Raytracing/Shaders/IndirectDiffuse/RaytracingIndirectDiffuse.compute b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Raytracing/Shaders/IndirectDiffuse/RaytracingIndirectDiffuse.compute index c5ef42ebb60..4dc5dfbaf8a 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Raytracing/Shaders/IndirectDiffuse/RaytracingIndirectDiffuse.compute +++ b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Raytracing/Shaders/IndirectDiffuse/RaytracingIndirectDiffuse.compute @@ -106,12 +106,12 @@ void RaytracingIndirectDiffuseFullRes(uint3 dispatchThreadId : SV_DispatchThread DecodeFromNormalBuffer(currentCoord, normalData); // Generate the new sample (following values of the sequence) - float2 sample; - sample.x = GetBNDSequenceSample(currentCoord, _RaytracingFrameIndex, 0); - sample.y = GetBNDSequenceSample(currentCoord, _RaytracingFrameIndex, 1); + float2 theSample; + theSample.x = GetBNDSequenceSample(currentCoord, _RaytracingFrameIndex, 0); + theSample.y = GetBNDSequenceSample(currentCoord, _RaytracingFrameIndex, 1); // Importance sample with a cosine lobe - float3 sampleDir = SampleHemisphereCosine(sample.x, sample.y, normalData.normalWS); + float3 sampleDir = SampleHemisphereCosine(theSample.x, theSample.y, normalData.normalWS); // PDF is the cosine float samplePDF = dot(sampleDir, normalData.normalWS); @@ -208,8 +208,8 @@ void INDIRECT_DIFFUSE_INTEGRATION_UPSCALE(uint3 dispatchThreadId : SV_DispatchTh if(sampleDepth == UNITY_RAW_FAR_CLIP_VALUE) continue; // Compute the target pixel that it will impact - float sample = _BlueNoiseTexture[int3(relativeHRShift, noiseIndex)].x; - int index = clamp(floor(sample * 4.0f), 0, 3); + float theSample = _BlueNoiseTexture[int3(relativeHRShift, noiseIndex)].x; + int index = clamp(floor(theSample * 4.0f), 0, 3); if (index != localIndex) continue; diff --git a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Raytracing/Shaders/IndirectDiffuse/RaytracingIndirectDiffuse.raytrace b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Raytracing/Shaders/IndirectDiffuse/RaytracingIndirectDiffuse.raytrace index 5b3035fae0f..9ce3b9a1917 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Raytracing/Shaders/IndirectDiffuse/RaytracingIndirectDiffuse.raytrace +++ b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Raytracing/Shaders/IndirectDiffuse/RaytracingIndirectDiffuse.raytrace @@ -90,12 +90,12 @@ void RayGenIntegration() int globalSampleIndex = _RaytracingFrameIndex * _RaytracingNumSamples + sampleIndex; // Generate the new sample (follwing values of the sequence) - float2 sample; - sample.x = GetBNDSequenceSample(currentCoord, globalSampleIndex, 0); - sample.y = GetBNDSequenceSample(currentCoord, globalSampleIndex, 1); + float2 theSample; + theSample.x = GetBNDSequenceSample(currentCoord, globalSampleIndex, 0); + theSample.y = GetBNDSequenceSample(currentCoord, globalSampleIndex, 1); // Importance sample with a cosine lobe - float3 sampleDir = SampleHemisphereCosine(sample.x, sample.y, normalData.normalWS); + float3 sampleDir = SampleHemisphereCosine(theSample.x, theSample.y, normalData.normalWS); // Create the ray descriptor for this pixel RayDesc rayDescriptor; diff --git a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Raytracing/Shaders/Reflections/RaytracingReflections.compute b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Raytracing/Shaders/Reflections/RaytracingReflections.compute index ef8daca1091..b54efc8e099 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Raytracing/Shaders/Reflections/RaytracingReflections.compute +++ b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Raytracing/Shaders/Reflections/RaytracingReflections.compute @@ -52,14 +52,14 @@ GGXSample GenerateGGXSampleDirection(uint2 currentCoord, float3 normalWS, float3 // Generate the new sample (follwing values of the sequence) int initialFrameIndex = frameIndex; - float2 sample; - sample.x = GetBNDSequenceSample(currentCoord, initialFrameIndex, 0); - sample.y = GetBNDSequenceSample(currentCoord, initialFrameIndex, 1); + float2 theSample; + theSample.x = GetBNDSequenceSample(currentCoord, initialFrameIndex, 0); + theSample.y = GetBNDSequenceSample(currentCoord, initialFrameIndex, 1); // Importance sample the direction float3 sampleDir = float3(0.0, 0.0, 0.0); float NdotL, NdotH, VdotH; - SampleGGXDir(sample, viewWS, localToWorld, roughness, sampleDir, NdotL, NdotH, VdotH); + SampleGGXDir(theSample, viewWS, localToWorld, roughness, sampleDir, NdotL, NdotH, VdotH); // If this direction is under the surface, let's generate a new one that won't be. // We allow ourselves 8 as the total of number of tries. @@ -70,9 +70,9 @@ GGXSample GenerateGGXSampleDirection(uint2 currentCoord, float3 normalWS, float3 if (dot(sampleDir, normalWS) >= 0.00f) break; - sample.x = GetBNDSequenceSample(currentCoord, initialFrameIndex + i, 0); - sample.y = GetBNDSequenceSample(currentCoord, initialFrameIndex + i, 1); - SampleGGXDir(sample, viewWS, localToWorld, roughness, sampleDir, NdotL, NdotH, VdotH); + theSample.x = GetBNDSequenceSample(currentCoord, initialFrameIndex + i, 0); + theSample.y = GetBNDSequenceSample(currentCoord, initialFrameIndex + i, 1); + SampleGGXDir(theSample, viewWS, localToWorld, roughness, sampleDir, NdotL, NdotH, VdotH); } // Build the sample and return it diff --git a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Raytracing/Shaders/Reflections/RaytracingReflections.raytrace b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Raytracing/Shaders/Reflections/RaytracingReflections.raytrace index 069213daa87..7b4ce4cd058 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Raytracing/Shaders/Reflections/RaytracingReflections.raytrace +++ b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Raytracing/Shaders/Reflections/RaytracingReflections.raytrace @@ -112,14 +112,14 @@ void RayGenIntegration() int globalSampleIndex = _RaytracingFrameIndex * realSampleCount + sampleIndex; // Generate the new sample (follwing values of the sequence) - float2 sample; - sample.x = GetBNDSequenceSample(currentCoord, globalSampleIndex, 0); - sample.y = GetBNDSequenceSample(currentCoord, globalSampleIndex, 1); + float2 theSample; + theSample.x = GetBNDSequenceSample(currentCoord, globalSampleIndex, 0); + theSample.y = GetBNDSequenceSample(currentCoord, globalSampleIndex, 1); // Importance sample the direction using GGX float3 sampleDir = float3(0.0, 0.0, 0.0); float NdotL, NdotH, VdotH; - SampleGGXDir(sample, viewWS, localToWorld, roughness, sampleDir, NdotL, NdotH, VdotH); + SampleGGXDir(theSample, viewWS, localToWorld, roughness, sampleDir, NdotL, NdotH, VdotH); // If the sample is under the surface if (dot(sampleDir, normalData.normalWS) <= 0.0) diff --git a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Raytracing/Shaders/Shadows/RaytracingMIS.hlsl b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Raytracing/Shaders/Shadows/RaytracingMIS.hlsl index 3ecf75865cd..7562c1bef29 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Raytracing/Shaders/Shadows/RaytracingMIS.hlsl +++ b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Raytracing/Shaders/Shadows/RaytracingMIS.hlsl @@ -188,9 +188,9 @@ bool GenerateMISSample(inout MISSamplingInput misInput, SphQuad squad, float3 vi return validity; } -void GenerateLightSample(float3 positionWS, float2 sample, SphQuad squad, float3 viewVector, out LightSamplingOutput lightSamplingOutput) +void GenerateLightSample(float3 positionWS, float2 theSample, SphQuad squad, float3 viewVector, out LightSamplingOutput lightSamplingOutput) { - lightSamplingOutput.pos = SphQuadSample(squad, sample.x, sample.y); + lightSamplingOutput.pos = SphQuadSample(squad, theSample.x, theSample.y); lightSamplingOutput.dir = normalize(lightSamplingOutput.pos - positionWS); lightSamplingOutput.lightPDF = 1.0f / squad.S; } diff --git a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/ShaderPass/ShaderPassRaytracingIndirect.hlsl b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/ShaderPass/ShaderPassRaytracingIndirect.hlsl index 03aabd8346e..abc8f316fd5 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/ShaderPass/ShaderPassRaytracingIndirect.hlsl +++ b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/ShaderPass/ShaderPassRaytracingIndirect.hlsl @@ -56,18 +56,18 @@ void ClosestHitMain(inout RayIntersection rayIntersection : SV_RayPayload, Attri if (rayIntersection.remainingDepth < _RaytracingMaxRecursion) { // Generate the new sample (follwing values of the sequence) - float2 sample = float2(0.0, 0.0); - sample.x = GetBNDSequenceSample(rayIntersection.pixelCoord, rayIntersection.sampleIndex, rayIntersection.remainingDepth * 2); - sample.y = GetBNDSequenceSample(rayIntersection.pixelCoord, rayIntersection.sampleIndex, rayIntersection.remainingDepth * 2 + 1); + float2 theSample = float2(0.0, 0.0); + theSample.x = GetBNDSequenceSample(rayIntersection.pixelCoord, rayIntersection.sampleIndex, rayIntersection.remainingDepth * 2); + theSample.y = GetBNDSequenceSample(rayIntersection.pixelCoord, rayIntersection.sampleIndex, rayIntersection.remainingDepth * 2 + 1); float3 sampleDir; if (_RayTracingDiffuseLightingOnly) { - sampleDir = SampleHemisphereCosine(sample.x, sample.y, bsdfData.normalWS); + sampleDir = SampleHemisphereCosine(theSample.x, theSample.y, bsdfData.normalWS); } else { - sampleDir = SampleSpecularBRDF(bsdfData, sample, viewWS); + sampleDir = SampleSpecularBRDF(bsdfData, theSample, viewWS); } // Create the ray descriptor for this pixel