S
Stratos.la
Guest
Hey guys so i have made a sonar type radar on my player object by creating a surface and using blend modes through layers. im happy with it but as i have it its just set to black and i dont want that. i have a fog shader at the moment for testing purposes ( i had bought this through the marketplace a few months ago) but i cant get it to work :/
controler
scripts for start and end
i dont know if the shaders code is necessary since i'll probably end up making one of my own after some studying but basicaly it shoud work even with that one.
controler
Code:
if instance_exists(o_player)
{
light_layer = layer_get_id("Lights");
light_surface = surface_create(1920,1080);
layer_script_begin ( light_layer,lights_begin);
layer_script_end(light_layer,lights_end);
}
Code:
if (event_type == ev_draw ) and (event_number == 0 )
{
if (!surface_exists(iLight.light_surface))
{
iLight.light_surface = surface_create(1920,1080);
}
surface_set_target(iLight.light_surface);
draw_clear_alpha(c_black, 1.0);
gpu_set_blendmode(bm_add);
}
Code:
if (event_type == ev_draw) and (event_number == 0 )
{
surface_reset_target();
gpu_set_blendmode(bm_normal);
surface_set_target(application_surface);
gpu_set_blendmode_ext(bm_dest_color,bm_zero);
draw_surface(iLight.light_surface, 0,0);
gpu_set_blendmode(bm_normal);
surface_reset_target();
}
i dont know if the shaders code is necessary since i'll probably end up making one of my own after some studying but basicaly it shoud work even with that one.
Last edited by a moderator: