David Rose há 19 anos atrás
pai
commit
9eb3e9fa24
1 ficheiros alterados com 7 adições e 6 exclusões
  1. 7 6
      panda/src/dxgsg8/dxGraphicsStateGuardian8.cxx

+ 7 - 6
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());