From 3971dda001cba9c7dc67e86bc0b54a2c7568578f Mon Sep 17 00:00:00 2001 From: aap Date: Fri, 15 May 2020 13:34:19 +0200 Subject: [PATCH] fixed matfx matrix --- src/d3d/d3d9matfx.cpp | 1 + src/gl/gl3matfx.cpp | 1 + 2 files changed, 2 insertions(+) diff --git a/src/d3d/d3d9matfx.cpp b/src/d3d/d3d9matfx.cpp index 2970a7f..87873ef 100644 --- a/src/d3d/d3d9matfx.cpp +++ b/src/d3d/d3d9matfx.cpp @@ -86,6 +86,7 @@ uploadEnvMatrix(Frame *frame) RawMatrix envMtx, invMtx; Matrix::invert(&invMat, frame->getLTM()); convMatrix(&invMtx, &invMat); + invMtx.pos.set(0.0f, 0.0f, 0.0f); RawMatrix::mult(&envMtx, &invMtx, &normal2texcoord); d3ddevice->SetVertexShaderConstantF(VSLOC_texMat, (float*)&envMtx, 4); } diff --git a/src/gl/gl3matfx.cpp b/src/gl/gl3matfx.cpp index 3734f3a..cb0614d 100644 --- a/src/gl/gl3matfx.cpp +++ b/src/gl/gl3matfx.cpp @@ -118,6 +118,7 @@ uploadEnvMatrix(Frame *frame) RawMatrix invMtx; Matrix::invert(&invMat, frame->getLTM()); convMatrix(&invMtx, &invMat); + invMtx.pos.set(0.0f, 0.0f, 0.0f); RawMatrix::mult(&envMtx, &invMtx, &normal2texcoord); } glUniformMatrix4fv(U(u_texMatrix), 1, GL_FALSE, (float*)&envMtx);