Skip to content

Commit

Permalink
Fix Sprite3D to utilize 3D space by default
Browse files Browse the repository at this point in the history
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 #17567, #24069
  • Loading branch information
CoolDotty committed Apr 26, 2023
1 parent e0e93ce commit d7fb537
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion doc/classes/SpriteBase3D.xml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
<member name="alpha_antialiasing_mode" type="int" setter="set_alpha_antialiasing" getter="get_alpha_antialiasing" enum="BaseMaterial3D.AlphaAntiAliasing" default="0">
The type of alpha antialiasing to apply. See [enum BaseMaterial3D.AlphaAntiAliasing].
</member>
<member name="alpha_cut" type="int" setter="set_alpha_cut_mode" getter="get_alpha_cut_mode" enum="SpriteBase3D.AlphaCutMode" default="0">
<member name="alpha_cut" type="int" setter="set_alpha_cut_mode" getter="get_alpha_cut_mode" enum="SpriteBase3D.AlphaCutMode" default="2">
The alpha cutting mode to use for the sprite. See [enum AlphaCutMode] for possible values.
</member>
<member name="alpha_hash_scale" type="float" setter="set_alpha_hash_scale" getter="get_alpha_hash_scale" default="1.0">
Expand Down
2 changes: 1 addition & 1 deletion scene/3d/sprite_3d.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
float alpha_scissor_threshold = 0.5;
float alpha_hash_scale = 1.0;
StandardMaterial3D::AlphaAntiAliasing alpha_antialiasing_mode = StandardMaterial3D::ALPHA_ANTIALIASING_OFF;
Expand Down

0 comments on commit d7fb537

Please sign in to comment.