From 61968c63413061004ece153d7e1a6aee7f760f73 Mon Sep 17 00:00:00 2001 From: Bastien Bouclet Date: Tue, 11 Feb 2014 20:11:23 +0100 Subject: [PATCH] MYST3: Explain the texture size workaround used in the ES2 renderer --- engines/myst3/gfx_opengl_shaders.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/engines/myst3/gfx_opengl_shaders.cpp b/engines/myst3/gfx_opengl_shaders.cpp index 086df3ff6b8..1788258f93b 100644 --- a/engines/myst3/gfx_opengl_shaders.cpp +++ b/engines/myst3/gfx_opengl_shaders.cpp @@ -347,6 +347,14 @@ void ShaderRenderer::drawCube(Texture **textures) { glEnable(GL_TEXTURE_2D); glDepthMask(GL_FALSE); + // WORKAROUND: The texture scale is set to a slightly incorrect value below, + // (the "texture0->width - 1" part should be just "texture0->width"), in order + // to work around a white line appearing along the edges of the cube due + // enabling linear filtering on partially used textures, resulting in the + // unused part leaking into the used part. + // FIXME: This causes a very subtle misalignment between the videos blended + // into the scenes and the background. + _cube_shader->use(); _cube_shader->setUniform1f("verScale", 256.0f); _cube_shader->setUniform1f("texScale", (texture0->width - 1) / (float) texture0->internalWidth);