• Hey Guest! Ever feel like entering a Game Jam, but the time limit is always too much pressure? We get it... You lead a hectic life and dedicating 3 whole days to make a game just doesn't work for you! So, why not enter the GMC SLOW JAM? Take your time! Kick back and make your game over 4 months! Interested? Then just click here!

GameMaker Light Overlay Blend

Azenris

Member
Hi :p

I wanted to make that light overlay thingy that is done alot. I looked at some stuff and this is what I end up with.

Code:
shader_set( light_overlay_shader );
{
   surface_set_target( surface_light );
   {
       blend_push( bm_src_alpha, bm_one );
       {
           with ( obj_glowstick )
               draw_circle_colour( x - _cx, y - _cy, radius, image_blend, c_black, false );

           // same for other lits etc...
       }
       blend_pop();
   }
   surface_reset_target();
}
shader_reset();
for the end result : https://imgur.com/a/8ZHaAI9

I tried bm_dest_color, bm_zero but ofc this gives weird results with how the draw_circle_colour works ( fading to black at the edge ).

I'm not 100% what I want to do, that light seems weird though right ? I feel like they should be blended, not overlap based on the draw order.

Is there a simple way to get what I want ? ( what is it I even want :confused: )

I think that a white circle sprite faded to alpha at the edges would work, but using a sprite seems weird when I have the radius variable, would I just stretch it? won't that look weird?

What do you guys do for the overlay lighting thingy-ma-bob ? :eek:
 
Top