I'm having a problem with transparent textures in 3d mode. With d3d_set_zwriteenable set to true, transparent textures blot out textures below them, as if they were opaque. Setting it to false fixes the issue, but also prevents the model from clipping other models.
Most results from google suggest using draw_set_alpha_test, but it doesn't work well when a texture has partially transparent pixels.
My objects are ordered in standard isometric fashion. depth=-y (or rather since the view is angled 45 degrees, depth=x-y)
The camera is a separate object that has a depth of 1000000. Each billboard in my game has a draw event that looks something like this:
tl;dr How do I fix this? Images below.
Most results from google suggest using draw_set_alpha_test, but it doesn't work well when a texture has partially transparent pixels.
My objects are ordered in standard isometric fashion. depth=-y (or rather since the view is angled 45 degrees, depth=x-y)
The camera is a separate object that has a depth of 1000000. Each billboard in my game has a draw event that looks something like this:
Code:
depth=x-y
d3d_set_culling(true)
d3d_set_hidden(true)
d3d_set_zwriteenable(true)
<draw>
d3d_set_zwriteenable(false)
d3d_set_hidden(false)
d3d_set_culling(false)
Plane cutting the player billboard in half
Player billboard cutting the plane in half.
(The player sprite cutoff at the bottom is normal and expected in this image)
Plane blotting out other billboards
Another angle. The plane is parallel with the ground (raised up a few z units), while the player is (normally) angled towards the camera.
(The player sprite cutoff at the bottom is normal and expected in this image)
Working almost as intended, with draw alpha test enabled, but you can notice the partially transparent pixels still blotting out the billboard underneath. (The player sprite cutoff at the bottom is normal and expected in this image)
Player billboard cutting the plane in half.
(The player sprite cutoff at the bottom is normal and expected in this image)
Plane blotting out other billboards
Another angle. The plane is parallel with the ground (raised up a few z units), while the player is (normally) angled towards the camera.
(The player sprite cutoff at the bottom is normal and expected in this image)
Working almost as intended, with draw alpha test enabled, but you can notice the partially transparent pixels still blotting out the billboard underneath. (The player sprite cutoff at the bottom is normal and expected in this image)