summaryrefslogtreecommitdiff
path: root/shaders/bullet_vertex.glsl
blob: 0717b0a9f69a1de3effb9307ae1c587edd41f50d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
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;
}