Abstract Specular Light Example

Swipe to Spin the Model

The unusual combination of colors, shapes, and lighting make this example unique. Some might call this a happy accident.

Incorrectly aligned vertex attributes create this example of highlighted brightly colored triangles. Lighting helps define the shapes. Light location, light color, and ambient color are declared with constants in the fragment shader.

As the shapes spin and move, both a model matrix and a normal matrix are uploaded. The vertex shader uses the normal attributes and normal matrix to compute lighting per frame. See more WebGL lighting examples.

Learn 3D Programming with Screen Shots Learn 3D Programming with Screen Shots
Copyright © 2015 Seven Thunder Software. All Rights Reserved.