diff options
| author | Preston Smith <preston.s1993@gmail.com> | 2016-03-13 03:38:44 -0400 |
|---|---|---|
| committer | Preston Smith <preston.s1993@gmail.com> | 2016-08-30 18:33:24 -0500 |
| commit | 767f56d7c8294e0af6163065714f46d9794d9002 (patch) | |
| tree | 34ff0496519bbff91121767a472b464a234e46a8 /Source/Core/VideoBackends/Software/TransformUnit.cpp | |
| parent | 5a6b876dbdc056d6a29229e24a6e8bfeee1b8334 (diff) | |
Software renderer fix
Diffstat (limited to 'Source/Core/VideoBackends/Software/TransformUnit.cpp')
| -rw-r--r-- | Source/Core/VideoBackends/Software/TransformUnit.cpp | 25 |
1 files changed, 21 insertions, 4 deletions
diff --git a/Source/Core/VideoBackends/Software/TransformUnit.cpp b/Source/Core/VideoBackends/Software/TransformUnit.cpp index 57492cc326..0ab93ce106 100644 --- a/Source/Core/VideoBackends/Software/TransformUnit.cpp +++ b/Source/Core/VideoBackends/Software/TransformUnit.cpp @@ -147,14 +147,14 @@ static void TransformTexCoordRegular(const TexMtxInfo& texinfo, int coordNum, bo MultiplyVec3Mat34(*src, mat, *dst); } + // normalize + const PostMtxInfo& postInfo = xfmem.postMtxInfo[coordNum]; + const float* postMat = &xfmem.postMatrices[postInfo.index * 4]; + if (xfmem.dualTexTrans.enabled) { Vec3 tempCoord; - // normalize - const PostMtxInfo& postInfo = xfmem.postMtxInfo[coordNum]; - const float* postMat = &xfmem.postMatrices[postInfo.index * 4]; - if (specialCase) { // no normalization @@ -177,6 +177,23 @@ static void TransformTexCoordRegular(const TexMtxInfo& texinfo, int coordNum, bo MultiplyVec3Mat34(tempCoord, postMat, *dst); } } + + // TODO write comment + if(dst->z == 0.0f) + { + if(mat[8] != 0.0f || (xfmem.dualTexTrans.enabled && postMat[8] != 0.0f) || + mat[9] != 0.0f || (xfmem.dualTexTrans.enabled && postMat[9] != 0.0f)) + { + // TODO test this case more + dst->x = 0.0f; + dst->y = 0.0f; + } + else + { + dst->x = MathUtil::Clamp(dst->x / 2.0f, -1.0f, 1.0f); + dst->y = MathUtil::Clamp(dst->y / 2.0f, -1.0f, 1.0f); + } + } } struct LightPointer |
