-
-
Notifications
You must be signed in to change notification settings - Fork 21.3k
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
[3.x] Add options for sorting transparent objects #63040
Conversation
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.
@reduz approved the feature in PR meeting but wants it checked in depth by @godotengine/rendering folks.
You should also add documentation for the new properties: https://docs.godotengine.org/en/latest/community/contributing/updating_the_class_reference.html |
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.
Looks good to me subject to Akien's comments and my one comment and adding docs
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.
Great work! This is going to be super useful for many people :)
scene/3d/visual_instance.cpp
Outdated
sorting_use_aabb_center = true; | ||
sorting_offset = 0; |
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.
More of a nitpick in 3.x, but it's preferred to define the default values in the header instead of the constructor. This should definitely be the case in the master
version, if there is one.
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 for 3.x I let this go through as this is actually more consistent, since we didn't port most of the codebase.
Left a few notes, most are nitpicks, but the docs have some confusing wording worth correcting before merging. |
1f3601c
to
2d68c2e
Compare
Co-authored-by: Rémi Verschelde <[email protected]> Co-authored-by: Clay John <[email protected]>
2d68c2e
to
acdcbef
Compare
Thanks, everyone! Let's make the |
[3.x] added options for sorting transparent objects
[3.x] added options for sorting transparent objects
Cherry-picked for 3.5.2 |
Added options for sorting transparent objects (port of PR #63040)
This commit adds two properties to visual instance:
sorting_use_aabb_center
default to true, use the aabb center for sorting. if set to false, it uses the origin (pivot) of the object insted.sorting_offset
a float value that will change the depth that is assigned to the object in the transparent queue.This is especially useful for VFX where there are a lot of particle systems on top of each other, giving artists the full control over the ordering of particles within the same vfx, since godot has no concept of a vfx. (this can't be done with render priority, see: godotengine/godot-proposals#4099 )
I'd love to port this to 4.x but I will need someone's help to figure out where i should touch the renderer.
Video of the new behaviour https/giant.gfycat.com/MetallicTenderFlounder.mp4
This work was kindly sponsored by Pahdo Labs