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

Fix Sprite3D to utilize 3D space by default #76461

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

CoolDotty
Copy link

Changes Sprite3D to use the depth prepass by default instead of render order. This makes Sprite3D more in line with its usage as a helper "to display a 2D texture in a 3D environment".

IMO, alpha cut mode should be the most exhaustive mode by default, and adjusting it for better performance should be left to the user. This also addresses concerns with Sprite3D covering up Gizmos in the editor.

See #17567, #24069

@CoolDotty CoolDotty requested a review from a team as a code owner April 26, 2023 03:02
@clayjohn clayjohn added this to the 4.x milestone Apr 26, 2023
Changes Sprite3D to use the depth prepass by default instead of render order. This makes Sprite3D more in line with its usage as a helper "to display a 2D texture in a 3D environment".

Fixes godotengine#17567, godotengine#24069
@CoolDotty CoolDotty force-pushed the fix-sprite-3d-depth branch from e3de2f1 to d7fb537 Compare April 26, 2023 08:14
@CoolDotty CoolDotty requested a review from a team as a code owner April 26, 2023 08:14
@CoolDotty
Copy link
Author

I fixed the broken test. Although, sprites still cover gizmos in the editor. Notably the camera frustum and collision shape outlines.

image

For reference, this is what it should look like, demonstrated with alpha_cut = ALPHA_CUT_DISCARD

image

@@ -86,7 +86,7 @@ class SpriteBase3D : public GeometryInstance3D {
RID last_texture;

bool flags[FLAG_MAX] = {};
AlphaCutMode alpha_cut = ALPHA_CUT_DISABLED;
AlphaCutMode alpha_cut = ALPHA_CUT_OPAQUE_PREPASS;
Copy link
Member

@Calinou Calinou Apr 26, 2023

Choose a reason for hiding this comment

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

Note that changing a default parameter is a compatibility-breaking change, as it'll change behavior in existing projects that use the previous default mode.

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.

3 participants