aboutsummaryrefslogtreecommitdiff
path: root/src/shaders/world.vert.back
diff options
context:
space:
mode:
authorAlex Pickering <alex@cogarr.net>2026-02-01 13:14:32 -0600
committerAlexander M Pickering <alex@cogarr.net>2026-02-01 13:14:32 -0600
commit3a975db66a3711f34e8b64bb27a8eaca79fdeca9 (patch)
treefcc12f8f9d638ff575c1963796de76b7628854b4 /src/shaders/world.vert.back
downloadggj26-3a975db66a3711f34e8b64bb27a8eaca79fdeca9.tar.gz
ggj26-3a975db66a3711f34e8b64bb27a8eaca79fdeca9.tar.bz2
ggj26-3a975db66a3711f34e8b64bb27a8eaca79fdeca9.zip
Initial commitHEADmaster
Diffstat (limited to 'src/shaders/world.vert.back')
-rw-r--r--src/shaders/world.vert.back26
1 files changed, 26 insertions, 0 deletions
diff --git a/src/shaders/world.vert.back b/src/shaders/world.vert.back
new file mode 100644
index 0000000..42276fe
--- /dev/null
+++ b/src/shaders/world.vert.back
@@ -0,0 +1,26 @@
+precision highp float;
+attribute vec3 world; // position
+attribute vec2 texuv;
+attribute float r; // for round objects, 0 for non-round
+varying vec2 textureuv;
+varying float radius;
+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 = clamp(world.z * vxy.x * z_scale, -32., 32.);
+ float yoff = clamp(world.z * vxy.y * z_scale, -32., 32.);
+ textureuv=texuv;
+ //radius = r;
+ // if z > 0 then
+ // xoff = ceil(xoff, 0)
+ // add to the z coord so we don't intersect with the ui
+ gl_Position = P * MV * vec4(vxy.x + xoff, vxy.y + yoff, -world.z -1., 1.0);
+}