2
0
mirror of https://github.com/AxioDL/metaforce.git synced 2025-12-09 05:47:42 +00:00

Include alpha component in opaque shaders

This commit is contained in:
Jack Andersen
2017-01-29 18:15:35 -10:00
parent f1c4b733bd
commit 4a7b47200a
5 changed files with 8 additions and 14 deletions

View File

@@ -695,7 +695,6 @@ void GX::reset(const IR& ir, Diagnostics& diag)
/* Final instruction is the root call by hecl convention */
const IR::Instruction& rootCall = ir.m_instructions.back();
bool doAlpha = false;
if (!rootCall.m_call.m_name.compare("HECLOpaque"))
{
m_blendSrc = BL_ONE;
@@ -705,13 +704,11 @@ void GX::reset(const IR& ir, Diagnostics& diag)
{
m_blendSrc = BL_SRCALPHA;
m_blendDst = BL_INVSRCALPHA;
doAlpha = true;
}
else if (!rootCall.m_call.m_name.compare("HECLAdditive"))
{
m_blendSrc = BL_SRCALPHA;
m_blendDst = BL_ONE;
doAlpha = true;
}
else
{
@@ -726,7 +723,7 @@ void GX::reset(const IR& ir, Diagnostics& diag)
RecursiveTraceColor(ir, diag, colorRoot);
/* Follow Alpha Chain */
if (doAlpha)
if (rootCall.m_call.m_argInstIdxs.size() > 1)
{
const IR::Instruction& alphaRoot =
ir.m_instructions.at(rootCall.m_call.m_argInstIdxs.at(1));

View File

@@ -264,7 +264,6 @@ void ProgrammableCommon::reset(const IR& ir, Diagnostics& diag, const char* back
/* Final instruction is the root call by hecl convention */
const IR::Instruction& rootCall = ir.m_instructions.back();
bool doAlpha = false;
if (!rootCall.m_call.m_name.compare("HECLOpaque"))
{
m_blendSrc = BlendFactor::One;
@@ -274,13 +273,11 @@ void ProgrammableCommon::reset(const IR& ir, Diagnostics& diag, const char* back
{
m_blendSrc = BlendFactor::SrcAlpha;
m_blendDst = BlendFactor::InvSrcAlpha;
doAlpha = true;
}
else if (!rootCall.m_call.m_name.compare("HECLAdditive"))
{
m_blendSrc = BlendFactor::SrcAlpha;
m_blendDst = BlendFactor::One;
doAlpha = true;
}
else
{
@@ -295,7 +292,7 @@ void ProgrammableCommon::reset(const IR& ir, Diagnostics& diag, const char* back
m_colorExpr = RecursiveTraceColor(ir, diag, colorRoot, false);
/* Follow Alpha Chain */
if (doAlpha)
if (rootCall.m_call.m_argInstIdxs.size() > 1)
{
const IR::Instruction& alphaRoot =
ir.m_instructions.at(rootCall.m_call.m_argInstIdxs.at(1));