summaryrefslogtreecommitdiff
path: root/scene
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
parent84a80721c5308df36c7295949c76a622c5e0edb9 (diff)
Add warnings for unsupported features in mobile and gl_compatibility backends
Diffstat (limited to 'scene')
-rw-r--r--scene/2d/gpu_particles_2d.cpp5
-rw-r--r--scene/3d/decal.cpp5
-rw-r--r--scene/3d/fog_volume.cpp7
-rw-r--r--scene/3d/gpu_particles_3d.cpp3
-rw-r--r--scene/3d/light_3d.cpp17
-rw-r--r--scene/3d/lightmap_gi.cpp11
-rw-r--r--scene/3d/lightmap_gi.h3
-rw-r--r--scene/3d/reflection_probe.cpp11
-rw-r--r--scene/3d/reflection_probe.h2
-rw-r--r--scene/3d/visible_on_screen_notifier_3d.cpp10
-rw-r--r--scene/3d/visible_on_screen_notifier_3d.h2
-rw-r--r--scene/3d/voxel_gi.cpp4
-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
16 files changed, 80 insertions, 40 deletions
diff --git a/scene/2d/gpu_particles_2d.cpp b/scene/2d/gpu_particles_2d.cpp
index 00d13c59b9..3f887ae9f3 100644
--- a/scene/2d/gpu_particles_2d.cpp
+++ b/scene/2d/gpu_particles_2d.cpp
@@ -143,6 +143,7 @@ void GPUParticles2D::set_trail_enabled(bool p_enabled) {
trail_enabled = p_enabled;
RS::get_singleton()->particles_set_trails(particles, trail_enabled, trail_lifetime);
queue_redraw();
+ update_configuration_warnings();
RS::get_singleton()->particles_set_transform_align(particles, p_enabled ? RS::PARTICLES_TRANSFORM_ALIGN_Y_TO_VELOCITY : RS::PARTICLES_TRANSFORM_ALIGN_DISABLED);
}
@@ -314,6 +315,10 @@ PackedStringArray GPUParticles2D::get_configuration_warnings() const {
}
}
+ if (trail_enabled && OS::get_singleton()->get_current_rendering_method() == "gl_compatibility") {
+ warnings.push_back(RTR("Particle trails are only available when using the Forward+ or Mobile rendering backends."));
+ }
+
return warnings;
}
diff --git a/scene/3d/decal.cpp b/scene/3d/decal.cpp
index 6f2717fd41..50a5b2da70 100644
--- a/scene/3d/decal.cpp
+++ b/scene/3d/decal.cpp
@@ -165,6 +165,11 @@ void Decal::_validate_property(PropertyInfo &p_property) const {
PackedStringArray Decal::get_configuration_warnings() const {
PackedStringArray warnings = Node::get_configuration_warnings();
+ if (OS::get_singleton()->get_current_rendering_method() == "gl_compatibility") {
+ warnings.push_back(RTR("Decals are only available when using the Forward+ or Mobile rendering backends."));
+ return warnings;
+ }
+
if (textures[TEXTURE_ALBEDO].is_null() && textures[TEXTURE_NORMAL].is_null() && textures[TEXTURE_ORM].is_null() && textures[TEXTURE_EMISSION].is_null()) {
warnings.push_back(RTR("The decal has no textures loaded into any of its texture properties, and will therefore not be visible."));
}
diff --git a/scene/3d/fog_volume.cpp b/scene/3d/fog_volume.cpp
index 9b0a7bb302..12ca1888c4 100644
--- a/scene/3d/fog_volume.cpp
+++ b/scene/3d/fog_volume.cpp
@@ -122,8 +122,13 @@ PackedStringArray FogVolume::get_configuration_warnings() const {
Ref<Environment> environment = get_viewport()->find_world_3d()->get_environment();
+ if (OS::get_singleton()->get_current_rendering_method() != "forward_plus") {
+ warnings.push_back(RTR("Fog Volumes are only visible when using the Forward+ backend."));
+ return warnings;
+ }
+
if (environment.is_valid() && !environment->is_volumetric_fog_enabled()) {
- warnings.push_back(("Fog Volumes need volumetric fog to be enabled in the scene's Environment in order to be visible."));
+ warnings.push_back(RTR("Fog Volumes need volumetric fog to be enabled in the scene's Environment in order to be visible."));
}
return warnings;
diff --git a/scene/3d/gpu_particles_3d.cpp b/scene/3d/gpu_particles_3d.cpp
index a330b76ec7..8eb1820cf8 100644
--- a/scene/3d/gpu_particles_3d.cpp
+++ b/scene/3d/gpu_particles_3d.cpp
@@ -358,6 +358,9 @@ PackedStringArray GPUParticles3D::get_configuration_warnings() const {
if ((dp_count || !skin.is_null()) && (missing_trails || no_materials)) {
warnings.push_back(RTR("Trails enabled, but one or more mesh materials are either missing or not set for trails rendering."));
}
+ if (OS::get_singleton()->get_current_rendering_method() == "gl_compatibility") {
+ warnings.push_back(RTR("Particle trails are only available when using the Forward+ or Mobile rendering backends."));
+ }
}
return warnings;
diff --git a/scene/3d/light_3d.cpp b/scene/3d/light_3d.cpp
index cca84c2b85..16c82bf6d2 100644
--- a/scene/3d/light_3d.cpp
+++ b/scene/3d/light_3d.cpp
@@ -56,11 +56,8 @@ void Light3D::set_shadow(bool p_enable) {
shadow = p_enable;
RS::get_singleton()->light_set_shadow(light, p_enable);
- if (type == RenderingServer::LIGHT_SPOT || type == RenderingServer::LIGHT_OMNI) {
- update_configuration_warnings();
- }
-
notify_property_list_changed();
+ update_configuration_warnings();
}
bool Light3D::has_shadow() const {
@@ -175,6 +172,10 @@ AABB Light3D::get_aabb() const {
PackedStringArray Light3D::get_configuration_warnings() const {
PackedStringArray warnings = VisualInstance3D::get_configuration_warnings();
+ if (has_shadow() && OS::get_singleton()->get_current_rendering_method() == "gl_compatibility") {
+ warnings.push_back(RTR("Shadows are not supported when using the GL Compatibility backend yet. Support will be added in a future release."));
+ }
+
if (!get_scale().is_equal_approx(Vector3(1, 1, 1))) {
warnings.push_back(RTR("A light's scale does not affect the visual size of the light."));
}
@@ -603,6 +604,10 @@ PackedStringArray OmniLight3D::get_configuration_warnings() const {
warnings.push_back(RTR("Projector texture only works with shadows active."));
}
+ if (get_projector().is_valid() && OS::get_singleton()->get_current_rendering_method() == "gl_compatibility") {
+ warnings.push_back(RTR("Projector textures are not supported when using the GL Compatibility backend yet. Support will be added in a future release."));
+ }
+
return warnings;
}
@@ -635,6 +640,10 @@ PackedStringArray SpotLight3D::get_configuration_warnings() const {
warnings.push_back(RTR("Projector texture only works with shadows active."));
}
+ if (get_projector().is_valid() && OS::get_singleton()->get_current_rendering_method() == "gl_compatibility") {
+ warnings.push_back(RTR("Projector textures are not supported when using the GL Compatibility backend yet. Support will be added in a future release."));
+ }
+
return warnings;
}
diff --git a/scene/3d/lightmap_gi.cpp b/scene/3d/lightmap_gi.cpp
index b4387b0f3c..3ee08fd548 100644
--- a/scene/3d/lightmap_gi.cpp
+++ b/scene/3d/lightmap_gi.cpp
@@ -1458,6 +1458,17 @@ Ref<CameraAttributes> LightmapGI::get_camera_attributes() const {
return camera_attributes;
}
+PackedStringArray LightmapGI::get_configuration_warnings() const {
+ PackedStringArray warnings = Node::get_configuration_warnings();
+
+ if (OS::get_singleton()->get_current_rendering_method() == "gl_compatibility") {
+ warnings.push_back(RTR("LightmapGI nodes are not supported when using the GL Compatibility backend yet. Support will be added in a future release."));
+ return warnings;
+ }
+
+ return warnings;
+}
+
void LightmapGI::_validate_property(PropertyInfo &p_property) const {
if (p_property.name == "environment_custom_sky" && environment_mode != ENVIRONMENT_MODE_CUSTOM_SKY) {
p_property.usage = PROPERTY_USAGE_NONE;
diff --git a/scene/3d/lightmap_gi.h b/scene/3d/lightmap_gi.h
index 40ff9e4cad..b9e33cf300 100644
--- a/scene/3d/lightmap_gi.h
+++ b/scene/3d/lightmap_gi.h
@@ -274,6 +274,9 @@ public:
AABB get_aabb() const override;
BakeError bake(Node *p_from_node, String p_image_data_path = "", Lightmapper::BakeStepFunc p_bake_step = nullptr, void *p_bake_userdata = nullptr);
+
+ virtual PackedStringArray get_configuration_warnings() const override;
+
LightmapGI();
};
diff --git a/scene/3d/reflection_probe.cpp b/scene/3d/reflection_probe.cpp
index 62202c0b1b..e533f08861 100644
--- a/scene/3d/reflection_probe.cpp
+++ b/scene/3d/reflection_probe.cpp
@@ -180,6 +180,17 @@ AABB ReflectionProbe::get_aabb() const {
return aabb;
}
+PackedStringArray ReflectionProbe::get_configuration_warnings() const {
+ PackedStringArray warnings = Node::get_configuration_warnings();
+
+ if (OS::get_singleton()->get_current_rendering_method() == "gl_compatibility") {
+ warnings.push_back(RTR("ReflectionProbes are not supported when using the GL Compatibility backend yet. Support will be added in a future release."));
+ return warnings;
+ }
+
+ return warnings;
+}
+
void ReflectionProbe::_validate_property(PropertyInfo &p_property) const {
if (p_property.name == "ambient_color" || p_property.name == "ambient_color_energy") {
if (ambient_mode != AMBIENT_COLOR) {
diff --git a/scene/3d/reflection_probe.h b/scene/3d/reflection_probe.h
index 738277ad39..5438219d5e 100644
--- a/scene/3d/reflection_probe.h
+++ b/scene/3d/reflection_probe.h
@@ -118,6 +118,8 @@ public:
virtual AABB get_aabb() const override;
+ virtual PackedStringArray get_configuration_warnings() const override;
+
ReflectionProbe();
~ReflectionProbe();
};
diff --git a/scene/3d/visible_on_screen_notifier_3d.cpp b/scene/3d/visible_on_screen_notifier_3d.cpp
index afddfdb749..d1ad713343 100644
--- a/scene/3d/visible_on_screen_notifier_3d.cpp
+++ b/scene/3d/visible_on_screen_notifier_3d.cpp
@@ -79,6 +79,16 @@ void VisibleOnScreenNotifier3D::_notification(int p_what) {
}
}
+PackedStringArray VisibleOnScreenNotifier3D::get_configuration_warnings() const {
+ PackedStringArray warnings = VisualInstance3D::get_configuration_warnings();
+
+ if (OS::get_singleton()->get_current_rendering_method() == "gl_compatibility") {
+ warnings.push_back(RTR("VisibleOnScreenNotifier3D nodes are not supported when using the GL Compatibility backend yet. Support will be added in a future release."));
+ }
+
+ return warnings;
+}
+
void VisibleOnScreenNotifier3D::_bind_methods() {
ClassDB::bind_method(D_METHOD("set_aabb", "rect"), &VisibleOnScreenNotifier3D::set_aabb);
ClassDB::bind_method(D_METHOD("is_on_screen"), &VisibleOnScreenNotifier3D::is_on_screen);
diff --git a/scene/3d/visible_on_screen_notifier_3d.h b/scene/3d/visible_on_screen_notifier_3d.h
index 7115de536f..85156c256e 100644
--- a/scene/3d/visible_on_screen_notifier_3d.h
+++ b/scene/3d/visible_on_screen_notifier_3d.h
@@ -57,6 +57,8 @@ public:
virtual AABB get_aabb() const override;
bool is_on_screen() const;
+ virtual PackedStringArray get_configuration_warnings() const override;
+
VisibleOnScreenNotifier3D();
~VisibleOnScreenNotifier3D();
};
diff --git a/scene/3d/voxel_gi.cpp b/scene/3d/voxel_gi.cpp
index 36a877246e..faeacec63a 100644
--- a/scene/3d/voxel_gi.cpp
+++ b/scene/3d/voxel_gi.cpp
@@ -492,8 +492,8 @@ AABB VoxelGI::get_aabb() const {
PackedStringArray VoxelGI::get_configuration_warnings() const {
PackedStringArray warnings = Node::get_configuration_warnings();
- if (RenderingServer::get_singleton()->is_low_end()) {
- warnings.push_back(RTR("VoxelGIs are not supported by the OpenGL video driver.\nUse a LightmapGI instead."));
+ if (OS::get_singleton()->get_current_rendering_method() == "gl_compatibility") {
+ warnings.push_back(RTR("VoxelGI nodes are not supported when using the GL Compatibility backend yet. Support will be added in a future release."));
} else if (probe_data.is_null()) {
warnings.push_back(RTR("No VoxelGI data set, so this node is disabled. Bake static objects to enable GI."));
}
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;