diff --git a/source/glbackend/gl_shader.cpp b/source/glbackend/gl_shader.cpp index abdce6c65..88c9913bc 100644 --- a/source/glbackend/gl_shader.cpp +++ b/source/glbackend/gl_shader.cpp @@ -165,9 +165,15 @@ bool PolymostShader::Load(const char * name, const char * vert_prog, const char GlowMatrix.Init(hShader, "u_glowMatrix"); TextureMatrix.Init(hShader, "u_textureMatrix"); + glUseProgram(hShader); + VSMatrix identity(0); + TextureMatrix.Set(identity.get()); + DetailMatrix.Set(identity.get()); + GlowMatrix.Set(identity.get()); + int SamplerLoc; SamplerLoc = glGetUniformLocation(hShader, "s_texture"); glUniform1i(SamplerLoc, 0); diff --git a/wadsrc/static/demolition/shaders/glsl/polymost.vp b/wadsrc/static/demolition/shaders/glsl/polymost.vp index 7a203943c..a46ca3a1a 100644 --- a/wadsrc/static/demolition/shaders/glsl/polymost.vp +++ b/wadsrc/static/demolition/shaders/glsl/polymost.vp @@ -13,6 +13,7 @@ uniform mat4 u_modelMatrix; uniform mat4 u_projectionMatrix; uniform mat4 u_detailMatrix; uniform mat4 u_glowMatrix; +uniform mat4 u_textureMatrix; in vec4 i_vertPos; in vec4 i_texCoord; @@ -30,9 +31,7 @@ void main() eyeCoordPosition.xyz /= eyeCoordPosition.w; - v_texCoord = i_texCoord; - //gl_TexCoord[0] = mix(gl_TexCoord[0].xyzw, gl_TexCoord[0].yxzw, u_usePalette); WTF is this??? - + v_texCoord = u_textureMatrix * i_texCoord; v_detailCoord = u_detailMatrix * i_texCoord; v_glowCoord = u_glowMatrix * i_texCoord;