fixed matfx matrix

This commit is contained in:
aap 2020-05-15 13:34:19 +02:00
parent d541301588
commit 3971dda001
2 changed files with 2 additions and 0 deletions

View File

@ -86,6 +86,7 @@ uploadEnvMatrix(Frame *frame)
RawMatrix envMtx, invMtx; RawMatrix envMtx, invMtx;
Matrix::invert(&invMat, frame->getLTM()); Matrix::invert(&invMat, frame->getLTM());
convMatrix(&invMtx, &invMat); convMatrix(&invMtx, &invMat);
invMtx.pos.set(0.0f, 0.0f, 0.0f);
RawMatrix::mult(&envMtx, &invMtx, &normal2texcoord); RawMatrix::mult(&envMtx, &invMtx, &normal2texcoord);
d3ddevice->SetVertexShaderConstantF(VSLOC_texMat, (float*)&envMtx, 4); d3ddevice->SetVertexShaderConstantF(VSLOC_texMat, (float*)&envMtx, 4);
} }

View File

@ -118,6 +118,7 @@ uploadEnvMatrix(Frame *frame)
RawMatrix invMtx; RawMatrix invMtx;
Matrix::invert(&invMat, frame->getLTM()); Matrix::invert(&invMat, frame->getLTM());
convMatrix(&invMtx, &invMat); convMatrix(&invMtx, &invMat);
invMtx.pos.set(0.0f, 0.0f, 0.0f);
RawMatrix::mult(&envMtx, &invMtx, &normal2texcoord); RawMatrix::mult(&envMtx, &invMtx, &normal2texcoord);
} }
glUniformMatrix4fv(U(u_texMatrix), 1, GL_FALSE, (float*)&envMtx); glUniformMatrix4fv(U(u_texMatrix), 1, GL_FALSE, (float*)&envMtx);