From 72920bb763c73a761992391568ad418750070c7c Mon Sep 17 00:00:00 2001 From: Arisotura Date: Thu, 16 May 2019 22:04:27 +0200 Subject: [PATCH] fix 3D on bottom screen --- src/libui_sdl/main_shaders.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/libui_sdl/main_shaders.h b/src/libui_sdl/main_shaders.h index b6020136..85ff794c 100644 --- a/src/libui_sdl/main_shaders.h +++ b/src/libui_sdl/main_shaders.h @@ -89,7 +89,8 @@ void main() if ((top.a & 0x40) != 0) { float xpos = top.r + fract(fTexcoord.x); - uvec4 _3dpix = uvec4(texelFetch(_3DTex, ivec2(vec2(xpos, fTexcoord.y)*u3DScale), 0).bgra + float ypos = mod(fTexcoord.y, 768); + uvec4 _3dpix = uvec4(texelFetch(_3DTex, ivec2(vec2(xpos, ypos)*u3DScale), 0).bgra * vec4(63,63,63,31)); if (_3dpix.a > 0) { top = _3dpix; top.a |= 0x40; bot = mid; } @@ -98,7 +99,8 @@ void main() else if ((mid.a & 0x40) != 0) { float xpos = mid.r + fract(fTexcoord.x); - uvec4 _3dpix = uvec4(texelFetch(_3DTex, ivec2(vec2(xpos, fTexcoord.y)*u3DScale), 0).bgra + float ypos = mod(fTexcoord.y, 768); + uvec4 _3dpix = uvec4(texelFetch(_3DTex, ivec2(vec2(xpos, ypos)*u3DScale), 0).bgra * vec4(63,63,63,31)); if (_3dpix.a > 0) { bot = _3dpix; bot.a |= 0x40; }