mirror of https://github.com/AxioDL/metaforce.git
Update shaders for normalize TCG flag
This commit is contained in:
parent
23f52a1ead
commit
0decdce86d
|
@ -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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue