History

lightings seems to work correctly now

Sam Gateau committed 11 years ago

Commit 00a9f551 parent 8e1eebb5 files · +13 −17Browse files

Showing the changes to libraries/render-utils/src/DeferredLightingEffect.cpp (1 of 5 files). Show all

Unified · Split

libraries/render-utils/src/DeferredLightingEffect.cpp+4−4
@@ -303,8 +303,8 @@ void DeferredLightingEffect::addSpotLight(const glm::vec3& position, float radiu · 302 unmodified lines
303303 lp->setPosition(position);
304304 lp->setDirection(direction);
305305 lp->setMaximumRadius(radius);
306− lp->setSpotCone(cutoff);
307− lp->setSpotConeExponent(exponent);
306+ lp->setSpotAngle(cutoff);
307+ lp->setSpotExponent(exponent);
308308 lp->setColor(diffuse);
309309 lp->setIntensity(1.0f);
310310 lp->setType(model::Light::SPOT);
@@ -527,7 +527,7 @@ void DeferredLightingEffect::render() { · 216 unmodified lines
527527 glPushMatrix();
528528
529529 float expandedRadius = light->getMaximumRadius() * (1.0f + SCALE_EXPANSION);
530− float edgeRadius = expandedRadius / glm::cos(light->getSpotConeAngle());
530+ float edgeRadius = expandedRadius / glm::cos(light->getSpotAngle());
531531 if (glm::distance(eyePoint, glm::vec3(light->getPosition())) < edgeRadius + nearRadius) {
532532 glLoadIdentity();
533533 glTranslatef(0.0f, 0.0f, -1.0f);
@@ -547,7 +547,7 @@ void DeferredLightingEffect::render() { · 13 unmodified lines
547547 glm::vec3 axis = glm::axis(spotRotation);
548548 glRotatef(glm::degrees(glm::angle(spotRotation)), axis.x, axis.y, axis.z);
549549 glTranslatef(0.0f, 0.0f, -light->getMaximumRadius() * (1.0f + SCALE_EXPANSION * 0.5f));
550− geometryCache->renderCone(expandedRadius * glm::tan(light->getSpotConeAngle()),
550+ geometryCache->renderCone(expandedRadius * glm::tan(light->getSpotAngle()),
551551 expandedRadius, 32, 1);
552552 }
553553