From bb62f84fe16bd6ce2a03f96b14be9bab562e5464 Mon Sep 17 00:00:00 2001 From: Phillip Stephens Date: Tue, 12 Jul 2016 01:54:42 -0700 Subject: [PATCH] Add postMtx to uniform, update athena --- hecl/extern/athena | 2 +- hecl/lib/Backend/HLSL.cpp | 8 +++++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/hecl/extern/athena b/hecl/extern/athena index 4e6105135..46e5d76fd 160000 --- a/hecl/extern/athena +++ b/hecl/extern/athena @@ -1 +1 @@ -Subproject commit 4e610513546f48e520356477dc4a3f603ff5db9e +Subproject commit 46e5d76fd31c7fffb7e0f81dcb07b00d1050533e diff --git a/hecl/lib/Backend/HLSL.cpp b/hecl/lib/Backend/HLSL.cpp index d88dd4cba..af7aae4a6 100644 --- a/hecl/lib/Backend/HLSL.cpp +++ b/hecl/lib/Backend/HLSL.cpp @@ -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)