R
RealsLife
Guest
CREATE EVENT
DRAW EVENT
So I think or at least I thought I understood it. I give the background1 as a texture and want the "shader" used on it. In the end I reset it. I just get a black screen when I start the game. The shader used to work in the post draw event and used as texture the application surface, but I mean you have these other texture functions so this should work? Also in the game maker studio DEMO files I saw that shaders could be used in the normal draw event so I wanted to give it a go.
EDIT: Also if I try just before the shader_reset(); to draw somthing I think my texture page shows up with all sprites that are inside my current project
Code:
///Get Shader Uniforms
//distortion effect shader
u_resolution_water = shader_get_uniform(sh_underwater, "iResolution");
u_seconds_water = shader_get_uniform(sh_underwater, "iGlobalTime");
texture_counter = background_get_texture(background1);
sampler_counter = shader_get_sampler_index(sh_underwater, "tex_water");
sec = 0;
Code:
///Draw background with shader
//draw wave distortion effect
if( shader_is_compiled(sh_underwater))
{
shader_set(sh_underwater);
shader_set_uniform_f(u_resolution_water,1536.0,864.0);
shader_set_uniform_f(u_seconds_water,sec);
texture_set_stage(sampler_counter,texture_counter);
shader_reset();
}
EDIT: Also if I try just before the shader_reset(); to draw somthing I think my texture page shows up with all sprites that are inside my current project