vtgl

terminal emulator implemented in OpenGL
git clone anongit@rnpnr.xyz:vtgl.git
Log | Files | Refs | Feed | LICENSE

Commit: 8646b356c1342c833c6dae3c25653b051b7b5d17
Parent: 3d127a8b48b808b9437a6bac542233daae212af3
Author: Randy Palamar
Date:   Sun, 20 Oct 2024 20:46:20 -0600

drop second vertex shader

Diffstat:
Mfrag_post.glsl | 22++++++++++------------
Mmain.c | 4++--
Rvert_render.glsl -> vert_for_rects.glsl | 0
Dvert_post.glsl | 20--------------------
4 files changed, 12 insertions(+), 34 deletions(-)

diff --git a/frag_post.glsl b/frag_post.glsl @@ -1,22 +1,20 @@ -#version 460 core +#version 430 core -out vec4 colour; +layout(location = 0) in vec2 pixel_coord; +layout(location = 1) in vec2 texture_coord; -in VS_OUT { - vec2 tex_coord; -} fs_in; +layout(location = 0) out vec4 colour; -uniform sampler2D u_texslot; -uniform float u_param; +layout(location = 3) uniform sampler2D u_texslot; +layout(location = 4) uniform float u_param; void main() { - vec2 tex_coord = fs_in.tex_coord; - - if (mod(tex_coord.y + u_param, 0.005) < 0.0005) { + //if (mod(tex_coord.y + u_param, 0.005) < 0.0005) { + if (false) { vec4 tint = vec4(0.1, 0.1, 0.1, 1); - colour = mix(texture(u_texslot, tex_coord), tint, 0.5); + colour = mix(texture(u_texslot, texture_coord), tint, 0.5); } else { - colour = texture(u_texslot, tex_coord); + colour = texture(u_texslot, texture_coord); } } diff --git a/main.c b/main.c @@ -233,8 +233,8 @@ program_from_shader_text(s8 vertex, s8 fragment, Arena a) static void check_shaders(GLCtx *gl, Arena a) { - static char *fs_name[SHADER_LAST] = {"/home/rnp/src/c/vtgl/frag_render.glsl", "/home/rnp/src/c/vtgl/frag_post.glsl"}; - static char *vs_name[SHADER_LAST] = {"/home/rnp/src/c/vtgl/vert_render.glsl", "/home/rnp/src/c/vtgl/vert_post.glsl"}; + static char *fs_name[SHADER_LAST] = {"frag_render.glsl", "frag_post.glsl"}; + static char *vs_name[SHADER_LAST] = {"vert_for_rects.glsl", "vert_for_rects.glsl"}; static os_file_stats fs_stats[SHADER_LAST], vs_stats[SHADER_LAST]; static struct { char *name; diff --git a/vert_render.glsl b/vert_for_rects.glsl diff --git a/vert_post.glsl b/vert_post.glsl @@ -1,20 +0,0 @@ -#version 460 core - -in vec2 position; - -uniform mat4 u_Pmat; -uniform vec2 u_vertscale; - -out VS_OUT { - vec2 tex_coord; -} vs_out; - -void main() -{ - vec2 pos = position.xy; - vec2 scale = u_vertscale; - - gl_Position = u_Pmat * vec4(pos * scale, 0.0, 1.0); - - vs_out.tex_coord = pos; -}