vtgl

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

Commit: 21b785b9f39cd95de0783feb0a955257c47b16cb
Parent: d5c18740ce9988bee7af4361631a1bc663864372
Author: Randy Palamar
Date:   Sun,  8 Dec 2024 16:38:26 -0700

fix cell glyph sampling

glsl mod() seems to compute with floating point even when both
args are integer and this introduces error. For certain cell sizes
this would result in sampling outside the cell which would show up
as a rendering glitch.

Diffstat:
Mfrag_render.glsl | 2+-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/frag_render.glsl b/frag_render.glsl @@ -56,7 +56,7 @@ void main() ivec2 pixel_coord = ivec2(gl_FragCoord.xy) - top_left_margin; ivec2 cell_index = pixel_coord / cell_size; - ivec2 cell_pos = ivec2(mod(pixel_coord, cell_size)); + ivec2 cell_pos = pixel_coord % cell_size; vec3 result; if (pixel_coord.x > 0 && cell_index.x < term_size_in_cells.x &&