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:
@@ -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";
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user