Hi guys
I spent hours on this problem without any solution. So hopefully you can help me.
I d'like that after an explosion in my game, the smoke-particles remain on a surface, which is drawn over the entire screen.
This should look like the area where the explosion was, is burned. So my smoke sprite is basically a half transparent gray circle with a smooth alpha-gradient to zero alpha.
When i draw them to the surface and they are overlapping, the outer part (fully transparent part of a smoke particle) clears a part of the previous drawn particle).
alphatest is set to:
any solution?
kind regards
mX273
I spent hours on this problem without any solution. So hopefully you can help me.
I d'like that after an explosion in my game, the smoke-particles remain on a surface, which is drawn over the entire screen.
This should look like the area where the explosion was, is burned. So my smoke sprite is basically a half transparent gray circle with a smooth alpha-gradient to zero alpha.
When i draw them to the surface and they are overlapping, the outer part (fully transparent part of a smoke particle) clears a part of the previous drawn particle).
GML:
// Draw Event
if !surface_exists(decal_surf)
{
decal_surf = surface_create(1920, 1080);
surface_set_target(decal_surf);
draw_clear_alpha(c_black, 0);
surface_reset_target();
}
else
{
surface_set_target(decal_surf);
//gpu_set_blendmode_ext(bm_dest_color, bm_dest_alpha) // i tried different blendmodes, without success
with (obj_particle)
{
// the particles are fading out and then they will be destroyed.
// only draw them for a very short time at a specific alpha value
if (alpha > 0.3 && alpha < 0.4)
{
draw_sprite_ext(spr_smoke, 0, x, y, scaleX, scaleY, angle, color, alpha)
}
}
//gpu_set_blendmode(bm_normal)
surface_reset_target();
draw_surface(decal_surf, 0, 0);
}
Code:
var alphaThreshold = 1
gpu_set_alphatestenable(true)
gpu_set_alphatestref(alphaThreshold)
// I also tried different settings
kind regards
mX273
Last edited: