-
-
Notifications
You must be signed in to change notification settings - Fork 35.2k
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
SpotLightShadow: Added .focus property #20218
Conversation
/ping @RemusMar |
Nice! So @mrdoob has now the choice between a flag and simple float property :) One minor disadvantage: Compared to |
setting setting It is a bit difficult to understand what can be changed -- and what cannot. |
Consequently, I prefer to consider that the spotlight shadow frustum is auto-set ( that is the intention, after all) , and to provide a |
Yep, that's a bit unfortunate. Anyway, your argumentation is definitely valid. TBH, I'm not feeling strong about what solution will be merged. I'm just happy if we are able to avoid the |
And I'm happy I can focus the shadow. :-) |
Why?
👍 |
Updated TS and docs. Todo: update migration docs, I assume... |
Added spotlight shadow The demo clearly illustrates how the quality of the shadow is improved by focusing the frustum. PR requires a rebuild. |
There is a significant difference in this example as well: |
Nice solution! |
Thanks! |
Actually, isn't |
Yes. Users need to use this pattern, however: spotLight.shadow.camera.zoom = zoom;
spotLight.shadow.camera.updateProjectionMatrix(); If you prefer, I can update to use |
updateProjectionMatrix() is not quite cheap. |
Okay, lets go with |
This feature allows the user to set a focused spotlight shadow.
.focus
is a value in [ 0, 1 ]. Default is 1.Everything else just works -- spotlight shadows continue to auto-update, helpers work as expected, and it is backwards-compatible.
I'll update docs, etc., if there is support for this PR.
EDIT: docs updated