From 2ecc8b9a73e48507da9eab0850f38f03d9908929 Mon Sep 17 00:00:00 2001 From: clayjohn Date: Fri, 16 Sep 2022 09:16:10 -0700 Subject: Restore fog in vulkan mobile renderer. The condition accidentally disabled fog whenever it was enabled --- doc/classes/Environment.xml | 1 + servers/rendering/renderer_rd/forward_mobile/render_forward_mobile.cpp | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/doc/classes/Environment.xml b/doc/classes/Environment.xml index 695f2cbc66..e0863ae329 100644 --- a/doc/classes/Environment.xml +++ b/doc/classes/Environment.xml @@ -311,6 +311,7 @@ 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. + [b]Note:[/b] Volumetric fog is only available in the forward plus renderer. It is not available in the mobile renderer or the compatibility renderer. 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. diff --git a/servers/rendering/renderer_rd/forward_mobile/render_forward_mobile.cpp b/servers/rendering/renderer_rd/forward_mobile/render_forward_mobile.cpp index 46d90e75fb..0efa5ceba6 100644 --- a/servers/rendering/renderer_rd/forward_mobile/render_forward_mobile.cpp +++ b/servers/rendering/renderer_rd/forward_mobile/render_forward_mobile.cpp @@ -719,7 +719,7 @@ void RenderForwardMobile::_render_scene(RenderDataRD *p_render_data, const Color spec_constant_base_flags |= 1 << SPEC_CONSTANT_DISABLE_DIRECTIONAL_LIGHTS; } - if (!is_environment(p_render_data->environment) || environment_get_fog_enabled(p_render_data->environment)) { + if (!is_environment(p_render_data->environment) || !environment_get_fog_enabled(p_render_data->environment)) { spec_constant_base_flags |= 1 << SPEC_CONSTANT_DISABLE_FOG; } } -- cgit v1.2.3