RyanC
Member
Hi All,
I'm wondering if anyone can suggest a better way of doing this:
My lighting system uses 2 separate surfaces, 1 for all the background sprites and 1 for the foreground with the player and floor blocks etc.
I am trying to achieve a system that will render these surfaces in the GUI_Begin event, with a different lighting color on the background then on the foreground.
The system draws the current background sprites to the background surface in Draw_Begin, and then switches to the foreground surface in Draw_Main and draws everything normally to the second surface. It then draws the surfaces to the application_surface, with a shader for each surface to create the lighting colors.
The issue is that things drawn on the foreground surface that use bm_max have no background to apply the additional alpha values to because the background is now on a different surface. So the final result gives transparent sprites that have been added to c_black and do not glow.
It's worth noting that if I draw_clear_alpha(1) on the foreground surface, I get a better result then draw_clear_alpha(0) but then I have to detect unchanged pixels within the shader so it does not draw the background of the surface, which then looks terrible, like when removing a background color from a faded sprite.
I can't just draw the foreground surface all with bm_max in the gui either because then everything is to bright.
Any suggestions appreciated to fix or replace this system.
I'm wondering if anyone can suggest a better way of doing this:
My lighting system uses 2 separate surfaces, 1 for all the background sprites and 1 for the foreground with the player and floor blocks etc.
I am trying to achieve a system that will render these surfaces in the GUI_Begin event, with a different lighting color on the background then on the foreground.
The system draws the current background sprites to the background surface in Draw_Begin, and then switches to the foreground surface in Draw_Main and draws everything normally to the second surface. It then draws the surfaces to the application_surface, with a shader for each surface to create the lighting colors.
The issue is that things drawn on the foreground surface that use bm_max have no background to apply the additional alpha values to because the background is now on a different surface. So the final result gives transparent sprites that have been added to c_black and do not glow.
It's worth noting that if I draw_clear_alpha(1) on the foreground surface, I get a better result then draw_clear_alpha(0) but then I have to detect unchanged pixels within the shader so it does not draw the background of the surface, which then looks terrible, like when removing a background color from a faded sprite.
I can't just draw the foreground surface all with bm_max in the gui either because then everything is to bright.
Any suggestions appreciated to fix or replace this system.