Refactored shadowmapping.
- Made shadow bias size independent, so it will remain when changing light or camera size. - Implemented normal offset bias, which greatly enhances quality. - Added transmission to subsurface scattering - Reimplemented shadow filter modes Closes #17260
This commit is contained in:
parent
b2f79cac9a
commit
4ffc0d6b3f
34 changed files with 1032 additions and 291 deletions
|
|
@ -1478,6 +1478,8 @@ void EditorInspector::update_tree() {
|
|||
String filter = search_box ? search_box->get_text() : "";
|
||||
String group;
|
||||
String group_base;
|
||||
String subgroup;
|
||||
String subgroup_base;
|
||||
VBoxContainer *category_vbox = nullptr;
|
||||
|
||||
List<PropertyInfo>
|
||||
|
|
@ -1503,10 +1505,19 @@ void EditorInspector::update_tree() {
|
|||
|
||||
//make sure the property can be edited
|
||||
|
||||
if (p.usage & PROPERTY_USAGE_GROUP) {
|
||||
if (p.usage & PROPERTY_USAGE_SUBGROUP) {
|
||||
|
||||
subgroup = p.name;
|
||||
subgroup_base = p.hint_string;
|
||||
|
||||
continue;
|
||||
|
||||
} else if (p.usage & PROPERTY_USAGE_GROUP) {
|
||||
|
||||
group = p.name;
|
||||
group_base = p.hint_string;
|
||||
subgroup = "";
|
||||
subgroup_base = "";
|
||||
|
||||
continue;
|
||||
|
||||
|
|
@ -1514,6 +1525,8 @@ void EditorInspector::update_tree() {
|
|||
|
||||
group = "";
|
||||
group_base = "";
|
||||
subgroup = "";
|
||||
subgroup_base = "";
|
||||
|
||||
if (!show_categories)
|
||||
continue;
|
||||
|
|
@ -1577,18 +1590,33 @@ void EditorInspector::update_tree() {
|
|||
}
|
||||
|
||||
String basename = p.name;
|
||||
|
||||
if (subgroup != "") {
|
||||
if (subgroup_base != "") {
|
||||
if (basename.begins_with(subgroup_base)) {
|
||||
basename = basename.replace_first(subgroup_base, "");
|
||||
} else if (subgroup_base.begins_with(basename)) {
|
||||
//keep it, this is used pretty often
|
||||
} else {
|
||||
subgroup = ""; //no longer using subgroup base, clear
|
||||
}
|
||||
}
|
||||
}
|
||||
if (group != "") {
|
||||
if (group_base != "") {
|
||||
if (group_base != "" && subgroup == "") {
|
||||
if (basename.begins_with(group_base)) {
|
||||
basename = basename.replace_first(group_base, "");
|
||||
} else if (group_base.begins_with(basename)) {
|
||||
//keep it, this is used pretty often
|
||||
} else {
|
||||
group = ""; //no longer using group base, clear
|
||||
subgroup = "";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (subgroup != "") {
|
||||
basename = subgroup + "/" + basename;
|
||||
}
|
||||
if (group != "") {
|
||||
basename = group + "/" + basename;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -374,6 +374,8 @@ void EditorNode::_notification(int p_what) {
|
|||
float sss_scale = GLOBAL_GET("rendering/quality/subsurface_scattering/subsurface_scattering_scale");
|
||||
float sss_depth_scale = GLOBAL_GET("rendering/quality/subsurface_scattering/subsurface_scattering_depth_scale");
|
||||
RS::get_singleton()->sub_surface_scattering_set_scale(sss_scale, sss_depth_scale);
|
||||
RS::ShadowFilter shadow_filter = RS::ShadowFilter(int(GLOBAL_GET("rendering/quality/shadows/filter_mode")));
|
||||
RS::get_singleton()->shadow_filter_set(shadow_filter);
|
||||
}
|
||||
|
||||
ResourceImporterTexture::get_singleton()->update_imports();
|
||||
|
|
|
|||
|
|
@ -3000,6 +3000,7 @@ void Node3DEditorViewport::_menu_option(int p_option) {
|
|||
case VIEW_DISPLAY_DEBUG_GIPROBE_EMISSION:
|
||||
case VIEW_DISPLAY_DEBUG_SCENE_LUMINANCE:
|
||||
case VIEW_DISPLAY_DEBUG_SSAO:
|
||||
case VIEW_DISPLAY_DEBUG_PSSM_SPLITS:
|
||||
case VIEW_DISPLAY_DEBUG_ROUGHNESS_LIMITER: {
|
||||
|
||||
static const int display_options[] = {
|
||||
|
|
@ -3018,6 +3019,7 @@ void Node3DEditorViewport::_menu_option(int p_option) {
|
|||
VIEW_DISPLAY_DEBUG_SCENE_LUMINANCE,
|
||||
VIEW_DISPLAY_DEBUG_SSAO,
|
||||
VIEW_DISPLAY_DEBUG_ROUGHNESS_LIMITER,
|
||||
VIEW_DISPLAY_DEBUG_PSSM_SPLITS,
|
||||
VIEW_MAX
|
||||
};
|
||||
static const Viewport::DebugDraw debug_draw_modes[] = {
|
||||
|
|
@ -3036,6 +3038,7 @@ void Node3DEditorViewport::_menu_option(int p_option) {
|
|||
Viewport::DEBUG_DRAW_SCENE_LUMINANCE,
|
||||
Viewport::DEBUG_DRAW_SSAO,
|
||||
Viewport::DEBUG_DRAW_ROUGHNESS_LIMITER,
|
||||
Viewport::DEBUG_DRAW_PSSM_SPLITS,
|
||||
};
|
||||
|
||||
int idx = 0;
|
||||
|
|
@ -3887,6 +3890,8 @@ Node3DEditorViewport::Node3DEditorViewport(Node3DEditor *p_spatial_editor, Edito
|
|||
view_menu->get_popup()->add_radio_check_shortcut(ED_SHORTCUT("spatial_editor/view_display_lighting", TTR("Display Lighting")), VIEW_DISPLAY_LIGHTING);
|
||||
view_menu->get_popup()->add_radio_check_shortcut(ED_SHORTCUT("spatial_editor/view_display_unshaded", TTR("Display Unshaded")), VIEW_DISPLAY_SHADELESS);
|
||||
view_menu->get_popup()->set_item_checked(view_menu->get_popup()->get_item_index(VIEW_DISPLAY_NORMAL), true);
|
||||
display_submenu->add_radio_check_item(TTR("Directional Shadow Splits"), VIEW_DISPLAY_DEBUG_PSSM_SPLITS);
|
||||
display_submenu->add_separator();
|
||||
display_submenu->add_radio_check_item(TTR("Normal Buffer"), VIEW_DISPLAY_NORMAL_BUFFER);
|
||||
display_submenu->add_separator();
|
||||
display_submenu->add_radio_check_item(TTR("Shadow Atlas"), VIEW_DISPLAY_DEBUG_SHADOW_ATLAS);
|
||||
|
|
|
|||
|
|
@ -218,6 +218,7 @@ class Node3DEditorViewport : public Control {
|
|||
VIEW_DISPLAY_DEBUG_SCENE_LUMINANCE,
|
||||
VIEW_DISPLAY_DEBUG_SSAO,
|
||||
VIEW_DISPLAY_DEBUG_ROUGHNESS_LIMITER,
|
||||
VIEW_DISPLAY_DEBUG_PSSM_SPLITS,
|
||||
VIEW_LOCK_ROTATION,
|
||||
VIEW_CINEMATIC_PREVIEW,
|
||||
VIEW_AUTO_ORTHOGONAL,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue