diff options
author | Rémi Verschelde <rverschelde@gmail.com> | 2022-09-19 09:23:24 +0200 |
---|---|---|
committer | Rémi Verschelde <rverschelde@gmail.com> | 2022-09-19 09:23:24 +0200 |
commit | 49891e4c2fc0b783e9b81e9e600a805d319f4088 (patch) | |
tree | 1fb947443409169e84526928903927ce4db7e424 | |
parent | 956ea15e8159d69f86f99641e49aee2baa8e11c9 (diff) | |
parent | 2ecc8b9a73e48507da9eab0850f38f03d9908929 (diff) |
Merge pull request #65915 from clayjohn/VULKAN-mobile-fog
Restore fog in vulkan mobile renderer.
-rw-r--r-- | doc/classes/Environment.xml | 1 | ||||
-rw-r--r-- | servers/rendering/renderer_rd/forward_mobile/render_forward_mobile.cpp | 2 |
2 files changed, 2 insertions, 1 deletions
diff --git a/doc/classes/Environment.xml b/doc/classes/Environment.xml index 34a639d2de..243a28e73d 100644 --- a/doc/classes/Environment.xml +++ b/doc/classes/Environment.xml @@ -313,6 +313,7 @@ </member> <member name="volumetric_fog_enabled" type="bool" setter="set_volumetric_fog_enabled" getter="is_volumetric_fog_enabled" default="false"> 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. </member> <member name="volumetric_fog_gi_inject" type="float" setter="set_volumetric_fog_gi_inject" getter="get_volumetric_fog_gi_inject" default="1.0"> Scales the strength of Global Illumination used in the volumetric fog's albedo color. A value of [code]0.0[/code] means that Global Illumination will not impact the volumetric fog. [member volumetric_fog_gi_inject] has a small performance cost when set above [code]0.0[/code]. 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 a6512497a3..bea31dc927 100644 --- a/servers/rendering/renderer_rd/forward_mobile/render_forward_mobile.cpp +++ b/servers/rendering/renderer_rd/forward_mobile/render_forward_mobile.cpp @@ -729,7 +729,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; } } |