/************************************************************* GLSL Demo - Per-vertex cube mapping vertex shader (c) 2005 Antoine Bouthors, EVASION *************************************************************/ void main() { vec4 pos = gl_ModelViewMatrix * gl_Vertex; vec3 normal = gl_NormalMatrix * gl_Normal; vec3 view = -pos.xyz; normal = normalize( normal ); view = normalize( view ); vec3 reflex = reflect( view, normal ); gl_TexCoord[0].xyz = mat3(gl_TextureMatrix[0]) * reflex; gl_Position = ftransform(); }