• 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!

Shaders Three-layer surface shader stack

jf_knight

Member
I'm implementing three surfaces and applying a shader to each. However, only the first and last shader seems to appear, the second does not.
They are order-specific.
Am I doing my shader stack wrong?

obj_target DRAW event

GML:
if !surface_exists(main_surface)
{
    main_surface = surface_create(sprite_get_width(sprite_index), sprite_get_height(sprite_index));
    glow_surface = surface_create(sprite_get_width(sprite_index), sprite_get_height(sprite_index));
    tilt_shift_surface = surface_create(sprite_get_width(sprite_index), sprite_get_height(sprite_index));
}
else
{
    surface_set_target(main_surface);

    shader_set(shd_edit2);
    draw_surface_ext(tilt_shift_surface, 0,0,1.0,1.0,0,c_white,1.0);         
    draw_self();
    shader_reset();
    surface_reset_target();

    shader_set(shd_edit_glow);
    draw_surface_ext(glow_surface, 0,0,1.0,1.0,0,c_white,1.0);         
    shader_reset();
  
    shader_set(shd_edit_tilt_shift);
    draw_surface_ext(main_surface, 0,0,1.0,1.0,0,c_white,1.0);
    shader_reset();
}
 
Top