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

Added options for sorting transparent objects (port of PR #63040) #69998

Merged
merged 1 commit into from
Dec 23, 2022

Conversation

BastiaanOlij
Copy link
Contributor

@BastiaanOlij BastiaanOlij commented Dec 13, 2022

This is a port of #63040 to Godot 4.

Bugsquad edit: This closes godotengine/godot-proposals#4099.

@BastiaanOlij
Copy link
Contributor Author

One thing that needs to be discussed (was already talking about this with @clayjohn) in chat, is whether we should make the sort on the two Vulkan renderers apply the same logic the GLES (and Godot 3) renderer does when we're dealing with a perspective camera.

@BastiaanOlij BastiaanOlij force-pushed the sorting-pivot-4 branch 2 times, most recently from 4676018 to d73f5b8 Compare December 13, 2022 11:37
Copy link
Member

@clayjohn clayjohn left a 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, As discussed on rocketchat, we should add this to decals and lights (which would supersede #60253). If you do so you will also need to update the GEOMETRY INSTANCE mask in instance_set_pivot_data()

doc/classes/VisualInstance3D.xml Outdated Show resolved Hide resolved
@BastiaanOlij
Copy link
Contributor Author

Looks good to me, As discussed on rocketchat, we should add this to decals and lights (which would supersede #60253). If you do so you will also need to update the GEOMETRY INSTANCE mask in instance_set_pivot_data()

I'm still not 100% sure about this so I'd like to move that into a separate PR if we wish to implement that. Lights and decals are applied to geometry in the shader as an additive process, I'm not sure if a sort is going to have any effect here?

Copy link
Member

@clayjohn clayjohn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Alright, lets go ahead and merge this and discuss sorting of other GeometryInstances after.

@akien-mga akien-mga changed the title Godot 4 port of Sorting pivot PR 63040 Added options for sorting transparent objects (port of PR #63040) Dec 23, 2022
@akien-mga akien-mga merged commit 1cab6c9 into godotengine:master Dec 23, 2022
@akien-mga
Copy link
Member

Thanks!

@Lippanon
Copy link

This 'sorting_offset' is only for when the material goes through the transparent pipeline, right? I was trying to use this to avoid z-fighting I was having and it didn't seem to work so I thought it was bugged, but I guess it doesn't work for opaque mats. The docs/mouse_over don't mention it at all, if that's the case.

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

Successfully merging this pull request may close these issues.

Restore optional pivot based sorting with offset
4 participants