mirror of
https://github.com/godotengine/godot-docs.git
synced 2026-01-07 02:12:07 +03:00
Add recommendations for 3D light shadow bias (#5340)
* Add recommendations for 3D light shadow bias These are the settings I usually recommend based on my personal experience.
This commit is contained in:
@@ -52,19 +52,40 @@ There is a list of generic shadow parameters, each also has a specific function:
|
||||
- **Color**: Areas occluded are multiplied by this color. It is black by default, but it can be changed to tint shadows.
|
||||
- **Bias**: When this parameter is too small, self shadowing occurs. When too large, shadows separate from the casters. Tweak to what works best for you.
|
||||
- **Contact**: Performs a short screen-space raycast to reduce the gap generated by the bias. Contact shadows are only available when using the GLES3 backend.
|
||||
- **Reverse Cull Faces**: Some scenes work better when shadow mapping is rendered with face-culling inverted.
|
||||
- **Reverse Cull Face**: Some scenes work better when shadow mapping is rendered with face-culling inverted.
|
||||
|
||||
Below is an image of what tweaking bias looks like. Default values work for most
|
||||
cases, but in general it depends on the size and complexity of geometry.
|
||||
|
||||
.. image:: img/shadow_bias.png
|
||||
|
||||
Finally, if gaps can't be solved, the **Contact** option can help:
|
||||
Finally, if gaps can't be solved, the **Contact** option can help (at a performance cost):
|
||||
|
||||
.. image:: img/shadow_contact.png
|
||||
|
||||
Any sort of bias issues can always be fixed by increasing the shadow map resolution,
|
||||
although that may lead to decreased performance on low-end hardware.
|
||||
although that may lead to decreased performance.
|
||||
|
||||
.. tip::
|
||||
|
||||
If shadow biasing is a problem in your scene, the following settings are a good starting point:
|
||||
|
||||
- Enable **Reverse Cull Face**. This reduces shadow peter-panning significantly
|
||||
and prevents lights from exhibiting shadow acne at grazing angles.
|
||||
The main downside is that it may cause lighting to leak in some corners.
|
||||
The other downside is that materials that have their cull mode set to
|
||||
**Disabled** or MeshInstances with Cast Shadow set to **Double-Sided**
|
||||
may exhibit shadow acne.
|
||||
- Set **Bias** to ``-0.01``. The bias should be a negative value when
|
||||
**Reverse Cull Face** is enabled, but it should be a positive value when it's disabled.
|
||||
- For DirectionalLight, set the directional shadow **Normal Bias** to ``0.0``
|
||||
and **Bias Split Scale** to ``0.0``. Depending on your scene, you may also
|
||||
want to further decrease **Bias** to a value between ``-0.05`` and ``-0.1``.
|
||||
|
||||
Following the above tips should make it possible to avoid gaps in shadows without
|
||||
resorting to contact shadows (which have many issues of their own).
|
||||
If shadow acne is still visible after performing the above tweaks,
|
||||
try subdividing your meshes further in your 3D modeling software.
|
||||
|
||||
Directional light
|
||||
~~~~~~~~~~~~~~~~~
|
||||
|
||||
Reference in New Issue
Block a user