Fix shaders

This commit is contained in:
yunusey
2025-01-02 17:23:01 -05:00
parent 71f678c576
commit 6e7c9c0d50
2 changed files with 2 additions and 15 deletions

View File

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

View File

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