You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This camera always gets a far value of 500, but if you set the PointLight to have a finite distance, shadows will never be cast beyond that distance. So, it might make sense to default the camera's far value to min(distance, 500) if distance != 0.
Alternatively, perhaps a note on the documentation page could mention that if you're using point lights with a finite distance, you should manually set the shadow camera's far value.
Setting the camera's far value to be the same as the light's distance has no effect on the render result, since the light doesn't contribute at distance anyway, but it improves performance for me in complex scenes.
Description of the problem
When you create a PointLight, it also creates a camera to use when rendering shadows.
three.js/src/lights/PointLight.js
Line 36 in 0949e59
This camera always gets a far value of
500
, but if you set the PointLight to have a finite distance, shadows will never be cast beyond that distance. So, it might make sense to default the camera's far value tomin(distance, 500)
ifdistance != 0
.Alternatively, perhaps a note on the documentation page could mention that if you're using point lights with a finite distance, you should manually set the shadow camera's far value.
Setting the camera's far value to be the same as the light's distance has no effect on the render result, since the light doesn't contribute at
distance
anyway, but it improves performance for me in complex scenes.Three.js version
Browser
OS
Hardware Requirements (graphics card, VR Device, ...)
The text was updated successfully, but these errors were encountered: