From 9eb3e9fa2454117485cdaa949da5e2286740f47e Mon Sep 17 00:00:00 2001 From: David Rose Date: Fri, 30 Mar 2007 23:27:51 +0000 Subject: [PATCH] oops --- panda/src/dxgsg8/dxGraphicsStateGuardian8.cxx | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/panda/src/dxgsg8/dxGraphicsStateGuardian8.cxx b/panda/src/dxgsg8/dxGraphicsStateGuardian8.cxx index 1573cb3207..c52b446ba9 100644 --- a/panda/src/dxgsg8/dxGraphicsStateGuardian8.cxx +++ b/panda/src/dxgsg8/dxGraphicsStateGuardian8.cxx @@ -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());