summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <rverschelde@gmail.com>2018-12-11 16:12:56 +0100
committerGitHub <noreply@github.com>2018-12-11 16:12:56 +0100
commit573956915efefb1cda0a5349c7e7aaeb0363df1d (patch)
tree35b8060d9c531743c088780f56b8a46dc61cbfd5
parent022ae53191142812b647710146ba23ca20256b21 (diff)
parent4a60679f31e7e97f15c5f7dcf2c91bd4dab1b727 (diff)
Merge pull request #22461 from dlasalle/#10480
Hide shading options in SpatialMaterial when 'FLAG_UNSHADED' is set.
-rw-r--r--scene/resources/material.cpp44
1 files changed, 43 insertions, 1 deletions
diff --git a/scene/resources/material.cpp b/scene/resources/material.cpp
index fa8c927813..cc3c882169 100644
--- a/scene/resources/material.cpp
+++ b/scene/resources/material.cpp
@@ -1315,7 +1315,7 @@ void SpatialMaterial::set_flag(Flags p_flag, bool p_enabled) {
return;
flags[p_flag] = p_enabled;
- if (p_flag == FLAG_USE_ALPHA_SCISSOR) {
+ if (p_flag == FLAG_USE_ALPHA_SCISSOR || p_flag == FLAG_UNSHADED) {
_change_notify();
}
_queue_shader_change();
@@ -1421,6 +1421,48 @@ void SpatialMaterial::_validate_property(PropertyInfo &property) const {
if ((property.name == "depth_min_layers" || property.name == "depth_max_layers") && !deep_parallax) {
property.usage = 0;
}
+
+ if (flags[FLAG_UNSHADED]) {
+ if (property.name.begins_with("anisotropy")) {
+ property.usage = 0;
+ }
+
+ if (property.name.begins_with("ao")) {
+ property.usage = 0;
+ }
+
+ if (property.name.begins_with("clearcoat")) {
+ property.usage = 0;
+ }
+
+ if (property.name.begins_with("emission")) {
+ property.usage = 0;
+ }
+
+ if (property.name.begins_with("metallic")) {
+ property.usage = 0;
+ }
+
+ if (property.name.begins_with("normal")) {
+ property.usage = 0;
+ }
+
+ if (property.name.begins_with("rim")) {
+ property.usage = 0;
+ }
+
+ if (property.name.begins_with("roughness")) {
+ property.usage = 0;
+ }
+
+ if (property.name.begins_with("subsurf_scatter")) {
+ property.usage = 0;
+ }
+
+ if (property.name.begins_with("transmission")) {
+ property.usage = 0;
+ }
+ }
}
void SpatialMaterial::set_line_width(float p_line_width) {