diff options
| author | Alex Pickering <alex@cogarr.net> | 2026-02-01 13:14:32 -0600 |
|---|---|---|
| committer | Alexander M Pickering <alex@cogarr.net> | 2026-02-01 13:14:32 -0600 |
| commit | 3a975db66a3711f34e8b64bb27a8eaca79fdeca9 (patch) | |
| tree | fcc12f8f9d638ff575c1963796de76b7628854b4 /src/shaders/player.vert | |
| download | ggj26-3a975db66a3711f34e8b64bb27a8eaca79fdeca9.tar.gz ggj26-3a975db66a3711f34e8b64bb27a8eaca79fdeca9.tar.bz2 ggj26-3a975db66a3711f34e8b64bb27a8eaca79fdeca9.zip | |
Diffstat (limited to 'src/shaders/player.vert')
| -rw-r--r-- | src/shaders/player.vert | 23 |
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); +} |
