2
0
mirror of https://github.com/AxioDL/metaforce.git synced 2025-12-20 12:59:12 +00:00

Support for diffuse texture identification in IR

This commit is contained in:
Jack Andersen
2019-02-23 21:14:43 -10:00
parent d13bd28281
commit 470182de06
14 changed files with 88 additions and 26 deletions

View File

@@ -281,7 +281,7 @@ std::string HLSL::makeFrag(size_t blockCount, const char** blockNames, bool alph
std::string HLSL::makeFrag(size_t blockCount, const char** blockNames, bool alphaTest, ReflectionType reflectionType,
BlendFactor srcFactor, BlendFactor dstFactor, const Function& lighting, const Function& post,
size_t extTexCount, const TextureInfo* extTexs) const {
size_t extTexCount, const TextureInfo* extTexs, bool diffuseOnly) const {
std::string lightingSrc;
if (!lighting.m_source.empty())
lightingSrc = lighting.m_source;
@@ -346,12 +346,12 @@ std::string HLSL::makeFrag(size_t blockCount, const char** blockNames, bool alph
std::string reflectionExpr = GenerateReflectionExpr(reflectionType);
retval += " float4 colorOut;\n";
if (m_alphaExpr.size())
if (m_alphaExpr.size() && !diffuseOnly)
retval += " colorOut = " + postEntry + "(" + (postEntry.size() ? "vtf, " : "") + "float4(" + m_colorExpr +
" + " + reflectionExpr + ", " + m_alphaExpr + ")) * mulColor + addColor;\n";
else
retval += " colorOut = " + postEntry + "(" + (postEntry.size() ? "vtf, " : "") + "float4(" + m_colorExpr +
" + " + reflectionExpr + ", 1.0)) * mulColor + addColor;\n";
retval += " colorOut = " + postEntry + "(" + (postEntry.size() ? "vtf, " : "") + "float4(" +
(diffuseOnly ? m_diffuseColorExpr : m_colorExpr) + " + " + reflectionExpr + ", 1.0)) * mulColor + addColor;\n";
return retval + (alphaTest ? GenerateAlphaTest() : "") + " return colorOut;\n}\n";
}