-
-
Notifications
You must be signed in to change notification settings - Fork 35.5k
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
Helpers: Ensure light helpers are not frame-late. #21427
Conversation
Just want to clarify that this issue can't be fixed by overwriting |
Hmm, in what case the reference object's wold matrix won't be up to date by the time the helper's |
Consider this hierarchy:
And assume And even when the helpers call |
This is EXACTLY the PR I was planning to send in when I wrote issue #21608. Nice work! Well, one difference actually: I would do the same change for three.js/src/helpers/PointLightHelper.js Line 15 in 5f84432
|
PS: This is a big problem being addressed here. It's easy to create a light helper that shows you the wrong thing, in which case it does the opposite of helping (it hurts you). The main fix here is calling Granted, the long-term solution is to remove targets from lights (and use the light's quaternion instead), but until that solution is in-place, we need to address the current bug. This PR fixes the current bug and does not add any breaking changes (at least, not that I can imagine). |
I've updated |
@mrdoob Do you think we get this in the r128 release? |
BTW: This is what users do in order to desperately make light helpers work: const lightHelper = new THREE.DirectionalLightHelper(light, 10);
lightHelper.name = 'lightHelper';
scene.add(lightHelper);
lightHelper.parent.updateMatrixWorld();
lightHelper.update(); With this PR, the user could just add the helper and things work out-of-the-box. Would love to see this get merged in |
@mrdoob Anything we can do to help you feel comfortable with this? Excited to get it in r136. 😉 |
Fixed #14801.
Description
Ensures the world matrices of lights and targets are up-to-date when evaluated in light helpers.