M
Mann_mit_Hut
Guest
Hey fellows,
i have some particles flowing around in a velocityfield, now i' working on a visual representation.
To make it look nice they should draw trails, that fade out.
The effect i got by drawing them on a surface goes in the right direction, but i'm not doing it right i think.
In the screenshot you can see, that the particles dont fade out to 0, they still leave slight trails that will stay forever.
Maybe someone has done something like that and could give me a hint?
Here is my code so far:
i have some particles flowing around in a velocityfield, now i' working on a visual representation.
To make it look nice they should draw trails, that fade out.
The effect i got by drawing them on a surface goes in the right direction, but i'm not doing it right i think.
In the screenshot you can see, that the particles dont fade out to 0, they still leave slight trails that will stay forever.
Maybe someone has done something like that and could give me a hint?
Here is my code so far:
Code:
surface_set_target(particlesurf);
// let the fadeout happen
draw_set_alpha(0.1)
draw_set_colour(c_white)
draw_rectangle(0,0,room_width,room_height,false)
draw_set_alpha(1)
// draw particles on surface
for(var i=0; i<100; i++){
draw_sprite_ext(spr_particle,0,particlex[i],particley[i],1,1,0,c_white,1)
}
// draw the particlesurface on screen
surface_reset_target();
draw_surface(particlesurf,0,0)
Attachments
-
42.1 KB Views: 49