From bc1b2b96e1e10d5d44d5d3357fb733279b76a609 Mon Sep 17 00:00:00 2001 From: Hugo Locurcio Date: Tue, 27 Aug 2019 18:21:16 +0200 Subject: [PATCH] Tweak the default fog depth end to use a fixed value The previous value (0) was a special case in the fog shader. It made the shader use the Camera's `far` value as the fog depth end value, which led to an inconsistency in the fog rendering between the editor and a running project. This is because the editor camera uses a `far` property of 500 by default, whereas the Camera node's `far` property is set to 100 by default. The new fixed value is equal to the default `far` property in Camera, which leads to a consistent appearance between the editor and a running project. This closes #31686. --- doc/classes/Environment.xml | 5 +++-- scene/resources/environment.cpp | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/doc/classes/Environment.xml b/doc/classes/Environment.xml index 86c10026665..fcbd8a21934 100644 --- a/doc/classes/Environment.xml +++ b/doc/classes/Environment.xml @@ -146,10 +146,11 @@ Enables the fog depth. - + + Fog's depth end distance from the camera. If this value is set to 0, it will be equal to the current camera's [member Camera.far] value. - Enables the fog. Needs fog_height_enabled and/or for_depth_enabled to actually display fog. + Enables the fog. Needs [member fog_height_enabled] and/or [member fog_depth_enabled] to actually display fog. Value defining the fog height intensity. diff --git a/scene/resources/environment.cpp b/scene/resources/environment.cpp index 0f0974114f9..afb7f1102b4 100644 --- a/scene/resources/environment.cpp +++ b/scene/resources/environment.cpp @@ -1399,7 +1399,7 @@ Environment::Environment() : fog_depth_enabled = true; fog_depth_begin = 10; - fog_depth_end = 0; + fog_depth_end = 100; fog_depth_curve = 1; fog_transmit_enabled = false;