diff options
| author | Alexander M Pickering <alex@cogarr.net> | 2025-01-09 18:11:46 -0600 |
|---|---|---|
| committer | Alexander M Pickering <alex@cogarr.net> | 2025-01-09 18:11:46 -0600 |
| commit | decb72f936060a65bff18e9cbf33642ea3a71cd0 (patch) | |
| tree | 3b07bb1bfc1e4f0e39ec4ff8e0c243cd4fab0d61 /src/shaders/world.vert | |
| parent | 726876d42270f8974fd495be91127ea7585472ff (diff) | |
| download | ggj25-decb72f936060a65bff18e9cbf33642ea3a71cd0.tar.gz ggj25-decb72f936060a65bff18e9cbf33642ea3a71cd0.tar.bz2 ggj25-decb72f936060a65bff18e9cbf33642ea3a71cd0.zip | |
Work
Diffstat (limited to 'src/shaders/world.vert')
| -rw-r--r-- | src/shaders/world.vert | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/src/shaders/world.vert b/src/shaders/world.vert new file mode 100644 index 0000000..0e6747a --- /dev/null +++ b/src/shaders/world.vert @@ -0,0 +1,22 @@ +precision highp float; +attribute vec3 world; // position +attribute vec2 texuv; +varying vec2 textureuv; +varying mat3 light1; +uniform vec4 color; +varying vec4 v_color; +uniform float world_x; +uniform float world_y; +uniform mat4 MV; +uniform mat4 P; +void main() { + v_color = vec4(world.xyz,1.); + vec2 vxy = vec2(world.x - world_x, world.y - world_y); + float z_scale = 0.5; + float xoff = world.z * vxy.x * z_scale; + float yoff = world.z * vxy.y * z_scale; + textureuv=texuv; + // if z > 0 then + // xoff = ceil(xoff, 0) + gl_Position = P * MV * vec4(vxy.x + xoff, vxy.y + yoff, 0., 1.0); +} |
