From baaa7503c7e0c83c94edf651ac31f03e0ceddac0 Mon Sep 17 00:00:00 2001 From: Hugo Locurcio Date: Fri, 10 Jun 2022 12:47:06 +0200 Subject: Add a shadow opacity property to Light3D This can be used to make shadows translucent for a specific light. The light distance fade system also uses this to smoothly fade the shadow when the light fade transition distance is greater than 0. --- doc/classes/Light3D.xml | 18 ++++++++++++------ doc/classes/RenderingServer.xml | 12 ++++++++---- 2 files changed, 20 insertions(+), 10 deletions(-) (limited to 'doc') diff --git a/doc/classes/Light3D.xml b/doc/classes/Light3D.xml index 0ebd83c882..46c3e57547 100644 --- a/doc/classes/Light3D.xml +++ b/doc/classes/Light3D.xml @@ -37,13 +37,12 @@ [b]Note:[/b] Only effective for [OmniLight3D] and [SpotLight3D]. - Distance over which the light fades. The light's energy is progressively reduced over this distance and is completely invisible at the end. + Distance over which the light and its shadow fades. The light's energy and shadow's opacity is progressively reduced over this distance and is completely invisible at the end. [b]Note:[/b] Only effective for [OmniLight3D] and [SpotLight3D]. The distance from the camera at which the light's shadow cuts off (in 3D units). Set this to a value lower than [member distance_fade_begin] + [member distance_fade_length] to further improve performance, as shadow rendering is often more expensive than light rendering itself. [b]Note:[/b] Only effective for [OmniLight3D] and [SpotLight3D], and only when [member shadow_enabled] is [code]true[/code]. - [b]Note:[/b] Due to a rendering engine limitation, shadows will be disabled instantly instead of fading smoothly according to [member distance_fade_length]. This may result in visible pop-in depending on the scene topography. If [code]true[/code], the light only appears in the editor and will not be visible at runtime. @@ -95,6 +94,9 @@ 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. + + The opacity to use when rendering the light's shadow map. 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. + If [code]true[/code], reverses the backface culling of the mesh. This can be useful when you have a flat mesh that has a light behind it. If you need to cast a shadow on both sides of the mesh, set the mesh to use double-sided shadows with [constant GeometryInstance3D.SHADOW_CASTING_SETTING_DOUBLE_SIDED]. @@ -150,15 +152,19 @@ 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]. - + Represents the size of the [enum Param] enum. diff --git a/doc/classes/RenderingServer.xml b/doc/classes/RenderingServer.xml index 1b58b50bc7..c06b2e1d98 100644 --- a/doc/classes/RenderingServer.xml +++ b/doc/classes/RenderingServer.xml @@ -3777,6 +3777,7 @@ The light's energy. + The light's indirect energy multiplier (final indirect energy is [constant LIGHT_PARAM_ENERGY] * [constant LIGHT_PARAM_INDIRECT_ENERGY]). The light's influence on specularity. @@ -3820,14 +3821,17 @@ 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. - + - + - + Represents the size of the [enum LightParam] enum. -- cgit v1.2.3