• Hello [name]! Thanks for joining the GMC. Before making any posts in the Tech Support forum, can we suggest you read the forum rules? These are simple guidelines that we ask you to follow so that you can get the best help possible for your issue.

Question - Code "New at Shaders" Type of Question

DyadGames

Member
Hey, I'm using another surface just so I can add two shaders to this one object. While I got the shaders both working I got an unwanted trail from the other surface im drawing.



Im sure I'm probably doing something wrong, but I thought doing a surface_free would clear it..

Code:
//Shader Bright
shader_reset();
surf = surface_create(surface_get_width(application_surface), surface_get_height(application_surface));
surface_set_target(surf);
shader_set(shBright);
shader_set_uniform_f(bright_uni, bright_pos);

draw_sprite_ext(sprite_index,image_index,x,y,image_xscale,image_yscale,90+rotation,image_blend,image_alpha);

shader_reset();
surface_reset_target();


//Hue for Everyone
shader_set(shHue);
shader_set_uniform_f(hue_uni, hue_pos);
draw_sprite_ext(sprite_index,image_index,x,y,image_xscale,image_yscale,90+rotation,image_blend,image_alpha);

draw_surface(surf,0,0)

//Clear
surface_set_target(surf);
draw_set_alpha(0);
draw_rectangle( 0, 0, surface_get_width(surf), surface_get_height(surf), false );
surface_reset_target();
draw_set_alpha(1);

if surface_exists(surf){surface_free(surf)}
 
Top