mirror of https://github.com/aap/librw.git
fixed matfx matrix
This commit is contained in:
parent
d541301588
commit
3971dda001
|
@ -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);
|
||||||
}
|
}
|
||||||
|
|
|
@ -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);
|
||||||
|
|
Loading…
Reference in New Issue