summaryrefslogtreecommitdiff
path: root/servers
diff options
context:
space:
mode:
authorLyuma <xn.lyuma@gmail.com>2022-12-15 02:36:14 -0800
committerLyuma <xn.lyuma@gmail.com>2022-12-15 16:12:10 -0800
commit80dea918c4579b7a486fd668616e43df98d6e845 (patch)
tree23a4150327dafa75a7b75391a8861968211964db /servers
parentf18f2740da9cce7383c2aa41fe8d081d56c8b6cf (diff)
Flip culling when rendering a camera with negative scale
Diffstat (limited to 'servers')
-rw-r--r--servers/rendering/renderer_rd/forward_clustered/render_forward_clustered.cpp2
-rw-r--r--servers/rendering/renderer_rd/forward_mobile/render_forward_mobile.cpp2
2 files changed, 2 insertions, 2 deletions
diff --git a/servers/rendering/renderer_rd/forward_clustered/render_forward_clustered.cpp b/servers/rendering/renderer_rd/forward_clustered/render_forward_clustered.cpp
index 3d1e04fe99..bd27eeb981 100644
--- a/servers/rendering/renderer_rd/forward_clustered/render_forward_clustered.cpp
+++ b/servers/rendering/renderer_rd/forward_clustered/render_forward_clustered.cpp
@@ -1622,7 +1622,7 @@ void RenderForwardClustered::_render_scene(RenderDataRD *p_render_data, const Co
bool using_ssr = false;
bool using_sdfgi = false;
bool using_voxelgi = false;
- bool reverse_cull = false;
+ bool reverse_cull = p_render_data->scene_data->cam_transform.basis.determinant() < 0;
bool using_ssil = p_render_data->environment.is_valid() && environment_get_ssil_enabled(p_render_data->environment);
if (rb.is_valid()) {
diff --git a/servers/rendering/renderer_rd/forward_mobile/render_forward_mobile.cpp b/servers/rendering/renderer_rd/forward_mobile/render_forward_mobile.cpp
index a55cccdc6b..765f71aa6f 100644
--- a/servers/rendering/renderer_rd/forward_mobile/render_forward_mobile.cpp
+++ b/servers/rendering/renderer_rd/forward_mobile/render_forward_mobile.cpp
@@ -673,7 +673,7 @@ void RenderForwardMobile::_render_scene(RenderDataRD *p_render_data, const Color
Size2i screen_size;
RID framebuffer;
- bool reverse_cull = false;
+ bool reverse_cull = p_render_data->scene_data->cam_transform.basis.determinant() < 0;
bool using_subpass_transparent = true;
bool using_subpass_post_process = true;