Check out the last tutorial if you haven't already. Today we'll be learning how to make a sepia shader and an invert shader. This one will be relatively short. The next one is likely going to be long.
Lets make a sepia shader! Using the same basic concepts of the black and white shader, we will be able to create a sepia shader. That is because sepia shaders are like yellow versions of a black and white shader. So we can try getting just the red from the black and white shader.
In this tutorial, you will make your first black and white shader.
Make sure you have seen the SHADER BASICS tutorial because we will be building off of things we have already learned.
vertex to fragment
You probably noticed "varying vec2 v_vTexcoord; " in the fragment code. This is a 2 dimension vector from the vertex shader (vec2). This tells the pixel coordinates for each pixel (which I will explain in the SAMPLERS AND TEXTURES section). You should also see "varying vec4 v_vColour;". This is for when you set image_blend on a sprite or draw_vertex_colour in primatives. So if you remove "v_vColour", then changing image_blend on a sprite would make no difference in the shader. We won't really need to mess with these for now.
Hello. I am a shader and game developer. I've been a programmer for about 4 years.
I am going to start a tutorial series on how to make GLSL ES shaders for GameMaker: Studio
What a shader is
Shaders are programs that are executed in the GPU. A shader actually consists of two programs:
the vertex shader and the fragment (or pixel) shader. Shaders are used in games and software as effects to distort or recolor graphics. Shaders can be used for anything from grayscale effects to ripples to lighting engines and much more.