Normal Map with Fragment Shader
Swipe to Rotate the Checkered Capsule
Directional Light and Shadow
This WebGL example applies a normal map to a capsule. Swipe to rotate the capsule. The fragment shader calculates light and shadow. Upload a texture map rather than vertices, to the GPU. The red, green, and blue values represent X, Y, and Z normal coordinates.