From 8fb4090638a7620975df45c71ebfcee26fa6d574 Mon Sep 17 00:00:00 2001 From: Alan Tse Date: Sat, 26 Aug 2023 12:25:43 -0700 Subject: [PATCH] fix: adjust right eye by averaged position --- src/Features/LightLimitFix.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/Features/LightLimitFix.cpp b/src/Features/LightLimitFix.cpp index 07b14639c..f083e6a17 100644 --- a/src/Features/LightLimitFix.cpp +++ b/src/Features/LightLimitFix.cpp @@ -685,9 +685,9 @@ void LightLimitFix::UpdateLights() light.positionWS[1] = light.positionWS[0]; if (eyeCount == 2) { auto offset = eyePosition - state->GetVRRuntimeData().posAdjust.getEye(1); - light.positionWS[1].x += offset.x; - light.positionWS[1].y += offset.y; - light.positionWS[1].z += offset.z; + light.positionWS[1].x += offset.x / (float)clusteredLights; + light.positionWS[1].y += offset.y / (float)clusteredLights; + light.positionWS[1].z += offset.z / (float)clusteredLights; } currentLightCount += AddCachedParticleLights(lightsData, light, particleLight.second.second, eyeIndex); @@ -719,9 +719,9 @@ void LightLimitFix::UpdateLights() light.positionWS[1] = light.positionWS[0]; if (eyeCount == 2) { auto offset = eyePosition - state->GetVRRuntimeData().posAdjust.getEye(1); - light.positionWS[1].x += offset.x; - light.positionWS[1].y += offset.y; - light.positionWS[1].z += offset.z; + light.positionWS[1].x += offset.x / (float)clusteredLights; + light.positionWS[1].y += offset.y / (float)clusteredLights; + light.positionWS[1].z += offset.z / (float)clusteredLights; } currentLightCount += AddCachedParticleLights(lightsData, light, particleLight.second.second, eyeIndex); }