Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PointLight shadow camera far value #14414

Closed
3 of 12 tasks
jcubed111 opened this issue Jul 4, 2018 · 0 comments · Fixed by #21526
Closed
3 of 12 tasks

PointLight shadow camera far value #14414

jcubed111 opened this issue Jul 4, 2018 · 0 comments · Fixed by #21526

Comments

@jcubed111
Copy link

Description of the problem

When you create a PointLight, it also creates a camera to use when rendering shadows.

this.shadow = new LightShadow( new PerspectiveCamera( 90, 1, 0.5, 500 ) );

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.

Three.js version
  • Dev
  • r94
Browser
  • All of them
  • Chrome
  • Firefox
  • Internet Explorer
OS
  • All of them
  • Windows
  • macOS
  • Linux
  • Android
  • iOS
Hardware Requirements (graphics card, VR Device, ...)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants