Two Kinds of Shaders
- Vertex Shaders
- Fragment Shaders
Vertex Shaders
CSS specifies mesh resolution, laid over HTML content
Vertex shader called for each mesh vertex
Named parameters can be passed into shader
Shader calculates new 3D position of each mesh vertex
Calculated varyings can be passed to fragment shader
Animating a CSS Shader
Mouse over the tree...
Fragment Shaders
CSS specifies named parameters, blend mode and compositing method
Varyingx calculated in vertex shaders passed in as well
Fragment shader called for every pixel
New color or Mix color is calculated
Plasma Tree
Plasma shader adapted from work done by Viktor Korsun
Combining Vertex & Fragment Shaders
3D Page Curl With Lighting & Shading
Mouse over the page to start page curl