-
-
Notifications
You must be signed in to change notification settings - Fork 36.1k
WebGLRenderer: Added ability to sort groups by renderOrder #15484
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
Conversation
|
I think I have originally suggested |
| if ( object.isLight ) { | ||
| if ( object.isGroup ) { | ||
|
|
||
| groupOrder = object.renderOrder; |
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.
You are passing in groupOrder and reassigning the value if it is a group???
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.
Yeah, it will apply to its children only.
| var material = object.material; | ||
|
|
||
| currentRenderList.push( object, geometry, material, _vector3.z, null ); | ||
| currentRenderList.push( object, geometry, material, groupOrder, _vector3.z, null ); |
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.
You are passing in groupOrder and setting the last arg to null because it is not a group???
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.
The last argument is for multi-materials.
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.
I see. Group vs. groups.
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.
Yeah, sorry. Group vs material group.
|
Let's see how this goes 🤞 |
|
Thanks! |
|
Fixes #14415? |
|
Yes! 🎉 |
How can a group not have the value set? Zero is a valid value, correct? So does that mean that objects within a group are always rendered together, and the render order applies to only the objects within the group? |
Well, I've meant if a value other than the default value is set. Feel free to improve the docs.
Yes, relative sorting should be possible. |
I can't, because I do not understand what the intended behavior is. Perhaps you can compose a clear statement that describes the intended behavior. Also, you have modified the sorting behavior for everyone to accommodate an edge case. Based on my current understanding, I think adding |
see #14433 (comment)
Demo: https://jsfiddle.net/f2Lommf5/16835/