mirror of https://github.com/AxioDL/metaforce.git
Merge branch 'master' of https://github.com/AxioDL/hecl
This commit is contained in:
commit
d5e5a30fb3
|
@ -1 +1 @@
|
|||
Subproject commit 4e610513546f48e520356477dc4a3f603ff5db9e
|
||||
Subproject commit 46e5d76fd31c7fffb7e0f81dcb07b00d1050533e
|
|
@ -96,9 +96,14 @@ std::string GLSL::GenerateVertUniformStruct(unsigned skinSlots, unsigned texMtxs
|
|||
skinSlots, skinSlots);
|
||||
if (texMtxs)
|
||||
{
|
||||
retval += hecl::Format("UBINDING1 uniform HECLTexMtxUniform\n"
|
||||
retval += hecl::Format("struct HECLTCGMatrix\n"
|
||||
"{\n"
|
||||
" mat4 texMtxs[%u];\n"
|
||||
" mat4 mtx;\n"
|
||||
" mat4 postMtx;\n"
|
||||
"};\n"
|
||||
"UBINDING1 uniform HECLTexMtxUniform\n"
|
||||
"{\n"
|
||||
" HECLTCGMatrix texMtxs[%u];\n"
|
||||
"};\n", texMtxs);
|
||||
}
|
||||
|
||||
|
@ -150,8 +155,8 @@ std::string GLSL::makeVert(const char* glslVer, unsigned col, unsigned uv, unsig
|
|||
retval += hecl::Format(" vtf.tcgs[%u] = %s;\n", tcgIdx,
|
||||
EmitTexGenSource2(tcg.m_src, tcg.m_uvIdx).c_str());
|
||||
else
|
||||
retval += hecl::Format(" vtf.tcgs[%u] = (texMtxs[%u] * %s).xy;\n", tcgIdx, tcg.m_mtx,
|
||||
EmitTexGenSource4(tcg.m_src, tcg.m_uvIdx).c_str());
|
||||
retval += hecl::Format(" vtf.tcgs[%u] = normalize((texMtxs[%u].postMtx * (texMtxs[%u].mtx * %s)).xy);\n", tcgIdx, tcg.m_mtx,
|
||||
tcg.m_mtx, EmitTexGenSource4(tcg.m_src, tcg.m_uvIdx).c_str());
|
||||
++tcgIdx;
|
||||
}
|
||||
|
||||
|
|
|
@ -87,7 +87,8 @@ std::string HLSL::GenerateVertUniformStruct(unsigned skinSlots, unsigned texMtxs
|
|||
" float4x4 proj;\n",
|
||||
skinSlots, skinSlots);
|
||||
if (texMtxs)
|
||||
retval += hecl::Format(" float4x4 texMtxs[%u];\n", texMtxs);
|
||||
retval += hecl::Format(" float4x4 texMtxs[%u];\n"
|
||||
" float4x4 postMtxs[%u];\n", texMtxs, texMtxs);
|
||||
return retval + "};\n";
|
||||
}
|
||||
|
||||
|
@ -137,8 +138,8 @@ std::string HLSL::makeVert(unsigned col, unsigned uv, unsigned w,
|
|||
retval += hecl::Format(" vtf.tcgs[%u] = %s;\n", tcgIdx,
|
||||
EmitTexGenSource2(tcg.m_src, tcg.m_uvIdx).c_str());
|
||||
else
|
||||
retval += hecl::Format(" vtf.tcgs[%u] = mul(texMtxs[%u], %s).xy;\n", tcgIdx, tcg.m_mtx,
|
||||
EmitTexGenSource4(tcg.m_src, tcg.m_uvIdx).c_str());
|
||||
retval += hecl::Format(" vtf.tcgs[%u] = mul(postMtxs[%u], mul(texMtxs[%u], %s)).xy;\n", tcgIdx, tcg.m_mtx,
|
||||
tcg.m_mtx, EmitTexGenSource4(tcg.m_src, tcg.m_uvIdx).c_str());
|
||||
++tcgIdx;
|
||||
}
|
||||
|
||||
|
@ -212,6 +213,7 @@ std::string HLSL::makeFrag(const ShaderFunction& lighting,
|
|||
postSrc +
|
||||
"\nfloat4 main(in VertToFrag vtf) : SV_Target0\n{\n";
|
||||
|
||||
|
||||
if (m_lighting)
|
||||
{
|
||||
if (lighting.m_entry)
|
||||
|
|
Loading…
Reference in New Issue