diff options
author | Thaddeus Crews <repiteo@outlook.com> | 2024-10-29 19:25:34 -0500 |
---|---|---|
committer | Thaddeus Crews <repiteo@outlook.com> | 2024-10-29 19:25:34 -0500 |
commit | 64b68192cc8a13e7ed87a8f64b2d5dd6f15e4056 (patch) | |
tree | 40d23685155850974d720783a90682d3994c020b | |
parent | 0debc73dc6eb2c1a4986766506180394e69bda11 (diff) | |
parent | 76c20383d107598ce7c9f7ccddff54a6a0002ea8 (diff) | |
download | redot-engine-64b68192cc8a13e7ed87a8f64b2d5dd6f15e4056.tar.gz |
Merge pull request #98562 from Rudolph-B/Issue-98561
Fix Occlusion Culling not working for an orthogonal camera.
-rw-r--r-- | modules/raycast/raycast_occlusion_cull.cpp | 2 | ||||
-rw-r--r-- | servers/rendering/renderer_scene_occlusion_cull.h | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/modules/raycast/raycast_occlusion_cull.cpp b/modules/raycast/raycast_occlusion_cull.cpp index 54dc040583..634c370b05 100644 --- a/modules/raycast/raycast_occlusion_cull.cpp +++ b/modules/raycast/raycast_occlusion_cull.cpp @@ -140,7 +140,7 @@ void RaycastOcclusionCull::RaycastHZBuffer::_generate_camera_rays(const CameraRa Vector3 dir; if (p_data->camera_orthogonal) { - dir = -p_data->camera_dir; + dir = p_data->camera_dir; tile.ray.org_x[j] = pixel_pos.x - dir.x * p_data->z_near; tile.ray.org_y[j] = pixel_pos.y - dir.y * p_data->z_near; tile.ray.org_z[j] = pixel_pos.z - dir.z * p_data->z_near; diff --git a/servers/rendering/renderer_scene_occlusion_cull.h b/servers/rendering/renderer_scene_occlusion_cull.h index 0ef92dd9ff..a59ec7b952 100644 --- a/servers/rendering/renderer_scene_occlusion_cull.h +++ b/servers/rendering/renderer_scene_occlusion_cull.h @@ -84,7 +84,7 @@ public: Vector3 view = p_cam_inv_transform.xform(corner); if (p_cam_projection.is_orthogonal()) { - min_depth = MIN(min_depth, view.z); + min_depth = MIN(min_depth, -view.z); } Plane vp = Plane(view, 1.0); |