Luke Peña
Member
TLDR: How do I change the blend of a particle system using the part_system_drawit function? How do I avoid harsh outlines with the part_system_drawit function on a surface?
So right now I'm drawing particle systems to surfaces using the part_system_drawit function. But I'm having a few issues. These are the roadblocks I hit in order:
Does anybody have experience with this function? This is the first project I've used it on, and I can't seem to get it to work with me.
EDIT: So I could solve this if I understood a simple thing.
I found out that the reason for that dark outline was because the particles are fading while being drawn on a surface. And when I draw anything to a surface with an alpha value between 0 and 1 (like .5), it doesn't blend that alpha value on top of an opaque background - it punches a hole through the surface and makes the entire surface transparent.
In other words, the alpha for any given pixel on a surface is determined by the alpha top pixel drawn there. If I could figure out why that is and draw my surfaces "normally", then this issue would be resolved.
So right now I'm drawing particle systems to surfaces using the part_system_drawit function. But I'm having a few issues. These are the roadblocks I hit in order:
- When particles drawn this way fade, they have a black outline for some reason, as if their particle "surface" is clearing to black. For these particles, it worked to draw them with additive blending. That solved it for a while.
- I have a day night cycle, and these white particles need to tint slightly in the night. My initial plan was to use draw_set_color before using part_system_drawit, but apparently the drawit function has blending built into it. You can't change its color with that.
- I tried using shaders to tint it, and this is the only one that kind of works. The problem is that the moment I start tinting them, because they are drawn with additive blending, they begin to disappear.
- So I can used shaders to darken particles drawn to a surface with the drawit function, but it has to be normal blending. But with normal blending and the drawit function, harsh black outlines are added to semi-transparent particles.
Does anybody have experience with this function? This is the first project I've used it on, and I can't seem to get it to work with me.
EDIT: So I could solve this if I understood a simple thing.
I found out that the reason for that dark outline was because the particles are fading while being drawn on a surface. And when I draw anything to a surface with an alpha value between 0 and 1 (like .5), it doesn't blend that alpha value on top of an opaque background - it punches a hole through the surface and makes the entire surface transparent.
In other words, the alpha for any given pixel on a surface is determined by the alpha top pixel drawn there. If I could figure out why that is and draw my surfaces "normally", then this issue would be resolved.
Last edited: