/* * Vertex shader for a "film grain" function. Just passes along the * vertex position for the fragment shader. * * Alexandri Zavodny, Fall 2010 * for CSE 40166/60166 Computer Graphics, University of Notre Dame */ uniform float time; varying vec4 vertexInImageSpace; void main() { vec4 transformedVertex = gl_ModelViewMatrix * gl_Vertex; //not sure if you can access the vertex position in the fragment shader, //so be safe and pass that along as a varying. don't normalize! vertexInImageSpace = gl_ModelViewProjectionMatrix * gl_Vertex; gl_Position = ftransform(); }