5. Using Colors and Texture Images

Chapter Overview:

Building on the basics described in previous chapters, you now delve a little further into

WebGL by exploring the following three subjects: (1) besides passing vertex coordinates,

how to pass other data such as color information to the vertex shader; (2) the conver-

sion from a shape to fragments that takes place between the vertex shader and the frag-

ment shader, which is known as the rasterization process; and (3) how to map images (or

textures) onto the surfaces of a shape or object. This chapter is the final chapter focusing

on the key functionalities of WebGL.

1. MultiAttributeSize

2. MultiAttributeSize_Interleaved

3. MultiAttributeColor

4. ColoredTriangle

5. HelloTriangle_FragCoord

6. TexturedQuad

7. TexturedQuad_Repeat

8. TexturedQuad_Clamp_Mirror

9. MultiTexture