We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent bbe2d18 commit 27ee85bCopy full SHA for 27ee85b
Extensions/3D/DirectionalLight.ts
@@ -66,6 +66,17 @@ namespace gdjs {
66
}
67
this._shadowMapDirty = false;
68
69
+ // Avoid shadow acne due to depth buffer precision. We choose a value
70
+ // small enough to avoid "peter panning" but not too small to avoid
71
+ // shadow acne on low/medium quality shadow maps.
72
+ // If needed, this could become a parameter of the effect.
73
+ this._light.shadow.bias =
74
+ this._shadowMapSize < 1024
75
+ ? -0.002
76
+ : this._shadowMapSize < 2048
77
+ ? -0.001
78
+ : -0.0008;
79
+
80
this._light.shadow.mapSize.set(
81
this._shadowMapSize,
82
this._shadowMapSize
0 commit comments