summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--editor/editor_inspector.cpp11
-rw-r--r--editor/editor_inspector.h3
-rw-r--r--editor/editor_settings.cpp2
-rw-r--r--editor/inspector_dock.cpp7
-rw-r--r--servers/rendering/renderer_rd/renderer_scene_render_rd.cpp53
-rw-r--r--servers/rendering/renderer_rd/renderer_scene_render_rd.h1
6 files changed, 67 insertions, 10 deletions
diff --git a/editor/editor_inspector.cpp b/editor/editor_inspector.cpp
index d29067aa02..55704a38b8 100644
--- a/editor/editor_inspector.cpp
+++ b/editor/editor_inspector.cpp
@@ -413,7 +413,7 @@ void EditorProperty::_notification(int p_what) {
if (has_borders) {
get_parent()->disconnect(SceneStringName(theme_changed), callable_mp(this, &EditorProperty::_update_property_bg));
}
- }
+ } break;
}
}
@@ -1364,6 +1364,8 @@ void EditorInspectorSection::_notification(int p_what) {
switch (p_what) {
case NOTIFICATION_THEME_CHANGED: {
update_minimum_size();
+ bg_color = get_theme_color(SNAME("prop_subsection"), EditorStringName(Editor));
+ bg_color.a /= level;
} break;
case NOTIFICATION_SORT_CHILDREN: {
@@ -1562,13 +1564,14 @@ Size2 EditorInspectorSection::get_minimum_size() const {
return ms;
}
-void EditorInspectorSection::setup(const String &p_section, const String &p_label, Object *p_object, const Color &p_bg_color, bool p_foldable, int p_indent_depth) {
+void EditorInspectorSection::setup(const String &p_section, const String &p_label, Object *p_object, const Color &p_bg_color, bool p_foldable, int p_indent_depth, int p_level) {
section = p_section;
label = p_label;
object = p_object;
bg_color = p_bg_color;
foldable = p_foldable;
indent_depth = p_indent_depth;
+ level = p_level;
if (!foldable && !vbox_added) {
add_child(vbox);
@@ -1668,7 +1671,7 @@ void EditorInspectorSection::property_can_revert_changed(const String &p_path, b
}
void EditorInspectorSection::_bind_methods() {
- ClassDB::bind_method(D_METHOD("setup", "section", "label", "object", "bg_color", "foldable"), &EditorInspectorSection::setup);
+ ClassDB::bind_method(D_METHOD("setup", "section", "label", "object", "bg_color", "foldable", "indent_depth", "level"), &EditorInspectorSection::setup, DEFVAL(0), DEFVAL(1));
ClassDB::bind_method(D_METHOD("get_vbox"), &EditorInspectorSection::get_vbox);
ClassDB::bind_method(D_METHOD("unfold"), &EditorInspectorSection::unfold);
ClassDB::bind_method(D_METHOD("fold"), &EditorInspectorSection::fold);
@@ -3178,7 +3181,7 @@ void EditorInspector::update_tree() {
Color c = sscolor;
c.a /= level;
- section->setup(acc_path, label, object, c, use_folding, section_depth);
+ section->setup(acc_path, label, object, c, use_folding, section_depth, level);
section->set_tooltip_text(tooltip);
// Add editors at the start of a group.
diff --git a/editor/editor_inspector.h b/editor/editor_inspector.h
index f9b0d1f094..29ee234883 100644
--- a/editor/editor_inspector.h
+++ b/editor/editor_inspector.h
@@ -307,6 +307,7 @@ class EditorInspectorSection : public Container {
Color bg_color;
bool foldable = false;
int indent_depth = 0;
+ int level = 1;
Timer *dropping_unfold_timer = nullptr;
bool dropping = false;
@@ -329,7 +330,7 @@ protected:
public:
virtual Size2 get_minimum_size() const override;
- void setup(const String &p_section, const String &p_label, Object *p_object, const Color &p_bg_color, bool p_foldable, int p_indent_depth = 0);
+ void setup(const String &p_section, const String &p_label, Object *p_object, const Color &p_bg_color, bool p_foldable, int p_indent_depth = 0, int p_level = 1);
VBoxContainer *get_vbox();
void unfold();
void fold();
diff --git a/editor/editor_settings.cpp b/editor/editor_settings.cpp
index 782d64621f..024aec22b6 100644
--- a/editor/editor_settings.cpp
+++ b/editor/editor_settings.cpp
@@ -483,7 +483,7 @@ void EditorSettings::_load_defaults(Ref<ConfigFile> p_extra_config) {
EDITOR_SETTING(Variant::FLOAT, PROPERTY_HINT_RANGE, "interface/inspector/float_drag_speed", 5.0, "0.1,100,0.01")
EDITOR_SETTING(Variant::INT, PROPERTY_HINT_ENUM, "interface/inspector/nested_color_mode", 0, "Containers & Resources,Resources,External Resources")
EDITOR_SETTING(Variant::BOOL, PROPERTY_HINT_NONE, "interface/inspector/delimitate_all_container_and_resources", true, "")
- EDITOR_SETTING_USAGE(Variant::INT, PROPERTY_HINT_ENUM, "interface/inspector/default_property_name_style", EditorPropertyNameProcessor::STYLE_CAPITALIZED, "Raw,Capitalized,Localized", PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_RESTART_IF_CHANGED);
+ EDITOR_SETTING_USAGE(Variant::INT, PROPERTY_HINT_ENUM, "interface/inspector/default_property_name_style", EditorPropertyNameProcessor::STYLE_CAPITALIZED, "Raw (e.g. \"z_index\"),Capitalized (e.g. \"Z Index\"),Localized (e.g. \"Z Index\")", PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_RESTART_IF_CHANGED);
// The lowest value is equal to the minimum float step for 32-bit floats.
// The step must be set manually, as changing this setting should not change the step here.
EDITOR_SETTING_USAGE(Variant::FLOAT, PROPERTY_HINT_RANGE, "interface/inspector/default_float_step", 0.001, "0.0000001,1,0.0000001", PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_RESTART_IF_CHANGED);
diff --git a/editor/inspector_dock.cpp b/editor/inspector_dock.cpp
index b71f0f1bb6..acdbd6d9c4 100644
--- a/editor/inspector_dock.cpp
+++ b/editor/inspector_dock.cpp
@@ -541,9 +541,10 @@ void InspectorDock::update(Object *p_object) {
p->add_shortcut(ED_SHORTCUT("property_editor/expand_revertable", TTR("Expand Non-Default")), EXPAND_REVERTABLE);
p->add_separator(TTR("Property Name Style"));
- p->add_radio_check_item(TTR("Raw"), PROPERTY_NAME_STYLE_RAW);
- p->add_radio_check_item(TTR("Capitalized"), PROPERTY_NAME_STYLE_CAPITALIZED);
- p->add_radio_check_item(TTR("Localized"), PROPERTY_NAME_STYLE_LOCALIZED);
+ p->add_radio_check_item(vformat(TTR("Raw (e.g. \"%s\")"), "z_index"), PROPERTY_NAME_STYLE_RAW);
+ p->add_radio_check_item(vformat(TTR("Capitalized (e.g. \"%s\")"), "Z Index"), PROPERTY_NAME_STYLE_CAPITALIZED);
+ // TRANSLATORS: "Z Index" should match the existing translated CanvasItem property name in the current language you're working on.
+ p->add_radio_check_item(TTR("Localized (e.g. \"Z Index\")"), PROPERTY_NAME_STYLE_LOCALIZED);
if (!EditorPropertyNameProcessor::is_localization_available()) {
const int index = p->get_item_index(PROPERTY_NAME_STYLE_LOCALIZED);
diff --git a/servers/rendering/renderer_rd/renderer_scene_render_rd.cpp b/servers/rendering/renderer_rd/renderer_scene_render_rd.cpp
index 1e4880e67a..96bcd72099 100644
--- a/servers/rendering/renderer_rd/renderer_scene_render_rd.cpp
+++ b/servers/rendering/renderer_rd/renderer_scene_render_rd.cpp
@@ -423,6 +423,7 @@ void RendererSceneRenderRD::_render_buffers_post_process_and_tonemap(const Rende
Size2i target_size = rb->get_target_size();
bool can_use_effects = target_size.x >= 8 && target_size.y >= 8; // FIXME I think this should check internal size, we do all our post processing at this size...
+ can_use_effects &= _debug_draw_can_use_effects(debug_draw);
bool can_use_storage = _render_buffers_can_be_storage();
bool use_fsr = fsr && can_use_effects && rb->get_scaling_3d_mode() == RS::VIEWPORT_SCALING_3D_MODE_FSR;
@@ -699,7 +700,7 @@ void RendererSceneRenderRD::_post_process_subpass(RID p_source_texture, RID p_fr
// FIXME: Our input it our internal_texture, shouldn't this be using internal_size ??
// Seeing we don't support FSR in our mobile renderer right now target_size = internal_size...
Size2i target_size = rb->get_target_size();
- bool can_use_effects = target_size.x >= 8 && target_size.y >= 8;
+ bool can_use_effects = target_size.x >= 8 && target_size.y >= 8 && debug_draw == RS::VIEWPORT_DEBUG_DRAW_DISABLED;
RD::DrawListID draw_list = RD::get_singleton()->draw_list_switch_to_next_pass();
@@ -764,6 +765,56 @@ void RendererSceneRenderRD::_disable_clear_request(const RenderDataRD *p_render_
texture_storage->render_target_disable_clear_request(p_render_data->render_buffers->get_render_target());
}
+bool RendererSceneRenderRD::_debug_draw_can_use_effects(RS::ViewportDebugDraw p_debug_draw) {
+ bool can_use_effects = true;
+ switch (p_debug_draw) {
+ // No debug draw, use camera effects
+ case RS::VIEWPORT_DEBUG_DRAW_DISABLED:
+ can_use_effects = true;
+ break;
+ // Modes that completely override rendering to draw debug information should disable camera effects.
+ case RS::VIEWPORT_DEBUG_DRAW_UNSHADED:
+ case RS::VIEWPORT_DEBUG_DRAW_OVERDRAW:
+ case RS::VIEWPORT_DEBUG_DRAW_WIREFRAME:
+ case RS::VIEWPORT_DEBUG_DRAW_VOXEL_GI_ALBEDO:
+ case RS::VIEWPORT_DEBUG_DRAW_CLUSTER_OMNI_LIGHTS:
+ case RS::VIEWPORT_DEBUG_DRAW_CLUSTER_SPOT_LIGHTS:
+ case RS::VIEWPORT_DEBUG_DRAW_CLUSTER_DECALS:
+ case RS::VIEWPORT_DEBUG_DRAW_CLUSTER_REFLECTION_PROBES:
+ case RS::VIEWPORT_DEBUG_DRAW_INTERNAL_BUFFER:
+ can_use_effects = false;
+ break;
+ // Modes that draws information over part of the viewport needs camera effects because we see partially the normal draw mode.
+ case RS::VIEWPORT_DEBUG_DRAW_SHADOW_ATLAS:
+ case RS::VIEWPORT_DEBUG_DRAW_DIRECTIONAL_SHADOW_ATLAS:
+ case RS::VIEWPORT_DEBUG_DRAW_DECAL_ATLAS:
+ case RS::VIEWPORT_DEBUG_DRAW_MOTION_VECTORS:
+ // Modes that draws a buffer over viewport needs camera effects because if the buffer is not available it will be equivalent to normal draw mode.
+ case RS::VIEWPORT_DEBUG_DRAW_NORMAL_BUFFER:
+ case RS::VIEWPORT_DEBUG_DRAW_SSAO:
+ case RS::VIEWPORT_DEBUG_DRAW_SSIL:
+ case RS::VIEWPORT_DEBUG_DRAW_SDFGI:
+ case RS::VIEWPORT_DEBUG_DRAW_GI_BUFFER:
+ case RS::VIEWPORT_DEBUG_DRAW_OCCLUDERS:
+ can_use_effects = true;
+ break;
+ // Other debug draw modes keep camera effects.
+ case RS::VIEWPORT_DEBUG_DRAW_LIGHTING:
+ case RS::VIEWPORT_DEBUG_DRAW_VOXEL_GI_LIGHTING:
+ case RS::VIEWPORT_DEBUG_DRAW_VOXEL_GI_EMISSION:
+ case RS::VIEWPORT_DEBUG_DRAW_SCENE_LUMINANCE:
+ case RS::VIEWPORT_DEBUG_DRAW_PSSM_SPLITS:
+ case RS::VIEWPORT_DEBUG_DRAW_SDFGI_PROBES:
+ case RS::VIEWPORT_DEBUG_DRAW_DISABLE_LOD:
+ can_use_effects = true;
+ break;
+ default:
+ break;
+ }
+
+ return can_use_effects;
+}
+
void RendererSceneRenderRD::_render_buffers_debug_draw(const RenderDataRD *p_render_data) {
RendererRD::LightStorage *light_storage = RendererRD::LightStorage::get_singleton();
RendererRD::TextureStorage *texture_storage = RendererRD::TextureStorage::get_singleton();
diff --git a/servers/rendering/renderer_rd/renderer_scene_render_rd.h b/servers/rendering/renderer_rd/renderer_scene_render_rd.h
index 5c5f11aba6..a8e8e638cd 100644
--- a/servers/rendering/renderer_rd/renderer_scene_render_rd.h
+++ b/servers/rendering/renderer_rd/renderer_scene_render_rd.h
@@ -117,6 +117,7 @@ protected:
RendererRD::GI gi;
virtual void _update_shader_quality_settings() {}
+ static bool _debug_draw_can_use_effects(RS::ViewportDebugDraw p_debug_draw);
private:
RS::ViewportDebugDraw debug_draw = RS::VIEWPORT_DEBUG_DRAW_DISABLED;