mirror of
https://github.com/Relintai/pandemonium_engine.git
synced 2024-12-26 13:47:12 +01:00
Tighter light culling - fix directional lights colinear case
Exactly the same fix as done already for non-directional lights.
This commit is contained in:
parent
fa194fc9e4
commit
2c471d100d
@ -228,10 +228,12 @@ bool RenderingServerLightCuller::add_light_camera_planes_directional(const Light
|
||||
// Create a third point from the light direction.
|
||||
Vector3 pt2 = pt0 - p_light_source.dir;
|
||||
|
||||
if (!_is_colinear_tri(pt0, pt1, pt2)) {
|
||||
// Create plane from 3 points.
|
||||
Plane p(pt0, pt1, pt2);
|
||||
add_cull_plane(p);
|
||||
}
|
||||
}
|
||||
|
||||
// Last to 0 edge.
|
||||
if (n_edges) {
|
||||
@ -244,10 +246,12 @@ bool RenderingServerLightCuller::add_light_camera_planes_directional(const Light
|
||||
// Create a third point from the light direction.
|
||||
Vector3 pt2 = pt0 - p_light_source.dir;
|
||||
|
||||
if (!_is_colinear_tri(pt0, pt1, pt2)) {
|
||||
// Create plane from 3 points.
|
||||
Plane p(pt0, pt1, pt2);
|
||||
add_cull_plane(p);
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef LIGHT_CULLER_DEBUG_LOGGING
|
||||
if (is_logging()) {
|
||||
|
Loading…
Reference in New Issue
Block a user