From 8ce3011ae65673e15c90e4c5b57bfed21f390e9d Mon Sep 17 00:00:00 2001 From: Apples <2352020+apples@users.noreply.github.com> Date: Sat, 21 Jun 2025 10:48:25 -0500 Subject: [PATCH] Fixed stencil preset priorities --- scene/resources/material.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scene/resources/material.cpp b/scene/resources/material.cpp index a7d5693f185..9557a310982 100644 --- a/scene/resources/material.cpp +++ b/scene/resources/material.cpp @@ -3167,7 +3167,7 @@ void BaseMaterial3D::_prepare_stencil_effect() { case STENCIL_MODE_OUTLINE: set_stencil_flags(STENCIL_FLAG_WRITE); set_stencil_compare(STENCIL_COMPARE_ALWAYS); - stencil_next_pass->set_render_priority(-1); + stencil_next_pass->set_render_priority(get_render_priority() + 1); stencil_next_pass->set_shading_mode(SHADING_MODE_UNSHADED); stencil_next_pass->set_transparency(TRANSPARENCY_ALPHA); stencil_next_pass->set_flag(FLAG_DISABLE_DEPTH_TEST, false); @@ -3182,7 +3182,7 @@ void BaseMaterial3D::_prepare_stencil_effect() { case STENCIL_MODE_XRAY: set_stencil_flags(STENCIL_FLAG_WRITE); set_stencil_compare(STENCIL_COMPARE_ALWAYS); - stencil_next_pass->set_render_priority(-1); + stencil_next_pass->set_render_priority(get_render_priority() + 1); stencil_next_pass->set_shading_mode(SHADING_MODE_UNSHADED); stencil_next_pass->set_transparency(TRANSPARENCY_ALPHA); stencil_next_pass->set_flag(FLAG_DISABLE_DEPTH_TEST, true);