surface_set_target(global.light_surface); // Base surface
draw_clear_alpha(global.color_zero,1);
draw_set_blend_mode(bm_add);
with(par_light){
// This draws calculated shadows && light sprites
draw_surface(light_surface,0-view_xview[0],0-view_yview[0]);
};
surface_reset_target();
draw_set_blend_mode_ext(bm_add,bm_subtract);
draw_surface(global.light_surface,0,0);
draw_set_blend_mode(bm_normal);This code draws all the surfaces (it's borrowed code). It works fine, but not the way I want it too. Objects sprites are drawn on top, and these surfaces below that. So objects are constantly 'lit'. The shadows intersect with object sprites underneath so I can't just draw that surface it on top.
I split the sprites and shadows into two different surfaces. Code is nearly the same:
with(par_light){
draw_surface(light_surface_2,0-view_xview[0],0-view_yview[0]); // shadows
draw_surface(light_surface,0-view_xview[0],0-view_yview[0]); // light sprites
};
I set the order (top to bottom) base surface (black), light sprites, objects, shadows. Now the problem it the shadows are overlapped by the light sprites. So that doesn't work. I would need to have the shadows overlap the light, but still remain under the objects. It's crazy. I came here to see if anyone has any ideas/ can help.
I know how I could fix this, and that would involve messing with how the shadows are calculated so they won't overlap the object's sprite.
I barely can figure out what's going on in that code, so i'd rather not touch it unless I have too!











