summaryrefslogtreecommitdiff
path: root/src/shaders/player.vert
diff options
context:
space:
mode:
Diffstat (limited to 'src/shaders/player.vert')
-rw-r--r--src/shaders/player.vert23
1 files changed, 23 insertions, 0 deletions
diff --git a/src/shaders/player.vert b/src/shaders/player.vert
new file mode 100644
index 0000000..ce53bf5
--- /dev/null
+++ b/src/shaders/player.vert
@@ -0,0 +1,23 @@
+precision highp float;
+attribute vec3 player;
+attribute vec2 texuv;
+varying vec2 textureuv;
+attribute vec4 lamp1; //vec3 position, float strength
+attribute vec4 lamp2;
+attribute vec4 lamp3; // max 3 lamps per shaded player
+uniform float time; //used for noise
+uniform float world_x;
+uniform float world_y;
+uniform float dir;
+uniform mat4 MV;
+uniform mat4 P;
+void main() {
+ textureuv=texuv;
+ mat2 rotate = mat2(
+ cos(dir), -sin(dir),
+ sin(dir), cos(dir)
+ );
+ vec2 world = vec2(world_x, world_y);
+ vec2 local = (player.xy - world) * rotate;
+ gl_Position = P * MV * vec4(local.xy, -2, 1.0);
+}