summaryrefslogtreecommitdiffstats
path: root/scene/resources/material.cpp
diff options
context:
space:
mode:
authorRémi Verschelde <remi@verschelde.fr>2021-10-04 19:17:32 +0200
committerGitHub <noreply@github.com>2021-10-04 19:17:32 +0200
commitd1c77d6b6218be9174656f088b9a3fb420b63950 (patch)
tree92ac24c1568ab55f2ca1c01ced4b1fa1921449ba /scene/resources/material.cpp
parentadc9500e5497c7427f91d7cbf9985f74cbb3451c (diff)
parent8c949016ffd193862f4b4b4633ee091708c446d9 (diff)
downloadredot-engine-d1c77d6b6218be9174656f088b9a3fb420b63950.tar.gz
Merge pull request #53378 from clayjohn/hide_render_priority
Hide render_priority except when using SpatialMaterials
Diffstat (limited to 'scene/resources/material.cpp')
-rw-r--r--scene/resources/material.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/scene/resources/material.cpp b/scene/resources/material.cpp
index 08851dbc58..66f04f0292 100644
--- a/scene/resources/material.cpp
+++ b/scene/resources/material.cpp
@@ -75,6 +75,9 @@ void Material::_validate_property(PropertyInfo &property) const {
if (!_can_do_next_pass() && property.name == "next_pass") {
property.usage = PROPERTY_USAGE_NONE;
}
+ if (!_can_use_render_priority() && property.name == "render_priority") {
+ property.usage = PROPERTY_USAGE_NONE;
+ }
}
void Material::inspect_native_shader_code() {
@@ -280,6 +283,10 @@ bool ShaderMaterial::_can_do_next_pass() const {
return shader.is_valid() && shader->get_mode() == Shader::MODE_SPATIAL;
}
+bool ShaderMaterial::_can_use_render_priority() const {
+ return shader.is_valid() && shader->get_mode() == Shader::MODE_SPATIAL;
+}
+
Shader::Mode ShaderMaterial::get_shader_mode() const {
if (shader.is_valid()) {
return shader->get_mode();