Doubts about PointLight distance

lights
#1

I am trying to illuminate only part of a scene with a single PointLight.
I’ve set the distance small above zero (which from the docs set infinity range), but still the light illuminates everything in the scene, even things out of range. Probably missing something obvious here, but what?

This is the light and the helper to show the light range:

const pointLightColor = 0xFFBF4D
const pointLightIntensity = 0.3
const pointLightDistance = 0.5
const pointLightDecay = 2.0

const pointLight = new T.PointLight(
    pointLightColor,
    pointLightIntensity,
    pointLightDistance,
    pointLightDecay)

pointLight.position.set(0, 7, 13)

scene.add(new T.PointLightHelper(pointLight, pointLightDistance));
scene.add(pointLight)
0 Likes

#2

And if you remove this light and its helper, the scene is no longer illuminated?

0 Likes

#3

Yes it is dark (I’ve removed the ambient light for test)

0 Likes

#4


I’ve made a demo in the editor, using your light settings. The range is rather small, but there aren’t any problems with it, which makes me believe the cause is situated somewhere else in your code. Would you mind sharing it?

0 Likes

#5

Thank you, can you please try with a MeshStandardMaterial (metalness 0.99, roughness 0.6)? From my test in the editor the distance parameter has no effect on the light on the mesh. As you can see the mesh is still affected by the light, even when the light is very far away and distance set to 0.01

0 Likes

#6

That is somewhat bizarre…
Im still getting the same result (light settings same as the previous comment)

0 Likes

#7

Mm I don’t know. Which version are you using? I am on v103.

This is a small clip showing the issue:

0 Likes

#8

After some investigation, this seems to happen only on Mac OS (tested on chrome, firefox and safari ), in my case 10.14.4. On Windows and ios safari PointLight distance works just as expected. Anyone else using Mac OS has the same issue?

0 Likes

#9

Open ticket: https://github.com/mrdoob/three.js/issues/16259

0 Likes