Skip to content

Commit cf0404a

Browse files
committed
Make spot lights work better with a bias of 0.0001
1 parent ed55e02 commit cf0404a

1 file changed

Lines changed: 6 additions & 5 deletions

File tree

examples/3d-car-coin-hunt/3d-car-coin-hunt.json

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7312,14 +7312,14 @@
73127312
"Color": "248;231;28",
73137313
"Smoothing": 1,
73147314
"Image": "",
7315-
"ShadowQuality": "Low",
7315+
"ShadowQuality": "High",
73167316
"ConeAngle": 45,
73177317
"VisibilityDistanceMax": 2000,
73187318
"IsCastingShadow": true,
73197319
"Intensity": 4,
73207320
"ConeLength": 2000,
73217321
"ShadowCameraFarPlane": 2000,
7322-
"ShadowBias": 0.00024
7322+
"ShadowBias": 0.001
73237323
}
73247324
},
73257325
{
@@ -7354,7 +7354,7 @@
73547354
"effects": [],
73557355
"behaviors": [],
73567356
"content": {
7357-
"ShadowQuality": "Low",
7357+
"ShadowQuality": "High",
73587358
"Intensity": 4,
73597359
"Color": "255;255;255",
73607360
"ShadowCameraFarPlane": 2000,
@@ -42192,7 +42192,7 @@
4219242192
"",
4219342193
" /**",
4219442194
" * @param value {number}",
42195-
" * @param quality {\"Low\" | \"Medium\" | \"High\"}",
42195+
" * @param quality {\"Low\" | \"Medium\" | \"High\" | \"VeryHigh\"}",
4219642196
" * @param coneAngle {number}",
4219742197
" */",
4219842198
" setShadowBias(value, quality, coneAngle) {",
@@ -42203,7 +42203,8 @@
4220342203
" ? 4",
4220442204
" : quality === 'High'",
4220542205
" ? 2 : 1;",
42206-
" this.spotLight.shadow.bias = -value * biasMultiplier *",
42206+
" // Multiply by 0.125 to make values around 0.001 work best.",
42207+
" this.spotLight.shadow.bias = -value * 0.125 * biasMultiplier *",
4220742208
" Math.tan(gdjs.toRad(gdjs.evtTools.common.clamp(coneAngle, 0, 89)));",
4220842209
" }",
4220942210
"",

0 commit comments

Comments
 (0)