You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: tutorials/3d/lights_and_shadows.rst
+24-3Lines changed: 24 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -52,19 +52,40 @@ There is a list of generic shadow parameters, each also has a specific function:
52
52
- **Color**: Areas occluded are multiplied by this color. It is black by default, but it can be changed to tint shadows.
53
53
- **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.
54
54
- **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.
55
-
- **Reverse Cull Faces**: Some scenes work better when shadow mapping is rendered with face-culling inverted.
55
+
- **Reverse Cull Face**: Some scenes work better when shadow mapping is rendered with face-culling inverted.
56
56
57
57
Below is an image of what tweaking bias looks like. Default values work for most
58
58
cases, but in general it depends on the size and complexity of geometry.
59
59
60
60
.. image:: img/shadow_bias.png
61
61
62
-
Finally, if gaps can't be solved, the **Contact** option can help:
62
+
Finally, if gaps can't be solved, the **Contact** option can help (at a performance cost):
63
63
64
64
.. image:: img/shadow_contact.png
65
65
66
66
Any sort of bias issues can always be fixed by increasing the shadow map resolution,
67
-
although that may lead to decreased performance on low-end hardware.
67
+
although that may lead to decreased performance.
68
+
69
+
.. tip::
70
+
71
+
If shadow biasing is a problem in your scene, the following settings are a good starting point:
72
+
73
+
- Enable **Reverse Cull Face**. This reduces shadow peter-panning significantly
74
+
and prevents lights from exhibiting shadow acne at grazing angles.
75
+
The main downside is that it may cause lighting to leak in some corners.
76
+
The other downside is that materials that have their cull mode set to
77
+
**Disabled** or MeshInstances with Cast Shadow set to **Double-Sided**
78
+
may exhibit shadow acne.
79
+
- Set **Bias** to ``-0.01``. The bias should be a negative value when
80
+
**Reverse Cull Face** is enabled, but it should be a positive value when it's disabled.
81
+
- For DirectionalLight, set the directional shadow **Normal Bias** to ``0.0``
82
+
and **Bias Split Scale** to ``0.0``. Depending on your scene, you may also
83
+
want to further decrease **Bias** to a value between ``-0.05`` and ``-0.1``.
84
+
85
+
Following the above tips should make it possible to avoid gaps in shadows without
86
+
resorting to contact shadows (which have many issues of their own).
87
+
If shadow acne is still visible after performing the above tweaks,
88
+
try subdividing your meshes further in your 3D modeling software.
0 commit comments