Spotlight stops working for me when going from r96 to r97

I know I am running a much older version, but because of issues with es6 without rewriting everything (which would be huge for me) I am slowing testing up till things start breaking.

I finally got up to r96 and all was fine, but soon as I went to r97 nothing was showing in scene. I found that it was because spotlight and pointlight were no longer working.
They worked fine in 96.
Below is code right from docs. I get no errors but I also get no light.

Anyone remember any reason this would happen? I looked in migrate files but nothing listed that changed on spotlights
const spotLight = new THREE.SpotLight( 0xff0000 );
spotLight.position.set( 100, 1000, 100 );

spotLight.castShadow = true;

spotLight.shadow.mapSize.width = 1024;
spotLight.shadow.mapSize.height = 1024;

spotLight.shadow.camera.near = 500;
spotLight.shadow.camera.far = 4000;
spotLight.shadow.camera.fov = 30;

scene.add( spotLight );

HELP!!!

Thanks Jeff

Does r98 work, and, are you using renderer.physicallyCorrectLights?

I’m only aware of one lighting-related change released in r97, and it was fairly small:

Full release notes: Release r97 ¡ mrdoob/three.js ¡ GitHub

same thing in r98, I checked up to r105

It is indeed the renderer.physicallyCorrectLights. If I set that to false then light shows but everything is way too bright at current settings. Do I really need the Correct? I tried setting distance and decay above 0but went black again ( I was not using either one), what should I set these to? Will that fix my issue setting those up?

Thanks

What are the light settings (mainly distance and decay) for which you’re trying to get the same results after r97? The intention of that change was to make distance=0 behave as if there were no distance cutoff, or an infinite cutoff, while maintaining the given decay. Previously distance=0 disabled decay, if I’m remembering correctly, which you can also manually do by setting decay=0.

EDIT: Assuming the default Spotlight values, distance=0 and decay=1, I would instead try distance=0 and decay=0.

The 0,0 did the trick
Now I am up to 101 before the next thing broke :slight_smile: Seems to be shader related, which is a time for another day…

Thanks so much…

PS. What is the latest version of the gltf loader that you think might work? I have 108 working but things go off after that

‘itemStart’ of undefined is what shows when I go past 108

1 Like

Progress!

I wouldn’t advise recommending GLTFLoader in isolation from the rest of the library, is that what you mean? It has dependencies on the core loader utilities.

I wouldn’t either but I would like to get as far as I can on gltf and fbx that I can