From 58fa82ac84595ad37263ddfb8afc78cf8b205114 Mon Sep 17 00:00:00 2001 From: Emmanuel Turquin Date: Thu, 4 Feb 2021 17:37:04 +0100 Subject: [PATCH] Fixed dimensionality of a couple vectors (from 3 to 2). --- .../ScreenSpaceLighting/ScreenSpaceReflections.compute | 2 +- .../RenderPipeline/PathTracing/Shaders/PathTracingBSDF.hlsl | 4 ++-- .../RenderPipeline/PathTracing/Shaders/PathTracingVolume.hlsl | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/com.unity.render-pipelines.high-definition/Runtime/Lighting/ScreenSpaceLighting/ScreenSpaceReflections.compute b/com.unity.render-pipelines.high-definition/Runtime/Lighting/ScreenSpaceLighting/ScreenSpaceReflections.compute index 4ba7e6606d5..7e68179e725 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/Lighting/ScreenSpaceLighting/ScreenSpaceReflections.compute +++ b/com.unity.render-pipelines.high-definition/Runtime/Lighting/ScreenSpaceLighting/ScreenSpaceReflections.compute @@ -120,7 +120,7 @@ bool SampleGGX_VNDF(float roughness_, float VdotH; float3 localV, localH; - SampleGGXVisibleNormal(inputSample, V, localToWorld, roughness, localV, localH, VdotH); + SampleGGXVisibleNormal(inputSample.xy, V, localToWorld, roughness, localV, localH, VdotH); // Compute the reflection direction float3 localL = 2.0 * VdotH * localH - localV; diff --git a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/PathTracing/Shaders/PathTracingBSDF.hlsl b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/PathTracing/Shaders/PathTracingBSDF.hlsl index 50166eae6f7..7e1aa6aec5a 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/PathTracing/Shaders/PathTracingBSDF.hlsl +++ b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/PathTracing/Shaders/PathTracingBSDF.hlsl @@ -110,7 +110,7 @@ bool SampleAnisoGGX(MaterialData mtlData, float VdotH; float3 localV, localH; float3x3 localToWorld = GetTangentFrame(mtlData); - SampleAnisoGGXVisibleNormal(inputSample, mtlData.V, localToWorld, roughnessX, roughnessY, localV, localH, VdotH); + SampleAnisoGGXVisibleNormal(inputSample.xy, mtlData.V, localToWorld, roughnessX, roughnessY, localV, localH, VdotH); // Compute the reflection direction float3 localL = 2.0 * VdotH * localH - localV; @@ -336,7 +336,7 @@ bool SampleAnisoGGX(MaterialData mtlData, float VdotH; float3 localV, localH; float3x3 localToWorld = GetTangentFrame(mtlData); - SampleAnisoGGXVisibleNormal(inputSample, mtlData.V, localToWorld, roughnessX, roughnessY, localV, localH, VdotH); + SampleAnisoGGXVisibleNormal(inputSample.xy, mtlData.V, localToWorld, roughnessX, roughnessY, localV, localH, VdotH); // Compute refraction direction instead of reflection float3 localL = refract(-localV, localH, 1.0 / mtlData.bsdfData.ior); 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 2867ba0e339..ae8ee443015 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 @@ -130,7 +130,7 @@ void ComputeVolumeScattering(inout PathIntersection pathIntersection : SV_RayPay // Light sampling if (computeDirect) { - if (SampleLights(lightList, inputSample.xyz, scatteringPosition, 0.0, ray.Direction, value, pdf, ray.TMax)) + if (SampleLights(lightList, inputSample, scatteringPosition, 0.0, ray.Direction, value, pdf, ray.TMax)) { // FIXME: Apply phase function and divide by pdf (only isotropic for now, and not sure about sigmaS value) value *= _HeightFogBaseScattering.xyz * ComputeHeightFogMultiplier(scatteringPosition.y) * INV_FOUR_PI / pdf;