From b96dd6c42142fcd1683e5349480ecd0286522c8f Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Tue, 2 Sep 2014 10:31:48 +0200 Subject: [PATCH] - fixed: The missing fourth component of the texture coordinate must be filled with 1.0, not 0.0 before applying the texture matrix. Not doing so will cancel out the translation part of the matrix. --- src/gl/scene/gl_flats.cpp | 8 ++++---- wadsrc/static/shaders/glsl/main.vp | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/gl/scene/gl_flats.cpp b/src/gl/scene/gl_flats.cpp index 0bd4d9eb5..ec442294a 100644 --- a/src/gl/scene/gl_flats.cpp +++ b/src/gl/scene/gl_flats.cpp @@ -70,7 +70,7 @@ // information // //========================================================================== - +static float tics; void gl_SetPlaneTextureRotation(const GLSectorPlane * secplane, FMaterial * gltexture) { // only manipulate the texture matrix if needed. @@ -80,8 +80,8 @@ void gl_SetPlaneTextureRotation(const GLSectorPlane * secplane, FMaterial * glte gltexture->TextureWidth() != 64 || gltexture->TextureHeight() != 64) { - float uoffs=FIXED2FLOAT(secplane->xoffs)/gltexture->TextureWidth(); - float voffs=FIXED2FLOAT(secplane->yoffs)/gltexture->TextureHeight(); + float uoffs = FIXED2FLOAT(secplane->xoffs) / gltexture->TextureWidth(); + float voffs = FIXED2FLOAT(secplane->yoffs) / gltexture->TextureHeight(); float xscale1=FIXED2FLOAT(secplane->xscale); float yscale1=FIXED2FLOAT(secplane->yscale); @@ -328,7 +328,7 @@ void GLFlat::Draw(int pass, bool trans) // trans only has meaning for GLPASS_LIG int rel = getExtraLight(); #ifdef _DEBUG - if (sector->sectornum == 2) + if (sector->sectornum == 130) { int a = 0; } diff --git a/wadsrc/static/shaders/glsl/main.vp b/wadsrc/static/shaders/glsl/main.vp index 16c3c8738..86fad75cc 100644 --- a/wadsrc/static/shaders/glsl/main.vp +++ b/wadsrc/static/shaders/glsl/main.vp @@ -39,7 +39,7 @@ void main() vec2 sst = vec2(r.x/m + 0.5, r.y/m + 0.5); vTexCoord.xy = sst; #else - vTexCoord = TextureMatrix * vec4(aTexCoord, 0.0, 0.0); + vTexCoord = TextureMatrix * vec4(aTexCoord, 0.0, 1.0); #endif gl_Position = ProjectionMatrix * eyeCoordPos;