From 906f4882a24423b5743bbaf1b25c8ca9cb9e836a Mon Sep 17 00:00:00 2001 From: griffi-gh Date: Sun, 5 May 2024 00:17:27 +0200 Subject: [PATCH] throw away glsl shaders --- kubi/shaders/colored.frag | 12 ------------ kubi/shaders/colored.vert | 13 ------------- kubi/shaders/colored2.frag | 10 ---------- kubi/shaders/colored2.vert | 9 --------- kubi/shaders/world.frag | 26 -------------------------- kubi/shaders/world.vert | 27 --------------------------- 6 files changed, 97 deletions(-) delete mode 100644 kubi/shaders/colored.frag delete mode 100644 kubi/shaders/colored.vert delete mode 100644 kubi/shaders/colored2.frag delete mode 100644 kubi/shaders/colored2.vert delete mode 100644 kubi/shaders/world.frag delete mode 100644 kubi/shaders/world.vert diff --git a/kubi/shaders/colored.frag b/kubi/shaders/colored.frag deleted file mode 100644 index 7ab85c6..0000000 --- a/kubi/shaders/colored.frag +++ /dev/null @@ -1,12 +0,0 @@ -#version 300 es - -precision highp float; - -out vec4 out_color; -uniform vec4 color; - -void main() { - // discard fully transparent pixels - if (color.w <= 0.) discard; - out_color = color; -} diff --git a/kubi/shaders/colored.vert b/kubi/shaders/colored.vert deleted file mode 100644 index c6b3ef8..0000000 --- a/kubi/shaders/colored.vert +++ /dev/null @@ -1,13 +0,0 @@ -#version 300 es - -precision highp float; - -in vec3 position; -uniform mat4 model; -uniform mat4 perspective; -uniform mat4 view; - -void main() { - mat4 modelview = view * model; - gl_Position = perspective * modelview * vec4(position, 1.); -} diff --git a/kubi/shaders/colored2.frag b/kubi/shaders/colored2.frag deleted file mode 100644 index cddd0d4..0000000 --- a/kubi/shaders/colored2.frag +++ /dev/null @@ -1,10 +0,0 @@ -#version 300 es - -precision highp float; - -out vec4 out_color; -uniform vec4 color; - -void main() { - out_color = color; -} diff --git a/kubi/shaders/colored2.vert b/kubi/shaders/colored2.vert deleted file mode 100644 index db908de..0000000 --- a/kubi/shaders/colored2.vert +++ /dev/null @@ -1,9 +0,0 @@ -#version 300 es - -precision highp float; - -in vec2 position; - -void main() { - gl_Position = vec4(position, 0.0, 1.0); -} diff --git a/kubi/shaders/world.frag b/kubi/shaders/world.frag deleted file mode 100644 index 48d2df0..0000000 --- a/kubi/shaders/world.frag +++ /dev/null @@ -1,26 +0,0 @@ -#version 300 es - -precision highp float; -precision lowp sampler2DArray; - -in vec3 v_normal; -in vec2 v_uv; -flat in uint v_tex_index; -out vec4 color; -uniform sampler2DArray tex; -uniform bool discard_alpha; - -void main() { - // base color from texture - color = texture(tex, vec3(v_uv, v_tex_index)); - - // discard fully transparent pixels - if (discard_alpha ? (color.w < 0.5) : (color.w == 0.)) discard; - - //basic "lighting" - float light = abs(v_normal.x) + .8 * abs(v_normal.y) + .6 * abs(v_normal.z); - color *= vec4(vec3(light), 1.); - - //discard alpha - if (discard_alpha) color.w = 1.; -} diff --git a/kubi/shaders/world.vert b/kubi/shaders/world.vert deleted file mode 100644 index 996a1ec..0000000 --- a/kubi/shaders/world.vert +++ /dev/null @@ -1,27 +0,0 @@ -#version 300 es - -precision highp float; - -//TODO pack this data: -// uint position_normal_uv -// XXYYZZNU -// wehere Normal and Uv are enums -// maybe somehow pack in tex index too - -in vec3 position; -in vec3 normal; -in vec2 uv; -in uint tex_index; -out vec2 v_uv; -out vec3 v_normal; -flat out uint v_tex_index; -uniform vec3 position_offset; -uniform mat4 perspective; -uniform mat4 view; - -void main() { - v_normal = normal; - v_tex_index = tex_index; - v_uv = uv; - gl_Position = perspective * view * vec4(position + position_offset, 1.); -}