From d2ff14758d73e6911c746fd0e31408319163f573 Mon Sep 17 00:00:00 2001 From: yunusey Date: Thu, 2 Jan 2025 17:23:01 -0500 Subject: [PATCH] Fix shaders --- src/renderer/shaders/bgimage.f.glsl | 11 +---------- src/renderer/shaders/bgimage.v.glsl | 6 +----- 2 files changed, 2 insertions(+), 15 deletions(-) diff --git a/src/renderer/shaders/bgimage.f.glsl b/src/renderer/shaders/bgimage.f.glsl index 9074c99186..6598255380 100644 --- a/src/renderer/shaders/bgimage.f.glsl +++ b/src/renderer/shaders/bgimage.f.glsl @@ -1,12 +1,6 @@ #version 330 core -const uint MODE_ZOOMED = 0u; -const uint MODE_STRETCHED = 1u; -const uint MODE_TILED = 2u; -const uint MODE_CENTERED = 3u; - in vec2 tex_coord; -flat in uint mode; layout(location = 0) out vec4 out_FragColor; @@ -14,11 +8,8 @@ uniform sampler2D image; uniform float opacity; void main() { - // Normalize the coordinate if we are tiling + // Normalize the coordinates vec2 norm_coord = tex_coord; - // if (mode == MODE_TILED) { - // norm_coord = fract(tex_coord); - // } norm_coord = fract(tex_coord); vec4 color = texture(image, norm_coord); out_FragColor = vec4(color.rgb * color.a * opacity, color.a * opacity); diff --git a/src/renderer/shaders/bgimage.v.glsl b/src/renderer/shaders/bgimage.v.glsl index 0677d4a54d..8fe9bb28b6 100644 --- a/src/renderer/shaders/bgimage.v.glsl +++ b/src/renderer/shaders/bgimage.v.glsl @@ -6,18 +6,14 @@ const uint MODE_TILED = 2u; const uint MODE_CENTERED = 3u; layout (location = 0) in vec2 terminal_size; -layout (location = 1) in uint mode_in; +layout (location = 1) in uint mode; out vec2 tex_coord; -flat out uint mode; uniform sampler2D image; uniform mat4 projection; void main() { - // Set mode so that we can use it in the fragment shader - mode = mode_in; - // Calculate the position of the image vec2 position; position.x = (gl_VertexID == 0 || gl_VertexID == 1) ? 1. : 0.;