In this tutorial, we take the code from the previous tutorial and modify it to support fragment shaders. The fragment shader is run for each fragment during the render process. The result of the fragment shader's calculations is used as the "color" of the pixel. It can be used to calculate things like lighting and texture mapping.
Github: https://github.com/youngbrycecode/Ren...
Feel free to check out some of my other projects as well :D
There are a few interesting ones that will have videos at some point in the future.
Chapters:
0:00 Introduction
0:31 Rework pipeline
7:17 Implementing fragment shader
Overview:
1. Implement the derivation of the fragment shader base class to support our new fragment shader.
2. To the shader program, create a set of buffers used for interpolating attribute values.
3. Interpolate the values and pass to fragment shader
4. Replace current rendered fragment with the result of the fragment shader