From 82bb8f15311929e7e6875c6f3937cb33a698fd68 Mon Sep 17 00:00:00 2001 From: Daniel Doran Date: Sat, 3 Jul 2021 16:22:35 -0600 Subject: [PATCH] Fix transparency sorting --- .../renderer_rd/forward_clustered/render_forward_clustered.cpp | 2 +- .../renderer_rd/forward_clustered/render_forward_clustered.h | 2 +- .../renderer_rd/forward_mobile/render_forward_mobile.cpp | 2 +- .../renderer_rd/forward_mobile/render_forward_mobile.h | 2 +- 4 files changed, 4 insertions(+), 4 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 3ab2f0eed2c..bf597fb603c 100644 --- a/servers/rendering/renderer_rd/forward_clustered/render_forward_clustered.cpp +++ b/servers/rendering/renderer_rd/forward_clustered/render_forward_clustered.cpp @@ -1259,7 +1259,7 @@ void RenderForwardClustered::_render_scene(RenderDataRD *p_render_data, const Co _fill_render_list(RENDER_LIST_OPAQUE, p_render_data, PASS_MODE_COLOR, using_sdfgi, using_sdfgi || using_voxelgi); render_list[RENDER_LIST_OPAQUE].sort_by_key(); - render_list[RENDER_LIST_ALPHA].sort_by_depth(); + render_list[RENDER_LIST_ALPHA].sort_by_reverse_depth_and_priority(); _fill_instance_data(RENDER_LIST_OPAQUE, p_render_data->render_info ? p_render_data->render_info->info[RS::VIEWPORT_RENDER_INFO_TYPE_VISIBLE] : (int *)nullptr); _fill_instance_data(RENDER_LIST_ALPHA); diff --git a/servers/rendering/renderer_rd/forward_clustered/render_forward_clustered.h b/servers/rendering/renderer_rd/forward_clustered/render_forward_clustered.h index 6cb9fea91a3..750c0167e78 100644 --- a/servers/rendering/renderer_rd/forward_clustered/render_forward_clustered.h +++ b/servers/rendering/renderer_rd/forward_clustered/render_forward_clustered.h @@ -551,7 +551,7 @@ class RenderForwardClustered : public RendererSceneRenderRD { } }; - void sort_by_reverse_depth_and_priority(bool p_alpha) { //used for alpha + void sort_by_reverse_depth_and_priority() { //used for alpha SortArray sorter; sorter.sort(elements.ptr(), elements.size()); 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 e7521e6bef0..7fbd6e23b0c 100644 --- a/servers/rendering/renderer_rd/forward_mobile/render_forward_mobile.cpp +++ b/servers/rendering/renderer_rd/forward_mobile/render_forward_mobile.cpp @@ -374,7 +374,7 @@ void RenderForwardMobile::_render_scene(RenderDataRD *p_render_data, const Color _fill_render_list(RENDER_LIST_OPAQUE, p_render_data, PASS_MODE_COLOR); render_list[RENDER_LIST_OPAQUE].sort_by_key(); - render_list[RENDER_LIST_ALPHA].sort_by_depth(); + render_list[RENDER_LIST_ALPHA].sort_by_reverse_depth_and_priority(); // we no longer use this... _fill_instance_data(RENDER_LIST_OPAQUE); diff --git a/servers/rendering/renderer_rd/forward_mobile/render_forward_mobile.h b/servers/rendering/renderer_rd/forward_mobile/render_forward_mobile.h index d5c0cca6c7f..f40f713c032 100644 --- a/servers/rendering/renderer_rd/forward_mobile/render_forward_mobile.h +++ b/servers/rendering/renderer_rd/forward_mobile/render_forward_mobile.h @@ -356,7 +356,7 @@ protected: } }; - void sort_by_reverse_depth_and_priority(bool p_alpha) { //used for alpha + void sort_by_reverse_depth_and_priority() { //used for alpha SortArray sorter; sorter.sort(elements.ptr(), elements.size());