summaryrefslogtreecommitdiff
path: root/scene/resources
diff options
context:
space:
mode:
authorclayjohn <claynjohn@gmail.com>2023-02-25 16:24:41 -0800
committerclayjohn <claynjohn@gmail.com>2023-02-26 12:28:02 -0800
commitc69b14e96e3191622c06aa1e98c7f15f1fc895d4 (patch)
tree59ea6fe8dd90524515103038b117cf1c2a0902c5 /scene/resources
parent84a80721c5308df36c7295949c76a622c5e0edb9 (diff)
Add warnings for unsupported features in mobile and gl_compatibility backends
Diffstat (limited to 'scene/resources')
-rw-r--r--scene/resources/camera_attributes.cpp7
-rw-r--r--scene/resources/environment.cpp21
-rw-r--r--scene/resources/material.cpp10
-rw-r--r--scene/resources/material.h2
4 files changed, 7 insertions, 33 deletions
diff --git a/scene/resources/camera_attributes.cpp b/scene/resources/camera_attributes.cpp
index 61df56523d..8f4f804397 100644
--- a/scene/resources/camera_attributes.cpp
+++ b/scene/resources/camera_attributes.cpp
@@ -394,6 +394,13 @@ void CameraAttributesPhysical::_update_frustum() {
bool use_far = (far < frustum_far) && (far > 0.0);
bool use_near = near > frustum_near;
+#ifdef DEBUG_ENABLED
+ if (OS::get_singleton()->get_current_rendering_method() == "gl_compatibility") {
+ // Force disable DoF in editor builds to suppress warnings.
+ use_far = false;
+ use_near = false;
+ }
+#endif
RS::get_singleton()->camera_attributes_set_dof_blur(
get_rid(),
use_far,
diff --git a/scene/resources/environment.cpp b/scene/resources/environment.cpp
index 8b4656414d..757be51017 100644
--- a/scene/resources/environment.cpp
+++ b/scene/resources/environment.cpp
@@ -1108,13 +1108,6 @@ void Environment::_validate_property(PropertyInfo &p_property) const {
};
- static const char *high_end_prefixes[] = {
- "ssr_",
- "ssao_",
- nullptr
-
- };
-
const char **prefixes = hide_prefixes;
while (*prefixes) {
String prefix = String(*prefixes);
@@ -1127,20 +1120,6 @@ void Environment::_validate_property(PropertyInfo &p_property) const {
prefixes++;
}
-
- if (RenderingServer::get_singleton()->is_low_end()) {
- prefixes = high_end_prefixes;
- while (*prefixes) {
- String prefix = String(*prefixes);
-
- if (p_property.name.begins_with(prefix)) {
- p_property.usage = PROPERTY_USAGE_NO_EDITOR;
- return;
- }
-
- prefixes++;
- }
- }
}
#ifndef DISABLE_DEPRECATED
diff --git a/scene/resources/material.cpp b/scene/resources/material.cpp
index 2627898f5f..8e0e38152f 100644
--- a/scene/resources/material.cpp
+++ b/scene/resources/material.cpp
@@ -1914,12 +1914,6 @@ void BaseMaterial3D::_validate_feature(const String &text, Feature feature, Prop
}
}
-void BaseMaterial3D::_validate_high_end(const String &text, PropertyInfo &property) const {
- if (property.name.begins_with(text)) {
- property.usage |= PROPERTY_USAGE_HIGH_END_GFX;
- }
-}
-
void BaseMaterial3D::_validate_property(PropertyInfo &p_property) const {
_validate_feature("normal", FEATURE_NORMAL_MAPPING, p_property);
_validate_feature("emission", FEATURE_EMISSION, p_property);
@@ -1933,10 +1927,6 @@ void BaseMaterial3D::_validate_property(PropertyInfo &p_property) const {
_validate_feature("refraction", FEATURE_REFRACTION, p_property);
_validate_feature("detail", FEATURE_DETAIL, p_property);
- _validate_high_end("refraction", p_property);
- _validate_high_end("subsurf_scatter", p_property);
- _validate_high_end("heightmap", p_property);
-
if (p_property.name == "emission_intensity" && !GLOBAL_GET("rendering/lights_and_shadows/use_physical_light_units")) {
p_property.usage = PROPERTY_USAGE_NONE;
}
diff --git a/scene/resources/material.h b/scene/resources/material.h
index 5ea9a807d4..1fa9a24bc5 100644
--- a/scene/resources/material.h
+++ b/scene/resources/material.h
@@ -543,8 +543,6 @@ private:
static HashMap<uint64_t, Ref<StandardMaterial3D>> materials_for_2d; //used by Sprite3D, Label3D and other stuff
- void _validate_high_end(const String &text, PropertyInfo &property) const;
-
protected:
static void _bind_methods();
void _validate_property(PropertyInfo &p_property) const;