diff options
author | Tofu Linden <tofu.linden@lindenlab.com> | 2010-01-28 16:20:06 -0800 |
---|---|---|
committer | Tofu Linden <tofu.linden@lindenlab.com> | 2010-01-28 16:20:06 -0800 |
commit | ec2eae01fa5f9f47492035537f9ddbee86471a84 (patch) | |
tree | c9edd2f7439c91045d3281d8869907efde7edc46 /indra/newview | |
parent | 176a8d90301815bfc88958ca0c58cfaab00c4122 (diff) |
first dribble of directional lights for shaderless path.
Diffstat (limited to 'indra/newview')
-rw-r--r-- | indra/newview/pipeline.cpp | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp index 5940b354f4..060e8545ab 100644 --- a/indra/newview/pipeline.cpp +++ b/indra/newview/pipeline.cpp @@ -4567,8 +4567,22 @@ void LLPipeline::setupHWLights(LLDrawPool* pool) glLightf (gllight, GL_CONSTANT_ATTENUATION, 0.0f); glLightf (gllight, GL_LINEAR_ATTENUATION, atten); glLightf (gllight, GL_QUADRATIC_ATTENUATION, quad); - glLightf (gllight, GL_SPOT_EXPONENT, 0.0f); - glLightf (gllight, GL_SPOT_CUTOFF, 180.0f); + if (light->getLightTexture()) // directional (spot-)light + { + LLVector3 spotparams = light->getSpotLightParams(); + LLQuaternion quat = light->getRenderRotation(); + LLVector3 at_axis(0,0,-1); // todo: verify against deferred + at_axis *= quat; + llinfos << "SPOT!!!!!!! fov: " << spotparams.mV[0] << " focus: " << spotparams.mV[1] << " dir: " << at_axis << llendl; + glLightfv(gllight, GL_SPOT_DIRECTION, at_axis.mV); + glLightf (gllight, GL_SPOT_EXPONENT, 0.0f); // fixme - focus + glLightf (gllight, GL_SPOT_CUTOFF, 22.0f); // fixme - fov + } + else // omnidirectional (point) light + { + glLightf (gllight, GL_SPOT_EXPONENT, 0.0f); + glLightf (gllight, GL_SPOT_CUTOFF, 180.0f); + } cur_light++; if (cur_light >= 8) { |