summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVegard Storheil Eriksen <zyp@jvnv.net>2010-06-30 23:02:08 +0200
committerVegard Storheil Eriksen <zyp@jvnv.net>2010-06-30 23:02:08 +0200
commit727cb49631d92a284fd7fe850022b9bd0e5f3bad (patch)
treea82d48e38d6577f9dd5c740ab1734d35b977edfb
parente2d40c3fb1723eb1dde87248a08f489d26b684f6 (diff)
Shaders won't work on my laptop without Nx4 matrices.
-rw-r--r--shaders/bullet_fragment.glsl4
-rw-r--r--shaders/bullet_vertex.glsl12
2 files changed, 10 insertions, 6 deletions
diff --git a/shaders/bullet_fragment.glsl b/shaders/bullet_fragment.glsl
index 55e29ff..71486ec 100644
--- a/shaders/bullet_fragment.glsl
+++ b/shaders/bullet_fragment.glsl
@@ -1,4 +1,6 @@
-varying mat3 v_tex_rot;
+#version 120
+
+in mat3x4 v_tex_rot;
uniform sampler2D tex;
void main() {
diff --git a/shaders/bullet_vertex.glsl b/shaders/bullet_vertex.glsl
index 0717b0a..96281cd 100644
--- a/shaders/bullet_vertex.glsl
+++ b/shaders/bullet_vertex.glsl
@@ -1,12 +1,14 @@
-varying mat3 v_tex_rot;
+#version 120
+
+varying out mat3x4 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);
+ v_tex_rot = mat3x4(
+ l_direction.x, l_direction.y, 0.0, 0.0,
+ -l_direction.y, l_direction.x, 0.0, 0.0,
+ 1.0 - l_direction.x + l_direction.y, 1.0 - l_direction.y - l_direction.x, 0.0, 0.0);
l_position.zw = vec2(0.0, 1.0);
gl_FrontColor = gl_Color;
gl_Position = gl_ModelViewProjectionMatrix * l_position;