You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-05 12:10:55 +00:00
Fix Occlusion Culling not working for an orthogonal camera.
This commit is contained in:
@@ -140,7 +140,7 @@ void RaycastOcclusionCull::RaycastHZBuffer::_generate_camera_rays(const CameraRa
|
|||||||
|
|
||||||
Vector3 dir;
|
Vector3 dir;
|
||||||
if (p_data->camera_orthogonal) {
|
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_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_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;
|
tile.ray.org_z[j] = pixel_pos.z - dir.z * p_data->z_near;
|
||||||
|
|||||||
@@ -84,7 +84,7 @@ public:
|
|||||||
Vector3 view = p_cam_inv_transform.xform(corner);
|
Vector3 view = p_cam_inv_transform.xform(corner);
|
||||||
|
|
||||||
if (p_cam_projection.is_orthogonal()) {
|
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);
|
Plane vp = Plane(view, 1.0);
|
||||||
|
|||||||
Reference in New Issue
Block a user