throw away glsl shaders

This commit is contained in:
griffi-gh 2024-05-05 00:17:27 +02:00
parent 535f7d6112
commit eeb650eac0
6 changed files with 0 additions and 97 deletions

View file

@ -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;
}

View file

@ -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.);
}

View file

@ -1,10 +0,0 @@
#version 300 es
precision highp float;
out vec4 out_color;
uniform vec4 color;
void main() {
out_color = color;
}

View file

@ -1,9 +0,0 @@
#version 300 es
precision highp float;
in vec2 position;
void main() {
gl_Position = vec4(position, 0.0, 1.0);
}

View file

@ -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.;
}

View file

@ -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.);
}