summaryrefslogtreecommitdiff
path: root/servers
diff options
context:
space:
mode:
authorHugo Locurcio <hugo.locurcio@hugo.pro>2021-05-23 19:10:26 +0200
committerHugo Locurcio <hugo.locurcio@hugo.pro>2022-02-06 15:28:59 +0100
commit7721e19ccc8d71d0bacb7b57499853a6a3291ffa (patch)
treef7fc533f7f0ba39c179607d2642a69372613bb92 /servers
parentfd0d2dcabf5b7418691b693cd01baecbb69fdeb9 (diff)
Tweak default SDFGI settings for better quality
- Enable Read Sky Light to get proper outdoors lighting out of the box. - Set bounce feedback to 0.5 by default to get a better quality result. - Higher values may cause infinite feedback with bright surfaces. - Increase the number of frames to converge to improve quality at the cost of latency. Most scenes are fairly static after all. - Use 75% Y scale by default as most scenes are not highly vertical. - Reorder the Y scale enum to go from the lowest Y scale to the highest. Also rename the "Disabled" setting to "100%" for clarity.
Diffstat (limited to 'servers')
-rw-r--r--servers/rendering/renderer_rd/renderer_scene_environment_rd.h6
-rw-r--r--servers/rendering/renderer_rd/renderer_scene_gi_rd.cpp2
-rw-r--r--servers/rendering/renderer_rd/renderer_scene_gi_rd.h8
-rw-r--r--servers/rendering_server.cpp6
-rw-r--r--servers/rendering_server.h4
5 files changed, 13 insertions, 13 deletions
diff --git a/servers/rendering/renderer_rd/renderer_scene_environment_rd.h b/servers/rendering/renderer_rd/renderer_scene_environment_rd.h
index ed26fd467b..db7dd6b63c 100644
--- a/servers/rendering/renderer_rd/renderer_scene_environment_rd.h
+++ b/servers/rendering/renderer_rd/renderer_scene_environment_rd.h
@@ -138,12 +138,12 @@ public:
int sdfgi_cascades = 6;
float sdfgi_min_cell_size = 0.2;
bool sdfgi_use_occlusion = false;
- float sdfgi_bounce_feedback = 0.0;
- bool sdfgi_read_sky_light = false;
+ float sdfgi_bounce_feedback = 0.5;
+ bool sdfgi_read_sky_light = true;
float sdfgi_energy = 1.0;
float sdfgi_normal_bias = 1.1;
float sdfgi_probe_bias = 1.1;
- RS::EnvironmentSDFGIYScale sdfgi_y_scale = RS::ENV_SDFGI_Y_SCALE_DISABLED;
+ RS::EnvironmentSDFGIYScale sdfgi_y_scale = RS::ENV_SDFGI_Y_SCALE_75_PERCENT;
/// Adjustments
diff --git a/servers/rendering/renderer_rd/renderer_scene_gi_rd.cpp b/servers/rendering/renderer_rd/renderer_scene_gi_rd.cpp
index 3069b1c379..cb07c75db4 100644
--- a/servers/rendering/renderer_rd/renderer_scene_gi_rd.cpp
+++ b/servers/rendering/renderer_rd/renderer_scene_gi_rd.cpp
@@ -46,7 +46,7 @@ void RendererSceneGIRD::SDFGI::create(RendererSceneEnvironmentRD *p_env, const V
min_cell_size = p_env->sdfgi_min_cell_size;
uses_occlusion = p_env->sdfgi_use_occlusion;
y_scale_mode = p_env->sdfgi_y_scale;
- static const float y_scale[3] = { 1.0, 1.5, 2.0 };
+ static const float y_scale[3] = { 2.0, 1.5, 1.0 };
y_mult = y_scale[y_scale_mode];
cascades.resize(num_cascades);
probe_axis_count = SDFGI::PROBE_DIVISOR + 1;
diff --git a/servers/rendering/renderer_rd/renderer_scene_gi_rd.h b/servers/rendering/renderer_rd/renderer_scene_gi_rd.h
index 5e55262798..d8a64bc672 100644
--- a/servers/rendering/renderer_rd/renderer_scene_gi_rd.h
+++ b/servers/rendering/renderer_rd/renderer_scene_gi_rd.h
@@ -504,12 +504,12 @@ public:
RID cascades_ubo;
bool uses_occlusion = false;
- float bounce_feedback = 0.0;
- bool reads_sky = false;
+ float bounce_feedback = 0.5;
+ bool reads_sky = true;
float energy = 1.0;
float normal_bias = 1.1;
float probe_bias = 1.1;
- RS::EnvironmentSDFGIYScale y_scale_mode = RS::ENV_SDFGI_Y_SCALE_DISABLED;
+ RS::EnvironmentSDFGIYScale y_scale_mode = RS::ENV_SDFGI_Y_SCALE_75_PERCENT;
float y_mult = 1.0;
@@ -536,7 +536,7 @@ public:
};
RS::EnvironmentSDFGIRayCount sdfgi_ray_count = RS::ENV_SDFGI_RAY_COUNT_16;
- RS::EnvironmentSDFGIFramesToConverge sdfgi_frames_to_converge = RS::ENV_SDFGI_CONVERGE_IN_10_FRAMES;
+ RS::EnvironmentSDFGIFramesToConverge sdfgi_frames_to_converge = RS::ENV_SDFGI_CONVERGE_IN_30_FRAMES;
RS::EnvironmentSDFGIFramesToUpdateLight sdfgi_frames_to_update_light = RS::ENV_SDFGI_UPDATE_LIGHT_IN_4_FRAMES;
float sdfgi_solid_cell_ratio = 0.25;
diff --git a/servers/rendering_server.cpp b/servers/rendering_server.cpp
index 584abbc351..901e073089 100644
--- a/servers/rendering_server.cpp
+++ b/servers/rendering_server.cpp
@@ -2388,9 +2388,9 @@ void RenderingServer::_bind_methods() {
BIND_ENUM_CONSTANT(ENV_SSIL_QUALITY_HIGH);
BIND_ENUM_CONSTANT(ENV_SSIL_QUALITY_ULTRA);
- BIND_ENUM_CONSTANT(ENV_SDFGI_Y_SCALE_DISABLED);
- BIND_ENUM_CONSTANT(ENV_SDFGI_Y_SCALE_75_PERCENT);
BIND_ENUM_CONSTANT(ENV_SDFGI_Y_SCALE_50_PERCENT);
+ BIND_ENUM_CONSTANT(ENV_SDFGI_Y_SCALE_75_PERCENT);
+ BIND_ENUM_CONSTANT(ENV_SDFGI_Y_SCALE_100_PERCENT);
BIND_ENUM_CONSTANT(ENV_SDFGI_RAY_COUNT_4);
BIND_ENUM_CONSTANT(ENV_SDFGI_RAY_COUNT_8);
@@ -2979,7 +2979,7 @@ RenderingServer::RenderingServer() {
GLOBAL_DEF("rendering/global_illumination/sdfgi/probe_ray_count", 1);
ProjectSettings::get_singleton()->set_custom_property_info("rendering/global_illumination/sdfgi/probe_ray_count", PropertyInfo(Variant::INT, "rendering/global_illumination/sdfgi/probe_ray_count", PROPERTY_HINT_ENUM, "8 (Fastest),16,32,64,96,128 (Slowest)"));
- GLOBAL_DEF("rendering/global_illumination/sdfgi/frames_to_converge", 4);
+ GLOBAL_DEF("rendering/global_illumination/sdfgi/frames_to_converge", 5);
ProjectSettings::get_singleton()->set_custom_property_info("rendering/global_illumination/sdfgi/frames_to_converge", PropertyInfo(Variant::INT, "rendering/global_illumination/sdfgi/frames_to_converge", PROPERTY_HINT_ENUM, "5 (Less Latency but Lower Quality),10,15,20,25,30 (More Latency but Higher Quality)"));
GLOBAL_DEF("rendering/global_illumination/sdfgi/frames_to_update_lights", 2);
ProjectSettings::get_singleton()->set_custom_property_info("rendering/global_illumination/sdfgi/frames_to_update_lights", PropertyInfo(Variant::INT, "rendering/global_illumination/sdfgi/frames_to_update_lights", PROPERTY_HINT_ENUM, "1 (Slower),2,4,8,16 (Faster)"));
diff --git a/servers/rendering_server.h b/servers/rendering_server.h
index 472fff1bf1..ae07042638 100644
--- a/servers/rendering_server.h
+++ b/servers/rendering_server.h
@@ -1042,9 +1042,9 @@ public:
virtual void environment_set_ssil_quality(EnvironmentSSILQuality p_quality, bool p_half_size, float p_adaptive_target, int p_blur_passes, float p_fadeout_from, float p_fadeout_to) = 0;
enum EnvironmentSDFGIYScale {
- ENV_SDFGI_Y_SCALE_DISABLED,
+ ENV_SDFGI_Y_SCALE_50_PERCENT,
ENV_SDFGI_Y_SCALE_75_PERCENT,
- ENV_SDFGI_Y_SCALE_50_PERCENT
+ ENV_SDFGI_Y_SCALE_100_PERCENT,
};
virtual void environment_set_sdfgi(RID p_env, bool p_enable, int p_cascades, float p_min_cell_size, EnvironmentSDFGIYScale p_y_scale, bool p_use_occlusion, float p_bounce_feedback, bool p_read_sky, float p_energy, float p_normal_bias, float p_probe_bias) = 0;