This commit is contained in:
David Rose 2007-03-30 23:27:51 +00:00
parent cca375c2f3
commit 9eb3e9fa24
1 changed files with 7 additions and 6 deletions

View File

@ -2306,11 +2306,7 @@ bind_light(PointLight *light_obj, const NodePath &light, int light_id) {
alight.Position = *(D3DVECTOR *)pos.get_data();
alight.Range = __D3DLIGHT_RANGE_MAX;
// Not sure why this factor of 60.0f is necessary; I determined it
// empirically. It seems to successfully approximate the OpenGL
// spotlight equation, at least for reasonably smallish FOV's.
alight.Falloff = light_obj->get_exponent() / 60.0f;
alight.Falloff = 1.0f;
const LVecBase3f &att = light_obj->get_attenuation();
alight.Attenuation0 = att[0];
@ -2409,7 +2405,12 @@ bind_light(Spotlight *light_obj, const NodePath &light, int light_id) {
alight.Direction = *(D3DVECTOR *)dir.get_data();
alight.Range = __D3DLIGHT_RANGE_MAX;
alight.Falloff = 1.0f;
// Not sure why this factor of 60.0f is necessary; I determined it
// empirically. It seems to successfully approximate the OpenGL
// spotlight equation, at least for reasonably smallish FOV's.
alight.Falloff = light_obj->get_exponent() / 60.0f;
alight.Theta = 0.0f;
alight.Phi = deg_2_rad(lens->get_hfov());