From c69b14e96e3191622c06aa1e98c7f15f1fc895d4 Mon Sep 17 00:00:00 2001 From: clayjohn Date: Sat, 25 Feb 2023 16:24:41 -0800 Subject: Add warnings for unsupported features in mobile and gl_compatibility backends --- scene/3d/decal.cpp | 5 +++++ scene/3d/fog_volume.cpp | 7 ++++++- scene/3d/gpu_particles_3d.cpp | 3 +++ scene/3d/light_3d.cpp | 17 +++++++++++++---- scene/3d/lightmap_gi.cpp | 11 +++++++++++ scene/3d/lightmap_gi.h | 3 +++ scene/3d/reflection_probe.cpp | 11 +++++++++++ scene/3d/reflection_probe.h | 2 ++ scene/3d/visible_on_screen_notifier_3d.cpp | 10 ++++++++++ scene/3d/visible_on_screen_notifier_3d.h | 2 ++ scene/3d/voxel_gi.cpp | 4 ++-- 11 files changed, 68 insertions(+), 7 deletions(-) (limited to 'scene/3d') 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 = 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 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.")); } -- cgit v1.2.3