A fragment shader is ran once for every pixel contained in-between your geometry's vertices. Its purpose is to color in your mesh so you can actually see what it is you are rendering.
To create a fragment shader, you must assign a vec4
RGBA
value to an attribute called gl_FragColor
.
Start by adding in the gl_FragColor
attribute and assign it a vec4
with an R
value of 1.0
, a G
value of 0
, and B
value of 0
, and an A
value of 1.0
.