From 670db7ee617ef960643c74611badc02fa7de278f Mon Sep 17 00:00:00 2001 From: TheRiverwoodModder <125157333+TheRiverwoodModder@users.noreply.github.com> Date: Sun, 7 Apr 2024 17:36:33 -0700 Subject: [PATCH] fix: fixes for VR Water Caustics edge cases --- package/Shaders/Water.hlsl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package/Shaders/Water.hlsl b/package/Shaders/Water.hlsl index 64c305dd8..eafd6ac84 100644 --- a/package/Shaders/Water.hlsl +++ b/package/Shaders/Water.hlsl @@ -482,7 +482,7 @@ float3 GetWaterNormal(PS_INPUT input, float distanceFactor, float normalsDepthFa # else float3 flowmapNormal0 = GetFlowmapNormal(input, uvShift.xx, 9.92, 0, a_eyeIndex); float3 flowmapNormal1 = GetFlowmapNormal(input, float2(0, uvShift), 10.64, 0.27, a_eyeIndex); - float3 flowmapNormal2 = GetFlowmapNormal(input, 0.0.xx, 8, 0); + float3 flowmapNormal2 = GetFlowmapNormal(input, 0.0.xx, 8, 0, a_eyeIndex); float3 flowmapNormal3 = GetFlowmapNormal(input, float2(uvShift, 0), 8.48, 0.62, a_eyeIndex); # endif @@ -540,7 +540,7 @@ float3 GetWaterNormal(PS_INPUT input, float distanceFactor, float normalsDepthFa normalMul.y * ((1 - normalMul.x) * flowmapNormal3.z + normalMul.x * flowmapNormal2.z) + (1 - normalMul.y) * (normalMul.x * flowmapNormal1.z + (1 - normalMul.x) * flowmapNormal0.z); finalNormal = normalize(lerp(normals1 + float3(0, 0, 1), normalize(lerp(finalNormal, flowmapNormal, normalBlendFactor)), distanceFactor)); -# if defined(WATER_CAUSTICS) +# if defined(WATER_CAUSTICS) && !defined(VR) caustics = lerp(blendedCaustics, flowmapCausticsWeighted, normalBlendFactor); # endif # endif