|
@@ -2306,11 +2306,7 @@ bind_light(PointLight *light_obj, const NodePath &light, int light_id) {
|
|
|
alight.Position = *(D3DVECTOR *)pos.get_data();
|
|
alight.Position = *(D3DVECTOR *)pos.get_data();
|
|
|
|
|
|
|
|
alight.Range = __D3DLIGHT_RANGE_MAX;
|
|
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();
|
|
const LVecBase3f &att = light_obj->get_attenuation();
|
|
|
alight.Attenuation0 = att[0];
|
|
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.Direction = *(D3DVECTOR *)dir.get_data();
|
|
|
|
|
|
|
|
alight.Range = __D3DLIGHT_RANGE_MAX;
|
|
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.Theta = 0.0f;
|
|
|
alight.Phi = deg_2_rad(lens->get_hfov());
|
|
alight.Phi = deg_2_rad(lens->get_hfov());
|
|
|
|
|
|