From e35e79b8025d1c35f5b8d0f891ccd6fd53f2d4c6 Mon Sep 17 00:00:00 2001 From: Hugo Locurcio Date: Wed, 24 Nov 2021 01:25:59 +0100 Subject: [PATCH] Tweak default fog settings for better appearance - Increase the default non-volumetric fog density to 0.01 to make adjustments more visible. - Use a less saturated non-volumetric fog color by default (a mix of the sky and horizon colors of the new default ProceduralSkyMaterial). - Set Volumetric Fog Gi Inject to 1.0 by default. Injecting GI results in more realistic appearance of volumetric fog, at a very low performance cost. --- doc/classes/Environment.xml | 9 +++++---- scene/resources/environment.h | 8 ++++---- servers/rendering/storage/environment_storage.h | 8 ++++---- 3 files changed, 13 insertions(+), 12 deletions(-) diff --git a/doc/classes/Environment.xml b/doc/classes/Environment.xml index 9da360915b9..f662a07825f 100644 --- a/doc/classes/Environment.xml +++ b/doc/classes/Environment.xml @@ -97,7 +97,7 @@ Blend factor between the fog's color and the color of the background [Sky]. Must have [member background_mode] set to [constant BG_SKY]. This is useful to simulate [url=https://en.wikipedia.org/wiki/Aerial_perspective]aerial perspective[/url] in large scenes with low density fog. However, it is not very useful for high-density fog, as the sky will shine through. When set to [code]1.0[/code], the fog color comes completely from the [Sky]. If set to [code]0.0[/code], aerial perspective is disabled. - + The exponential fog density to use. Higher values result in a more dense fog. @@ -109,7 +109,7 @@ The density used to increase fog as height decreases. To make fog increase as height increases, use a negative value. - + The fog's color. @@ -320,8 +320,9 @@ Enables the volumetric fog effect. Volumetric fog uses a screen-aligned froxel buffer to calculate accurate volumetric scattering in the short to medium range. Volumetric fog interacts with [FogVolume]s and lights to calculate localized and global fog. Volumetric fog uses a PBR single-scattering model based on extinction, scattering, and emission which it exposes to users as density, albedo, and emission. - - Scales the strength of Global Illumination used in the volumetric fog. A value of [code]0[/code] means that Global Illumination will not impact the volumetric fog. + + Scales the strength of Global Illumination used in the volumetric fog. A value of [code]0.0[/code] means that Global Illumination will not impact the volumetric fog. + [b]Note:[/b] Only [VoxelGI] and SDFGI ([member Environment.sdfgi_enabled]) are taken into account when using [member volumetric_fog_gi_inject]. Global illumination from [LightmapGI], [ReflectionProbe] and SSIL (see [member ssil_enabled]) will be ignored by volumetric fog. The distance over which the volumetric fog is computed. Increase to compute fog over a greater range, decrease to add more detail when a long range is not needed. For best quality fog, keep this as low as possible. diff --git a/scene/resources/environment.h b/scene/resources/environment.h index b71fe8904ab..385d815230b 100644 --- a/scene/resources/environment.h +++ b/scene/resources/environment.h @@ -175,10 +175,10 @@ private: // Fog bool fog_enabled = false; - Color fog_light_color = Color(0.5, 0.6, 0.7); + Color fog_light_color = Color(0.518, 0.553, 0.608); float fog_light_energy = 1.0; float fog_sun_scatter = 0.0; - float fog_density = 0.001; + float fog_density = 0.01; float fog_height = 0.0; float fog_height_density = 0.0; //can be negative to invert effect float fog_aerial_perspective = 0.0; @@ -194,8 +194,8 @@ private: float volumetric_fog_anisotropy = 0.2; float volumetric_fog_length = 64.0; float volumetric_fog_detail_spread = 2.0; - float volumetric_fog_gi_inject = 0.0; - float volumetric_fog_ambient_inject = false; + float volumetric_fog_gi_inject = 1.0; + float volumetric_fog_ambient_inject = 0.0; bool volumetric_fog_temporal_reproject = true; float volumetric_fog_temporal_reproject_amount = 0.9; void _update_volumetric_fog(); diff --git a/servers/rendering/storage/environment_storage.h b/servers/rendering/storage/environment_storage.h index bd1c17deec4..29bba86930a 100644 --- a/servers/rendering/storage/environment_storage.h +++ b/servers/rendering/storage/environment_storage.h @@ -67,10 +67,10 @@ private: // Fog bool fog_enabled = false; - Color fog_light_color = Color(0.5, 0.6, 0.7); + Color fog_light_color = Color(0.518, 0.553, 0.608); float fog_light_energy = 1.0; float fog_sun_scatter = 0.0; - float fog_density = 0.001; + float fog_density = 0.01; float fog_height = 0.0; float fog_height_density = 0.0; //can be negative to invert effect float fog_aerial_perspective = 0.0; @@ -84,10 +84,10 @@ private: float volumetric_fog_anisotropy = 0.2; float volumetric_fog_length = 64.0; float volumetric_fog_detail_spread = 2.0; - float volumetric_fog_gi_inject = 0.0; + float volumetric_fog_gi_inject = 1.0; + float volumetric_fog_ambient_inject = 0.0; bool volumetric_fog_temporal_reprojection = true; float volumetric_fog_temporal_reprojection_amount = 0.9; - float volumetric_fog_ambient_inject = 0.0; // Glow bool glow_enabled = false;