From a8fbd82a3d0dba74c354243cce09b5927b6c1f8e Mon Sep 17 00:00:00 2001 From: Thomas Harte Date: Sun, 17 Apr 2016 17:21:24 -0400 Subject: [PATCH] Made an attempt at correctly mapping to eye coordinates. --- Outputs/CRT/Internals/CRTOpenGL.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Outputs/CRT/Internals/CRTOpenGL.cpp b/Outputs/CRT/Internals/CRTOpenGL.cpp index 3b93a5760..947af265b 100644 --- a/Outputs/CRT/Internals/CRTOpenGL.cpp +++ b/Outputs/CRT/Internals/CRTOpenGL.cpp @@ -359,7 +359,8 @@ char *OpenGLOutputBuilder::get_input_vertex_shader() "ivec2 textureSize = textureSize(texID, 0);" "inputPositionVarying = vec2(inputPosition.x / textureSize.x, (inputPosition.y + 0.5) / textureSize.y);" - "gl_Position = vec4(outputPosition / outputTextureSize, 0.0, 1.0);" + "vec2 eyePosition = 2.0*(outputPosition / outputTextureSize) - vec2(1.0);" + "gl_Position = vec4(eyePosition, 0.0, 1.0);" "phaseVarying = (phaseCyclesPerTick * phaseTime + phaseAndAmplitude.x) * 2.0 * 3.141592654;" "}"); }