7. • Runs per input vertex.
• Transform 3D into 2D (screen space) position.
• Can perform vertex position, color ,UV
(texture coordinates) manipulation.
• Cannot create new vertices.
• Cannot “see” other vertices.
8.
9. • Runs per fragment.
• Computes fragment’s color.
• With fragment shader you can create: bump
mapping, shadows, lights, post processing
effects and other cool shit.
• See http://glsl.heroku.com/
12. CG Shader
• “C for graphics”
• High Level language.
Cg != C
• No classes, pointers, malloc , IO etc.
• Cg has loops, conditionals, functions/overloads.
• Member variables, local (temporary) variables constants.
• Data types: numeric primitives, vectors, matrices, arrays, structs,
and interfaces.
• Built-in trig and other math methods.
• Static & Dynamic compilation.