varying mat3 v_tex_rot; void main() { vec4 l_position = gl_Vertex; vec2 l_direction = normalize(l_position.zw); v_tex_rot = mat3( l_direction.x, l_direction.y, 0.0, -l_direction.y, l_direction.x, 0.0, 1.0 - l_direction.x + l_direction.y, 1.0 - l_direction.y - l_direction.x, 0.0); l_position.zw = vec2(0.0, 1.0); gl_FrontColor = gl_Color; gl_Position = gl_ModelViewProjectionMatrix * l_position; }