rplight: Fix PSSM calculation failing with infinite far distance

Fixes #1397
This commit is contained in:
rdb 2022-11-26 16:52:55 +01:00
parent 37795cd596
commit 5db4b447a6

View File

@ -400,7 +400,8 @@ void PSSMCameraRig::update(NodePath cam_node, const LVecBase3 &light_vector) {
} }
// Do the actual PSSM // Do the actual PSSM
compute_pssm_splits( transform, _pssm_distance / lens->get_far(), light_vector ); double far_recip = std::max(1.0 / (double)lens->get_far(), (double)lens_far_limit);
compute_pssm_splits( transform, _pssm_distance * far_recip, light_vector );
_update_collector.stop(); _update_collector.stop();
} }