Merge pull request #50104 from GiantBlargg/fix_transparency_sorting

Fix transparency sorting
This commit is contained in:
Rémi Verschelde 2021-07-05 15:04:22 +02:00 committed by GitHub
commit 67ed879f55
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 4 additions and 4 deletions

View file

@ -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);

View file

@ -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<GeometryInstanceSurfaceDataCache *, SortByReverseDepthAndPriority> sorter;
sorter.sort(elements.ptr(), elements.size());

View file

@ -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);

View file

@ -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<GeometryInstanceSurfaceDataCache *, SortByReverseDepthAndPriority> sorter;
sorter.sort(elements.ptr(), elements.size());