From b0202c3a7d1921329859d3b4494184597d2de6b5 Mon Sep 17 00:00:00 2001 From: orosmatthew Date: Sat, 29 Jan 2022 14:38:39 -0500 Subject: Fix orthogonal camera auto LOD calculation - Do not take orthogonal camera's distance into account when calculating LOD. - Only take into account screen size taken up. --- .../renderer_rd/forward_clustered/render_forward_clustered.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'servers/rendering/renderer_rd/forward_clustered') 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 36604073cc..87301a9d3a 100644 --- a/servers/rendering/renderer_rd/forward_clustered/render_forward_clustered.cpp +++ b/servers/rendering/renderer_rd/forward_clustered/render_forward_clustered.cpp @@ -1081,6 +1081,10 @@ void RenderForwardClustered::_fill_render_list(RenderListType p_render_list, con distance = -distance_max; } + if (p_render_data->cam_ortogonal) { + distance = 1.0; + } + uint32_t indices; surf->sort.lod_index = storage->mesh_surface_get_lod(surf->surface, inst->lod_model_scale * inst->lod_bias, distance * p_render_data->lod_distance_multiplier, p_render_data->screen_mesh_lod_threshold, &indices); if (p_render_data->render_info) { -- cgit v1.2.3