GRIM: Tweak attenuation.

Determined by enabling a single omnidirectional light (newlight9 in set
"ce", which stands at set entrance toward elevator) and comparing
luminosity level on Manny at several locations in that scene with original
software renderer.
This set is quite convenient for this comparison, as Manny position can be
easily controlled: stick to the wall with the red arrow pointing at the
stairs, making movements one-dimensional.

For spotlight, set "tu" was used with the single spotlight on, walking
from the fire extinguisher to server door, confirming similar attenuation.

From these tests, it seems only quadratic attenuation is used, which makes
sense as it gives a realistic effect.
This commit is contained in:
Vincent Pelletier 2015-03-16 23:33:42 +01:00
parent 06e7aa68b0
commit 351a4efa8a
2 changed files with 2 additions and 1 deletions

View file

@ -1007,7 +1007,7 @@ void GfxOpenGL::setupLight(Light *light, int lightId) {
glLightfv(GL_LIGHT0 + lightId, GL_SPOT_DIRECTION, lightDir);
glLightf(GL_LIGHT0 + lightId, GL_SPOT_EXPONENT, spot_exp);
glLightf(GL_LIGHT0 + lightId, GL_SPOT_CUTOFF, cutoff);
glLightf(GL_LIGHT0 + lightId, GL_QUADRATIC_ATTENUATION, 0.2f);
glLightf(GL_LIGHT0 + lightId, GL_QUADRATIC_ATTENUATION, 1.0f);
glEnable(GL_LIGHT0 + lightId);
}