kupo15
Member
I have a very inefficient and poorly written code that flashes the character that was written a while back when we didn't have shaders. I want to convert it to a shader version instead to make it better and not have to draw the character 3 times and clean it up but I really don't know what the fog code is doing to even know how to attempt to convert this.
its even worse because I have an IF statement that runs this code instead of the normal drawing code for the character which I also think is probably unnecessary. I should be able to simple write the character draw code once and turn on the flashing shader when needed
Whenever I think of shaders, I think @The Reverend
If I could just understand what the fog code does, I could probably make the shader
Gyazo Screen Video
gyazo.com
GML:
function scr_flashing(scale) {
fade += 0.3;
fade_normalized = (sin(fade)+1)*0.5;
draw_sprite_ext(sprite_index,floor(image_index),x,y,image_xscale*scale,image_yscale*scale,image_angle,image_blend,image_alpha);
// fog start
gpu_set_fog(true,merge_color(c_black,flash_color,fade_normalized),0,0);
draw_sprite_ext(sprite_index,floor(image_index),x,y,image_xscale*scale,image_yscale*scale,image_angle,c_white,0.3);
gpu_set_fog(0,0,0,0);
// fog end
// BM start
gpu_set_blendmode(bm_add);
draw_sprite_ext(sprite_index,floor(image_index),x,y,image_xscale*scale,image_yscale*scale,image_angle,c_white,0.5);
gpu_set_blendmode(bm_normal);
}
Whenever I think of shaders, I think @The Reverend
If I could just understand what the fog code does, I could probably make the shader
Last edited: