From 9a007cceeffb1b960ba495cd0e3d592698a52a99 Mon Sep 17 00:00:00 2001 From: Graham Linden Date: Mon, 4 Feb 2019 12:56:11 -0800 Subject: SL-10461 Pass projector ambiance as the .w element of the light_attenuation uniform so that alpha shader can emulate the behavior of proper spot projectors. --- indra/llrender/llrender.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'indra/llrender') diff --git a/indra/llrender/llrender.cpp b/indra/llrender/llrender.cpp index 5733a18f47..173444f708 100644 --- a/indra/llrender/llrender.cpp +++ b/indra/llrender/llrender.cpp @@ -1151,7 +1151,7 @@ void LLRender::syncLightState() LLVector4 position[8]; LLVector3 direction[8]; - LLVector3 attenuation[8]; + LLVector4 attenuation[8]; LLVector3 diffuse[8]; for (U32 i = 0; i < 8; i++) @@ -1160,13 +1160,13 @@ void LLRender::syncLightState() position[i] = light->mPosition; direction[i] = light->mSpotDirection; - attenuation[i].set(light->mLinearAtten, light->mQuadraticAtten, light->mSpecular.mV[3]); + attenuation[i].set(light->mLinearAtten, light->mQuadraticAtten, light->mSpecular.mV[2], light->mSpecular.mV[3]); diffuse[i].set(light->mDiffuse.mV); } shader->uniform4fv(LLShaderMgr::LIGHT_POSITION, 8, position[0].mV); shader->uniform3fv(LLShaderMgr::LIGHT_DIRECTION, 8, direction[0].mV); - shader->uniform3fv(LLShaderMgr::LIGHT_ATTENUATION, 8, attenuation[0].mV); + shader->uniform4fv(LLShaderMgr::LIGHT_ATTENUATION, 8, attenuation[0].mV); shader->uniform3fv(LLShaderMgr::LIGHT_DIFFUSE, 8, diffuse[0].mV); shader->uniform4fv(LLShaderMgr::LIGHT_AMBIENT, 1, mAmbientLightColor.mV); //HACK -- duplicate sunlight color for compatibility with drivers that can't deal with multiple shader objects referencing the same uniform -- cgit v1.2.3