From f9d4ac2771dbf2405ba94331fc3c5229d71cb291 Mon Sep 17 00:00:00 2001 From: Alibek Omarov Date: Thu, 30 Jan 2025 18:52:26 +0300 Subject: [PATCH] ref: gl: fix ugly seam at the skybox, thanks Spoike for help --- ref/gl/gl_warp.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/ref/gl/gl_warp.c b/ref/gl/gl_warp.c index 05fa1495..34d05a71 100644 --- a/ref/gl/gl_warp.c +++ b/ref/gl/gl_warp.c @@ -247,8 +247,16 @@ static void MakeSkyVec( float s, float t, int axis ) s = (s + 1.0f) * 0.5f; t = (t + 1.0f) * 0.5f; - s = bound( 1.0f / 512.0f, s, 511.0f / 512.0f ); - t = bound( 1.0f / 512.0f, t, 511.0f / 512.0f ); + if( GL_Support( GL_CLAMPTOEDGE_EXT )) + { + s = bound( 0.0f, s, 1.0f ); + t = bound( 0.0f, t, 1.0f ); + } + else + { + s = bound( 1.0f / 512.0f, s, 511.0f / 512.0f ); + t = bound( 1.0f / 512.0f, t, 511.0f / 512.0f ); + } t = 1.0f - t;