Shaders/trivial.vert
raw| 1 | // -*-C++-*- |
| 2 | |
| 3 | // Shader that uses OpenGL state values to do per-pixel lighting |
| 4 | // |
| 5 | // The only light used is gl_LightSource[0], which is assumed to be |
| 6 | // directional. |
| 7 | // |
| 8 | // Diffuse colors come from the gl_Color, ambient from the material. This is |
| 9 | // equivalent to osg::Material::DIFFUSE. |
| 10 | #version 120 |
| 11 | #define MODE_OFF 0 |
| 12 | #define MODE_DIFFUSE 1 |
| 13 | #define MODE_AMBIENT_AND_DIFFUSE 2 |
| 14 | |
| 15 | void main() |
| 16 | { |
| 17 | gl_Position = ftransform(); |
| 18 | } |