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
+19-3Lines changed: 19 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -52,19 +52,35 @@ 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 downside is that it may cause lighting to leak in some corners.
76
+
- Set **Bias** to ``-0.01``. The bias should be a negative value when
77
+
**Reverse Cull Face** is enabled, but it should be a positive value when it's disabled.
78
+
- For DirectionalLight, set the directional shadow **Normal Bias** to 0 and **Bias Split Scale** to 1.
79
+
You may also want to further decrease **Bias** to a value between
80
+
``-0.05`` and ``-0.1` and decrease **Bias Split Scale** depending on your scene.
81
+
82
+
Following the above tips should make it possible to avoid gaps in shadows without
83
+
resorting to contact shadows (which have many issues of their own).
0 commit comments