summaryrefslogtreecommitdiff
path: root/scene
diff options
context:
space:
mode:
Diffstat (limited to 'scene')
-rw-r--r--scene/resources/material.cpp12
-rw-r--r--scene/resources/material.h2
-rw-r--r--scene/resources/texture.cpp3
3 files changed, 17 insertions, 0 deletions
diff --git a/scene/resources/material.cpp b/scene/resources/material.cpp
index ce801c8763..c898aaff34 100644
--- a/scene/resources/material.cpp
+++ b/scene/resources/material.cpp
@@ -1369,6 +1369,12 @@ void SpatialMaterial::_validate_feature(const String &text, Feature feature, Pro
}
}
+void SpatialMaterial::_validate_high_end(const String &text, PropertyInfo &property) const {
+ if (property.name.begins_with(text)) {
+ property.usage |= PROPERTY_USAGE_HIGH_END_GFX;
+ }
+}
+
void SpatialMaterial::_validate_property(PropertyInfo &property) const {
_validate_feature("normal", FEATURE_NORMAL_MAPPING, property);
_validate_feature("emission", FEATURE_EMISSION, property);
@@ -1382,6 +1388,12 @@ void SpatialMaterial::_validate_property(PropertyInfo &property) const {
_validate_feature("refraction", FEATURE_REFRACTION, property);
_validate_feature("detail", FEATURE_DETAIL, property);
+ _validate_high_end("refraction", property);
+ _validate_high_end("subsurf_scatter", property);
+ _validate_high_end("anisotropy", property);
+ _validate_high_end("clearcoat", property);
+ _validate_high_end("depth", property);
+
if (property.name.begins_with("particles_anim_") && billboard_mode != BILLBOARD_PARTICLES) {
property.usage = 0;
}
diff --git a/scene/resources/material.h b/scene/resources/material.h
index 4a2a813341..0154874ae4 100644
--- a/scene/resources/material.h
+++ b/scene/resources/material.h
@@ -442,6 +442,8 @@ private:
static Ref<SpatialMaterial> materials_for_2d[MAX_MATERIALS_FOR_2D]; //used by Sprite3D and other stuff
+ void _validate_high_end(const String &text, PropertyInfo &property) const;
+
protected:
static void _bind_methods();
void _validate_property(PropertyInfo &property) const;
diff --git a/scene/resources/texture.cpp b/scene/resources/texture.cpp
index 16b4ed31df..f0e3979f13 100644
--- a/scene/resources/texture.cpp
+++ b/scene/resources/texture.cpp
@@ -207,6 +207,9 @@ void ImageTexture::set_flags(uint32_t p_flags) {
flags=p_flags|cube; */
flags = p_flags;
+ if (w == 0 || h == 0) {
+ return; //uninitialized, do not set to texture
+ }
VisualServer::get_singleton()->texture_set_flags(texture, p_flags);
}