B
Bulwarkene
Guest
GM Version: Studio (all)
Target Platform: Windows
Download: (see code example below)
Links: n/a
This is a tutorial that explains how to make a basic scanline shader.
Step 1:
Make an object, and in the draw_gui_end event, add this code:
In the create event add this code:
Drag and drop the object into every room you want the effect.
Step 2: Make a shader, and for the fragment shader use this code:
Result:
You are free to use this for any project.
Target Platform: Windows
Download: (see code example below)
Links: n/a
This is a tutorial that explains how to make a basic scanline shader.
Step 1:
Make an object, and in the draw_gui_end event, add this code:
Code:
shader_set(test_shader);
t_h = 1/surface_get_height(application_surface);
shader_set_uniform_f(texelSize, t_h);
draw_surface(application_surface,0,0);
shader_reset();
Code:
texelSize = shader_get_uniform(test_shader, "texelSize");
Step 2: Make a shader, and for the fragment shader use this code:
Code:
//
// Bulwarken Scanline Shader
// CC0 License
varying vec2 v_vTexcoord;
varying vec4 v_vColour;
uniform float texelSize;
void main()
{
vec4 temp = v_vColour * texture2D( gm_BaseTexture, v_vTexcoord );
temp * (mod(v_vTexcoord.y, texelSize*2.0) * 1.0/texelSize);
gl_FragColor = temp;
}
You are free to use this for any project.
Last edited by a moderator: