(solved) Surface: blend mode to dont draw on 0 alpha

I

Insanebrio

Guest
Hi guys, I have a decent knowledge of surfaces, but a fair knowledge of draw_set_blend_mode_ext. I would need to know if there's a way with draw_set_blend_mode_ext to draw only where there's a colour on the surface, and dont draw stuff where theres nothing (trasparency).
 

Tthecreator

Your Creator!
So you mean you only want the alpha of what you want to draw (the source) to be the same as the alpha on the surface that is already there (the destination).
You could try to use bm_dest_alpha for destination and bm_src_colour for source, but that will make any areas with less alpha black I think...

maybe bm_src_alpha_sat should work better than bm_dest_alpha... but It still wouldn't be perfect.

You could try a shader maybe? Although I've worked with shaders before, I'm not that sure how to get the destination color or alpha and if that's even possible. If that's not possible you'd have to pass the surface to the shader which might get complicated if you haven't worked with shaders before.
 
I

Insanebrio

Guest
Now im on my launch pause and i saw again the draw_set_blend_mode_ext description. I realized i always confused the surce argument as the already existing colour and the destination as the new one, but its the opposite...
When i get back to home ill try your suggestions ;)
 
Top