Transparency Sorting Mode (Custom Axis) #12202
Replies: 2 comments 5 replies
-
As long as you don't need semi transparency, you can use a material with alpha scissor (i.e. alpha_cut set to discard on 3d sprites), and that will resolve the problem. Other than that, I think the only real solution is to script render_priority. |
Beta Was this translation helpful? Give feedback.
-
Godot 3 used to sort on the axis of the camera, but that was changed to be purely distance sorting. I hacked the old behavior back in for my 2.5D platformer project since the camera angle is fixed and the sorting looked better with that. If you want to modify the engine yourself to do that, you can go to render_forward_clustered.cpp and edit this block of code: if (p_render_data->scene_data->cam_orthogonal) {
if (inst->use_aabb_center) {
center = inst->transformed_aabb.get_support(-near_plane.normal);
}
inst->depth = near_plane.distance_to(center) - inst->sorting_offset;
} else {
if (inst->use_aabb_center) {
center = inst->transformed_aabb.position + (inst->transformed_aabb.size * 0.5);
}
inst->depth = p_render_data->scene_data->cam_transform.origin.distance_to(center) - inst->sorting_offset;
} Change the |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
So I've been reworking my Unity Project into Godot for over a year now and while Godot has convinced me right away to jump in and do this project, I did not bother to see if it has Transparency Sorting Issue (as Unity didn't give me a hard time with this issue) until I was deep in the development and started working on my Sprite Assets.
So Unity and Godot has a very similar issue of drawing Transparent Sprites properly but Unity has a Transparency Sorting Mode that fixes this.
Editor Preview
https://youtu.be/HW9f1UgtFho?feature=shared
Play Preview
https://youtu.be/XFnq9mzor9U?feature=shared
By any chance are we going to have a very similar feature? Because this is making my progress slow.
Beta Was this translation helpful? Give feedback.
All reactions