Commit: 0ca8f70944743bbaca2d670517c25117fa7b1607
Parent: bc11f49e246f4e64e536cc304c2dd888ebafb50a
Author: Randy Palamar
Date: Mon, 13 Jan 2025 16:04:58 -0700
ui: work around raylib's texture filtering
The default texture wrapping in raylib is GL_REPEAT and even if
you are just trying to draw the whole texture their code can cause
sampling just outside the edge. This results in a 1 pixel glitch
on the each of the far texture edges when drawing.
Diffstat:
1 file changed, 4 insertions(+), 0 deletions(-)
diff --git a/beamformer.c b/beamformer.c
@@ -97,6 +97,10 @@ alloc_output_image(BeamformerCtx *ctx, uv4 output_dim)
//SetTextureFilter(ctx->fsctx.output.texture, TEXTURE_FILTER_ANISOTROPIC_8X);
//SetTextureFilter(ctx->fsctx.output.texture, TEXTURE_FILTER_TRILINEAR);
SetTextureFilter(ctx->fsctx.output.texture, TEXTURE_FILTER_BILINEAR);
+
+ /* NOTE(rnp): work around raylib's janky texture sampling */
+ glTextureParameteri(ctx->fsctx.output.texture.id, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
+ glTextureParameteri(ctx->fsctx.output.texture.id, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
}
}