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

Adopt glTF convention: lights face local neg-z direction #14935

Merged
merged 2 commits into from Dec 12, 2018

Conversation

WestLangley
Copy link
Collaborator

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.

@mrdoob mrdoob added this to the r98 milestone Sep 25, 2018
@WestLangley
Copy link
Collaborator Author

/ping @donmccurdy

@donmccurdy
Copy link
Collaborator

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 light.target in favor of local direction affected by the node's world rotation? If that's the end goal, then +1 for updating RectAreaLight and using -Z for lights going forward. If we think the other directed lights will remain as-is, then I have no preference on this PR.

@WestLangley
Copy link
Collaborator Author

However — do we think similar changes to other directed lights (Spot, Directional) will eventually be wanted? I.e. removing light.target in favor of local direction affected by the node's world rotation?

I believe so.

@mbredif
Copy link
Contributor

mbredif commented Oct 5, 2018

+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).

@mrdoob mrdoob modified the milestones: r98, r99 Oct 31, 2018
@mrdoob mrdoob modified the milestones: r99, r100 Nov 30, 2018
@@ -332,7 +332,7 @@ Object3D.prototype = Object.assign( Object.create( EventDispatcher.prototype ),

position.setFromMatrixPosition( this.matrixWorld );

if ( this.isCamera ) {
if ( this.isCamera || this.isLight ) {
Copy link
Owner

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...

Copy link
Collaborator Author

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!

@mrdoob mrdoob merged commit 32cd6bc into mrdoob:dev Dec 12, 2018
@mrdoob
Copy link
Owner

mrdoob commented Dec 12, 2018

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants