Skip to content

Commit d32af4e

Browse files
author
Samuel Rigaud
committed
GltfLoader: fix too generic assigment of light decay
1 parent 0fb4b68 commit d32af4e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

examples/jsm/loaders/GLTFLoader.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -576,11 +576,13 @@ class GLTFLightsExtension {
576576
case 'point':
577577
lightNode = new PointLight( color );
578578
lightNode.distance = range;
579+
lightNode.decay = 2;
579580
break;
580581

581582
case 'spot':
582583
lightNode = new SpotLight( color );
583584
lightNode.distance = range;
585+
lightNode.decay = 2;
584586
// Handle spotlight properties.
585587
lightDef.spot = lightDef.spot || {};
586588
lightDef.spot.innerConeAngle = lightDef.spot.innerConeAngle !== undefined ? lightDef.spot.innerConeAngle : 0;
@@ -600,8 +602,6 @@ class GLTFLightsExtension {
600602
// here, because node-level parsing will only override position if explicitly specified.
601603
lightNode.position.set( 0, 0, 0 );
602604

603-
lightNode.decay = 2;
604-
605605
assignExtrasToUserData( lightNode, lightDef );
606606

607607
if ( lightDef.intensity !== undefined ) lightNode.intensity = lightDef.intensity;

0 commit comments

Comments
 (0)