diff options
Diffstat (limited to 'src/GPU_OpenGL_shaders.h')
-rw-r--r-- | src/GPU_OpenGL_shaders.h | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/GPU_OpenGL_shaders.h b/src/GPU_OpenGL_shaders.h index 20ac767..03ddb7a 100644 --- a/src/GPU_OpenGL_shaders.h +++ b/src/GPU_OpenGL_shaders.h @@ -40,6 +40,7 @@ void main() const char* kCompositorFS_Nearest = R"(#version 140 uniform uint u3DScale; +uniform int u3DXPos; uniform usampler2D ScreenTex; uniform sampler2D _3DTex; @@ -52,6 +53,8 @@ void main() { ivec4 pixel = ivec4(texelFetch(ScreenTex, ivec2(fTexcoord), 0)); + float _3dxpos = float(u3DXPos); + ivec4 mbright = ivec4(texelFetch(ScreenTex, ivec2(256*3, int(fTexcoord.y)), 0)); int dispmode = mbright.b & 0x3; @@ -68,7 +71,7 @@ void main() { // 3D on top, blending - float xpos = val3.r + fract(fTexcoord.x); + float xpos = fTexcoord.x + _3dxpos; float ypos = mod(fTexcoord.y, 192); ivec4 _3dpix = ivec4(texelFetch(_3DTex, ivec2(vec2(xpos, ypos)*u3DScale), 0).bgra * vec4(63,63,63,31)); @@ -89,7 +92,7 @@ void main() { // 3D on bottom, blending - float xpos = val3.r + fract(fTexcoord.x); + float xpos = fTexcoord.x + _3dxpos; float ypos = mod(fTexcoord.y, 192); ivec4 _3dpix = ivec4(texelFetch(_3DTex, ivec2(vec2(xpos, ypos)*u3DScale), 0).bgra * vec4(63,63,63,31)); @@ -109,7 +112,7 @@ void main() { // 3D on top, normal/fade - float xpos = val3.r + fract(fTexcoord.x); + float xpos = fTexcoord.x + _3dxpos; float ypos = mod(fTexcoord.y, 192); ivec4 _3dpix = ivec4(texelFetch(_3DTex, ivec2(vec2(xpos, ypos)*u3DScale), 0).bgra * vec4(63,63,63,31)); |