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
Adopt glTF convention: lights face local neg-z direction #14935
Conversation
/ping @donmccurdy |
glTF does not currently define area lights, so this isn't a conformance concern. However — do we think similar changes to other directed lights (Spot, Directional) will eventually be wanted? I.e. removing |
I believe so. |
+1 for having the same convention for lights and cameras (lookat faces neg-z instead of pos-z for lights and neg-z for cameras), as it simplifies shadowmapping with this shared convention (proposed in #14658 (comment) already). |
@@ -332,7 +332,7 @@ Object3D.prototype = Object.assign( Object.create( EventDispatcher.prototype ), | |||
|
|||
position.setFromMatrixPosition( this.matrixWorld ); | |||
|
|||
if ( this.isCamera ) { | |||
if ( this.isCamera || this.isLight ) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This change is scary, but less see what happens...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We'll see... Thanks for giving this PR a go!
Thanks! |
As discussed in #14775 (comment).
For now, only
RectAreaLight
is governed by its quaternion, so it is the only light for which this new convention applies.This change required a rewrite of
RectAreaLightHelper
. The helper must now be added as a child of the light, which is probably a better API anyway.