A shader programme is dedicated computer programme that runs in the graphics processing u...
A shader programme is dedicated computer programme that runs in the graphics processing unit (GPU). Whenever we draw an object within our scene, we have to possess a shader programme allowed that defines how to modify the object into the proper location on our drawing surface, and how to color the area. In WebGL, shader programmes are made from 2 separate parts, which we create.
- 1 vertex shader, which describes how to transform the vertex positions of an object in 3d space, and ultimately onto the 2d canvas area.
- 1 fragment shader, which describes how to colour each pixel-sized fragment of the final 2d geometry. Because objects can overlap, we will often draw several fragments on top of each other before deciding the colour of the pixel.