From 872b36488a7f3b1d9095e129e3973fefa11e85ba Mon Sep 17 00:00:00 2001
From: Graham Linden <graham@lindenlab.com>
Date: Tue, 26 Mar 2019 13:16:47 -0700
Subject: [PATCH] Modify spotlight prio calc to more stable version.

---
 indra/newview/llvovolume.cpp | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp
index afccc1c42c4..4ddd9c45689 100644
--- a/indra/newview/llvovolume.cpp
+++ b/indra/newview/llvovolume.cpp
@@ -3278,6 +3278,7 @@ void LLVOVolume::updateSpotLightPriority()
     F32 r = getLightRadius();
 	LLVector3 pos = mDrawable->getPositionAgent();
 
+#if OLD_SPOT_PRIO_CALC
 	LLVector3 at(0,0,-1);
 	at *= getRenderRotation();
 	pos += at * r;
@@ -3286,8 +3287,9 @@ void LLVOVolume::updateSpotLightPriority()
 	pos -= at * r;
 	
 	mSpotLightPriority = gPipeline.calcPixelArea(pos, LLVector3(r,r,r), *LLViewerCamera::getInstance());
-
-    //mSpotLightPriority = (gAgent.getPositionAgent() - pos).length() + r;
+#else
+    mSpotLightPriority = (gAgent.getPositionAgent() - pos).length() + r;
+#endif
 
 	if (mLightTexture.notNull())
 	{
-- 
GitLab