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

Restore optional pivot based sorting with offset #4099

Closed
QbieShay opened this issue Feb 23, 2022 · 2 comments · Fixed by godotengine/godot#69998
Closed

Restore optional pivot based sorting with offset #4099

QbieShay opened this issue Feb 23, 2022 · 2 comments · Fixed by godotengine/godot#69998

Comments

@QbieShay
Copy link

QbieShay commented Feb 23, 2022

Describe the project you are working on

Various VFX

Describe the problem or limitation you are having in your project

Render priority works great for global objects, but very poorly for collection of particle systems (VFX).

Using the render priority of the material would make it so that two effects that make use of it, spawned in different part of the map, would intersect in funny ways
See video below for practical example

2022-01-25.12-45-18.mp4

.

Describe the feature / enhancement and how it helps to overcome the problem or limitation

Rendering objects with pivot+sorting offset would allow to define a spatial aware rendering order for particle system.
The renderer would calculate the rendering order by sorting object by distance from the camera, but in this case to that distance it would add the sorting offset (which is used only for the purpose of this calculation)

Describe how your proposal will work, with code, pseudo-code, mock-ups, and/or diagrams

Make sorting based on AABB center default but optional, with another option for pivot+fudge

If this enhancement will not be used often, can it be worked around with a few lines of script?

Can't be worked around as it is internal of the renderer

Is there a reason why this should be core and not an add-on in the asset library?

See above

@neikeq
Copy link

neikeq commented Mar 22, 2022

I don't know if I understand well this proposal, but godotengine/godot#59404 among other things implements a depth offset property in GeometryInstance3D. Can you check if this is what you needed (or in part)?

@akien-mga
Copy link
Member

Implemented for 3.6 by godotengine/godot#63040.

Still needs an implementation for 4.0 too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Implemented
Development

Successfully merging a pull request may close this issue.

4 participants