mirror of
https://github.com/Redot-Engine/redot-engine.git
synced 2025-12-06 07:17:42 -05:00
Merge pull request #109052 from Squamto/108905
Fix overflowing render priority for stencil mode outline and xray
This commit is contained in:
@@ -64,6 +64,7 @@ Ref<Material> Material::get_next_pass() const {
|
|||||||
void Material::set_render_priority(int p_priority) {
|
void Material::set_render_priority(int p_priority) {
|
||||||
ERR_FAIL_COND(p_priority < RENDER_PRIORITY_MIN);
|
ERR_FAIL_COND(p_priority < RENDER_PRIORITY_MIN);
|
||||||
ERR_FAIL_COND(p_priority > RENDER_PRIORITY_MAX);
|
ERR_FAIL_COND(p_priority > RENDER_PRIORITY_MAX);
|
||||||
|
|
||||||
render_priority = p_priority;
|
render_priority = p_priority;
|
||||||
|
|
||||||
if (material.is_valid()) {
|
if (material.is_valid()) {
|
||||||
@@ -3220,6 +3221,11 @@ void BaseMaterial3D::set_stencil_mode(StencilMode p_stencil_mode) {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (p_stencil_mode == StencilMode::STENCIL_MODE_OUTLINE || p_stencil_mode == StencilMode::STENCIL_MODE_XRAY) {
|
||||||
|
ERR_FAIL_COND_EDMSG(get_render_priority() >= RENDER_PRIORITY_MAX,
|
||||||
|
vformat("Cannot use stencil mode Outline or Xray, when render priority is RENDER_PRIORITY_MAX(%d).", RENDER_PRIORITY_MAX));
|
||||||
|
}
|
||||||
|
|
||||||
stencil_mode = p_stencil_mode;
|
stencil_mode = p_stencil_mode;
|
||||||
_prepare_stencil_effect();
|
_prepare_stencil_effect();
|
||||||
_queue_shader_change();
|
_queue_shader_change();
|
||||||
|
|||||||
Reference in New Issue
Block a user