From 09bedcead445d1f628d628efe6703570b84fe1d1 Mon Sep 17 00:00:00 2001 From: Hugo Locurcio Date: Fri, 9 Jul 2021 10:28:33 +0200 Subject: Add a per-light volumetric fog energy property Per-light energy gives more control to the user on the final result of volumetric fog. Specific lights can be fully excluded from volumetric fog by setting their volumetric fog energy to 0, which improves performance slightly. This can also be used to prevent short-lived dynamic effects from poorly interacting with volumetric fog, as it's updated over several frames by default unless temporal reprojection is disabled. Volumetric fog shadows now obey Light3D's Shadow Opacity property as well. The shadow fog fade property was removed as it had little visible impact on the final scene's rendering. --- doc/classes/Light3D.xml | 44 +++++++++++++++++++++-------------------- doc/classes/RenderingServer.xml | 39 ++++++++++++++++++------------------ 2 files changed, 43 insertions(+), 40 deletions(-) (limited to 'doc/classes') diff --git a/doc/classes/Light3D.xml b/doc/classes/Light3D.xml index 80ff83ec46..cc8484d9fa 100644 --- a/doc/classes/Light3D.xml +++ b/doc/classes/Light3D.xml @@ -80,6 +80,10 @@ The intensity of the specular blob in objects affected by the light. At [code]0[/code], the light becomes a pure diffuse light. When not baking emission, this can be used to avoid unrealistic reflections when placing lights above an emissive surface. + + Secondary multiplier multiplied with [member light_energy] then used with the [Environment]'s volumetric fog (if enabled). If set to [code]0.0[/code], computing volumetric fog will be skipped for this light, which can improve performance for large amounts of lights when volumetric fog is enabled. + [b]Note:[/b] To prevent short-lived dynamic light effects from poorly interacting with volumetric fog, lights used in those effects should have [member light_volumetric_fog_energy] set to [code]0.0[/code] unless [member Environment.volumetric_fog_temporal_reprojection_enabled] is disabled (or unless the reprojection amount is significantly lowered). + Used to adjust shadow appearance. Too small a value results in self-shadowing ("shadow acne"), while too large a value causes shadows to separate from casters ("peter-panning"). Adjust as needed. @@ -89,8 +93,6 @@ If [code]true[/code], the light will cast real-time shadows. This has a significant performance cost. Only enable shadow rendering when it makes a noticeable difference in the scene's appearance, and consider using [member distance_fade_enabled] to hide the light when far away from the [Camera3D]. - - Offsets the lookup into the shadow map by the object's normal. This can be used to reduce self-shadowing artifacts without using [member shadow_bias]. In practice, this value should be tweaked along with [member shadow_bias] to reduce artifacts as much as possible. @@ -110,57 +112,57 @@ Constant for accessing [member light_indirect_energy]. - + + Constant for accessing [member light_volumetric_fog_energy]. + + Constant for accessing [member light_specular]. - + Constant for accessing [member OmniLight3D.omni_range] or [member SpotLight3D.spot_range]. - + Constant for accessing [member light_size]. - + Constant for accessing [member OmniLight3D.omni_attenuation] or [member SpotLight3D.spot_attenuation]. - + Constant for accessing [member SpotLight3D.spot_angle]. - + Constant for accessing [member SpotLight3D.spot_angle_attenuation]. - + Constant for accessing [member DirectionalLight3D.directional_shadow_max_distance]. - + Constant for accessing [member DirectionalLight3D.directional_shadow_split_1]. - + Constant for accessing [member DirectionalLight3D.directional_shadow_split_2]. - + Constant for accessing [member DirectionalLight3D.directional_shadow_split_3]. - + Constant for accessing [member DirectionalLight3D.directional_shadow_fade_start]. - + Constant for accessing [member shadow_normal_bias]. - + Constant for accessing [member shadow_bias]. - + Constant for accessing [member DirectionalLight3D.directional_shadow_pancake_size]. - + Constant for accessing [member shadow_opacity]. - + Constant for accessing [member shadow_blur]. - - Constant for accessing [member shadow_fog_fade]. - Constant for accessing [member shadow_transmittance_bias]. diff --git a/doc/classes/RenderingServer.xml b/doc/classes/RenderingServer.xml index 755e8a5839..310e2334fb 100644 --- a/doc/classes/RenderingServer.xml +++ b/doc/classes/RenderingServer.xml @@ -3792,61 +3792,62 @@ Is a spot light. - The light's energy. + The light's energy multiplier. The light's indirect energy multiplier (final indirect energy is [constant LIGHT_PARAM_ENERGY] * [constant LIGHT_PARAM_INDIRECT_ENERGY]). - + + The light's volumetric fog energy multiplier (final volumetric fog energy is [constant LIGHT_PARAM_ENERGY] * [constant LIGHT_PARAM_VOLUMETRIC_FOG_ENERGY]). + + The light's influence on specularity. - + The light's range. - + The size of the light when using spot light or omni light. The angular size of the light when using directional light. - + The light's attenuation. - + The spotlight's angle. - + The spotlight's attenuation. - + Max distance that shadows will be rendered. - + Proportion of shadow atlas occupied by the first split. - + Proportion of shadow atlas occupied by the second split. - + Proportion of shadow atlas occupied by the third split. The fourth split occupies the rest. - + Proportion of shadow max distance where the shadow will start to fade out. - + Normal bias used to offset shadow lookup by object normal. Can be used to fix self-shadowing artifacts. - + Bias the shadow lookup to fix self-shadowing artifacts. - + Sets the size of the directional shadow pancake. The pancake offsets the start of the shadow's camera frustum to provide a higher effective depth resolution for the shadow. However, a high pancake size can cause artifacts in the shadows of large objects that are close to the edge of the frustum. Reducing the pancake size can help. Setting the size to [code]0[/code] turns off the pancaking effect. - + The light's shadow opacity. Values lower than [code]1.0[/code] make the light appear through shadows. This can be used to fake global illumination at a low performance cost. - + Blurs the edges of the shadow. Can be used to hide pixel artifacts in low resolution shadow maps. A high value can make shadows appear grainy and can cause other unwanted artifacts. Try to keep as near default as possible. - - -- cgit v1.2.3