From 958bc9a94ddfda0a24e1adbc3e2b554e6b1d137a Mon Sep 17 00:00:00 2001 From: Alan Tse Date: Mon, 7 Oct 2024 22:37:09 -0700 Subject: [PATCH] fix(VR): fix VR desync closes #601 --- package/Shaders/Lighting.hlsl | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/package/Shaders/Lighting.hlsl b/package/Shaders/Lighting.hlsl index 76a8efa24..164eba180 100644 --- a/package/Shaders/Lighting.hlsl +++ b/package/Shaders/Lighting.hlsl @@ -2132,7 +2132,13 @@ PS_OUTPUT main(PS_INPUT input, bool frontFace float shadowComponent = 1.0; if ((PixelShaderDescriptor & _DefShadow) && (light.lightFlags & Llf_ShadowLight)) { - shadowComponent = shadowColor[light.shadowLightIndex]; + shadowComponent = shadowColor[ +# ifndef VR + light.shadowLightIndex +# else + ShadowLightMaskSelect[light.shadowLightIndex] +# endif + ]; lightShadow *= shadowComponent; }