Update shaders for normalize TCG flag

This commit is contained in:
Jack Andersen 2016-07-18 20:12:00 -10:00
parent 23f52a1ead
commit 0decdce86d
3 changed files with 6 additions and 6 deletions

View File

@ -155,8 +155,8 @@ std::string GLSL::makeVert(const char* glslVer, unsigned col, unsigned uv, unsig
retval += hecl::Format(" vtf.tcgs[%u] = %s;\n", tcgIdx, retval += hecl::Format(" vtf.tcgs[%u] = %s;\n", tcgIdx,
EmitTexGenSource2(tcg.m_src, tcg.m_uvIdx).c_str()); EmitTexGenSource2(tcg.m_src, tcg.m_uvIdx).c_str());
else else
retval += hecl::Format(" vtf.tcgs[%u] = normalize((texMtxs[%u].postMtx * (texMtxs[%u].mtx * %s)).xy);\n", tcgIdx, tcg.m_mtx, retval += hecl::Format(" vtf.tcgs[%u] = (texMtxs[%u].postMtx * %s(texMtxs[%u].mtx * %s)).xy;\n", tcgIdx, tcg.m_mtx,
tcg.m_mtx, EmitTexGenSource4(tcg.m_src, tcg.m_uvIdx).c_str()); tcg.m_norm ? "normalize" : "", tcg.m_mtx, EmitTexGenSource4(tcg.m_src, tcg.m_uvIdx).c_str());
++tcgIdx; ++tcgIdx;
} }

View File

@ -138,8 +138,8 @@ std::string HLSL::makeVert(unsigned col, unsigned uv, unsigned w,
retval += hecl::Format(" vtf.tcgs[%u] = %s;\n", tcgIdx, retval += hecl::Format(" vtf.tcgs[%u] = %s;\n", tcgIdx,
EmitTexGenSource2(tcg.m_src, tcg.m_uvIdx).c_str()); EmitTexGenSource2(tcg.m_src, tcg.m_uvIdx).c_str());
else else
retval += hecl::Format(" vtf.tcgs[%u] = mul(postMtxs[%u], mul(texMtxs[%u], %s)).xy;\n", tcgIdx, tcg.m_mtx, retval += hecl::Format(" vtf.tcgs[%u] = mul(texMtxs[%u].postMtx, %s(mul(texMtxs[%u].mtx, %s))).xy;\n", tcgIdx, tcg.m_mtx,
tcg.m_mtx, EmitTexGenSource4(tcg.m_src, tcg.m_uvIdx).c_str()); tcg.m_norm ? "normalize" : "", tcg.m_mtx, EmitTexGenSource4(tcg.m_src, tcg.m_uvIdx).c_str());
++tcgIdx; ++tcgIdx;
} }

View File

@ -154,8 +154,8 @@ std::string Metal::makeVert(unsigned col, unsigned uv, unsigned w,
retval += hecl::Format(" vtf.tcgs%u = %s;\n", tcgIdx, retval += hecl::Format(" vtf.tcgs%u = %s;\n", tcgIdx,
EmitTexGenSource2(tcg.m_src, tcg.m_uvIdx).c_str()); EmitTexGenSource2(tcg.m_src, tcg.m_uvIdx).c_str());
else else
retval += hecl::Format(" vtf.tcgs%u = (texMtxs[%u] * %s).xy;\n", tcgIdx, tcg.m_mtx, retval += hecl::Format(" vtf.tcgs[%u] = (texMtxs[%u].postMtx * %s(texMtxs[%u].mtx * %s)).xy;\n", tcgIdx, tcg.m_mtx,
EmitTexGenSource4(tcg.m_src, tcg.m_uvIdx).c_str()); tcg.m_norm ? "normalize" : "", tcg.m_mtx, EmitTexGenSource4(tcg.m_src, tcg.m_uvIdx).c_str());
++tcgIdx; ++tcgIdx;
} }