Im using godot 4. I have some billboards that are not drawing ontop of each other correctly and im not sure why.
The sprites farther away from the camera are drawing ontop of the closer sprites.
Here are relevant parts of my shader:
shader_type spatial;
render_mode blend_mix, depth_draw_opaque, cull_back, diffuse_burley, specular_schlick_ggx, unshaded;
uniform vec4 albedo : source_color;
uniform sampler2D texture_albedo : source_color,filter_nearest,repeat_enable;
uniform float point_size : hint_range(0, 128)
and
vec2 base_uv = UV;
vec4 albedo_tex = texture(texture_albedo,base_uv);
albedo_tex *= COLOR;
ALBEDO = albedo.rgb * albedo_tex.rgb;
SPECULAR = specular;
ALPHA = albedo.a * albedo_tex.a;
Perhaps I need to enable alpha_scissors? Or maybe there is something wrong with the way I made the billboard in blender?
Any help would be great!
Thanks!
Edit. The individual billboards are actually larger than the dirt sprite. Im using a transparent png for the sprite. This is what the sprites look like when I disable the transparency by commenting out // ALPHA = albedo.a * albedo_tex.a;
Notice the black and brown outline around the sprite:
If I switch to depth_draw_always
mode then I get the correct drawing order (blocks in front are drawn on top) however the transparent area is weird: