File tree Expand file tree Collapse file tree 1 file changed +6
-0
lines changed Expand file tree Collapse file tree 1 file changed +6
-0
lines changed Original file line number Diff line number Diff line change @@ -64,6 +64,7 @@ Ref<Material> Material::get_next_pass() const {
6464void Material::set_render_priority (int p_priority) {
6565 ERR_FAIL_COND (p_priority < RENDER_PRIORITY_MIN);
6666 ERR_FAIL_COND (p_priority > RENDER_PRIORITY_MAX);
67+
6768 render_priority = p_priority;
6869
6970 if (material.is_valid ()) {
@@ -3217,6 +3218,11 @@ void BaseMaterial3D::set_stencil_mode(StencilMode p_stencil_mode) {
32173218 return ;
32183219 }
32193220
3221+ if (p_stencil_mode == StencilMode::STENCIL_MODE_OUTLINE || p_stencil_mode == StencilMode::STENCIL_MODE_XRAY) {
3222+ ERR_FAIL_COND_EDMSG (get_render_priority () >= RENDER_PRIORITY_MAX,
3223+ vformat (" Cannot use stencil mode Outline or Xray, when render priority is RENDER_PRIORITY_MAX(%d)." , RENDER_PRIORITY_MAX));
3224+ }
3225+
32203226 stencil_mode = p_stencil_mode;
32213227 _prepare_stencil_effect ();
32223228 _queue_shader_change ();
You can’t perform that action at this time.
0 commit comments