CTevCombiners: Discovered TEV pass names

This commit is contained in:
Luke Street 2022-08-15 18:50:20 -04:00
parent 279ad54264
commit c883e5f1ac
18 changed files with 77 additions and 77 deletions

View File

@ -182,8 +182,8 @@ void CCameraFilterPass::DrawFilterShape(EFilterShape shape, const zeus::CColor&
void CCameraFilterPass::DrawFullScreenTexturedQuadQuarters(const zeus::CColor& color, CTexture* tex, float lod) { void CCameraFilterPass::DrawFullScreenTexturedQuadQuarters(const zeus::CColor& color, CTexture* tex, float lod) {
SCOPED_GRAPHICS_DEBUG_GROUP("CCameraFilterPass::DrawFullScreenTexturedQuadQuarters", zeus::skBlue); SCOPED_GRAPHICS_DEBUG_GROUP("CCameraFilterPass::DrawFullScreenTexturedQuadQuarters", zeus::skBlue);
const auto [lt, rb] = g_Renderer->SetViewportOrtho(true, -4096.f, 4096.f); const auto [lt, rb] = g_Renderer->SetViewportOrtho(true, -4096.f, 4096.f);
CGraphics::SetTevOp(ERglTevStage::Stage0, CTevCombiners::sTevPass805a5ebc); CGraphics::SetTevOp(ERglTevStage::Stage0, CTevCombiners::kEnvModulate);
CGraphics::SetTevOp(ERglTevStage::Stage1, CTevCombiners::skPassThru); CGraphics::SetTevOp(ERglTevStage::Stage1, CTevCombiners::kEnvPassthru);
g_Renderer->SetDepthReadWrite(false, false); g_Renderer->SetDepthReadWrite(false, false);
if (tex != nullptr) { if (tex != nullptr) {
tex->Load(GX_TEXMAP0, EClampMode::Repeat); tex->Load(GX_TEXMAP0, EClampMode::Repeat);
@ -215,8 +215,8 @@ void CCameraFilterPass::DrawFullScreenTexturedQuad(const zeus::CColor& color, CT
if (tex != nullptr) { if (tex != nullptr) {
tex->Load(GX_TEXMAP0, EClampMode::Repeat); tex->Load(GX_TEXMAP0, EClampMode::Repeat);
} }
CGraphics::SetTevOp(ERglTevStage::Stage0, CTevCombiners::sTevPass805a5ebc); CGraphics::SetTevOp(ERglTevStage::Stage0, CTevCombiners::kEnvModulate);
CGraphics::SetTevOp(ERglTevStage::Stage1, CTevCombiners::skPassThru); CGraphics::SetTevOp(ERglTevStage::Stage1, CTevCombiners::kEnvPassthru);
CGraphics::StreamBegin(GX_TRIANGLESTRIP); CGraphics::StreamBegin(GX_TRIANGLESTRIP);
CGraphics::StreamColor(color); CGraphics::StreamColor(color);
CGraphics::StreamTexcoord(u, v); CGraphics::StreamTexcoord(u, v);
@ -240,12 +240,12 @@ void CCameraFilterPass::DrawRandomStatic(const zeus::CColor& color, float alpha,
CGraphics::SetAlphaCompare(ERglAlphaFunc::GEqual, static_cast<u8>((1.f - alpha) * 255.f), ERglAlphaOp::And, CGraphics::SetAlphaCompare(ERglAlphaFunc::GEqual, static_cast<u8>((1.f - alpha) * 255.f), ERglAlphaOp::And,
ERglAlphaFunc::Always, 0); ERglAlphaFunc::Always, 0);
g_Renderer->SetDepthReadWrite(true, true); g_Renderer->SetDepthReadWrite(true, true);
CGraphics::SetTevOp(ERglTevStage::Stage0, CTevCombiners::sTevPass805a5ebc); CGraphics::SetTevOp(ERglTevStage::Stage0, CTevCombiners::kEnvModulate);
CGraphics::SetTevOp(ERglTevStage::Stage1, CTevCombiners::skPassThru); CGraphics::SetTevOp(ERglTevStage::Stage1, CTevCombiners::kEnvPassthru);
} else { } else {
g_Renderer->SetDepthReadWrite(false, false); g_Renderer->SetDepthReadWrite(false, false);
CGraphics::SetTevOp(ERglTevStage::Stage0, CTevCombiners::sTevPass805a6038); CGraphics::SetTevOp(ERglTevStage::Stage0, CTevCombiners::kEnvModulateColor);
CGraphics::SetTevOp(ERglTevStage::Stage1, CTevCombiners::skPassThru); CGraphics::SetTevOp(ERglTevStage::Stage1, CTevCombiners::kEnvPassthru);
} }
// Upload random static texture (game reads from .text) // Upload random static texture (game reads from .text)

View File

@ -34,8 +34,8 @@ void CSimpleShadow::Render(TLockedToken<CTexture>& tex) {
CGraphics::SetModelMatrix(x0_xf); CGraphics::SetModelMatrix(x0_xf);
tex->Load(GX_TEXMAP0, EClampMode::Repeat); tex->Load(GX_TEXMAP0, EClampMode::Repeat);
CGraphics::SetTevOp(ERglTevStage::Stage0, CTevCombiners::sTevPass805a5ebc); CGraphics::SetTevOp(ERglTevStage::Stage0, CTevCombiners::kEnvModulate);
CGraphics::SetTevOp(ERglTevStage::Stage1, CTevCombiners::skPassThru); CGraphics::SetTevOp(ERglTevStage::Stage1, CTevCombiners::kEnvPassthru);
CGraphics::SetAlphaCompare(ERglAlphaFunc::Always, 0, ERglAlphaOp::And, ERglAlphaFunc::Always, 0); CGraphics::SetAlphaCompare(ERglAlphaFunc::Always, 0, ERglAlphaOp::And, ERglAlphaFunc::Always, 0);
CGraphics::SetDepthWriteMode(true, ERglEnum::LEqual, false); CGraphics::SetDepthWriteMode(true, ERglEnum::LEqual, false);
CGraphics::SetBlendMode(ERglBlendMode::Blend, ERglBlendFactor::SrcAlpha, ERglBlendFactor::InvSrcAlpha, CGraphics::SetBlendMode(ERglBlendMode::Blend, ERglBlendFactor::SrcAlpha, ERglBlendFactor::InvSrcAlpha,

View File

@ -21,51 +21,47 @@ constexpr u32 maxTevPasses = 2;
static u32 sNumEnabledPasses; static u32 sNumEnabledPasses;
static std::array<bool, maxTevPasses> sValidPasses; static std::array<bool, maxTevPasses> sValidPasses;
const CTevPass skPassThru{ const CTevPass kEnvPassthru{
{GX_CC_ZERO, GX_CC_ZERO, GX_CC_ZERO, GX_CC_RASC}, {GX_CC_ZERO, GX_CC_ZERO, GX_CC_ZERO, GX_CC_RASC},
{GX_CA_ZERO, GX_CA_ZERO, GX_CA_ZERO, GX_CA_RASA}, {GX_CA_ZERO, GX_CA_ZERO, GX_CA_ZERO, GX_CA_RASA},
}; };
const CTevPass sTevPass804bfcc0{ const CTevPass kEnvBlendCTandCConCF{
{GX_CC_C0, GX_CC_TEXC, GX_CC_RASC, GX_CC_ZERO}, {GX_CC_C0, GX_CC_TEXC, GX_CC_RASC, GX_CC_ZERO},
{GX_CA_ZERO, GX_CA_ZERO, GX_CA_ZERO, GX_CA_RASA}, {GX_CA_ZERO, GX_CA_ZERO, GX_CA_ZERO, GX_CA_RASA},
}; };
const CTevPass sTevPass804bfe68{ const CTevPass kEnvModulateConstColor{
{GX_CC_ZERO, GX_CC_CPREV, GX_CC_RASC, GX_CC_ZERO},
{GX_CA_ZERO, GX_CA_APREV, GX_CA_RASA, GX_CA_ZERO},
};
const CTevPass sTevPass805a5698{
{GX_CC_ZERO, GX_CC_RASC, GX_CC_C0, GX_CC_ZERO}, {GX_CC_ZERO, GX_CC_RASC, GX_CC_C0, GX_CC_ZERO},
{GX_CA_ZERO, GX_CA_RASA, GX_CA_A0, GX_CA_ZERO}, {GX_CA_ZERO, GX_CA_RASA, GX_CA_A0, GX_CA_ZERO},
}; };
const CTevPass sTevPass805a5e70{ const CTevPass kEnvConstColor{
{GX_CC_ZERO, GX_CC_ZERO, GX_CC_ZERO, GX_CC_C0}, {GX_CC_ZERO, GX_CC_ZERO, GX_CC_ZERO, GX_CC_C0},
{GX_CA_ZERO, GX_CA_ZERO, GX_CA_ZERO, GX_CA_A0}, {GX_CA_ZERO, GX_CA_ZERO, GX_CA_ZERO, GX_CA_A0},
}; };
const CTevPass sTevPass805a5ebc{ const CTevPass kEnvModulate{
{GX_CC_ZERO, GX_CC_RASC, GX_CC_TEXC, GX_CC_ZERO}, {GX_CC_ZERO, GX_CC_RASC, GX_CC_TEXC, GX_CC_ZERO},
{GX_CA_ZERO, GX_CA_RASA, GX_CA_TEXA, GX_CA_ZERO}, {GX_CA_ZERO, GX_CA_RASA, GX_CA_TEXA, GX_CA_ZERO},
}; };
const CTevPass sTevPass805a5f08{ const CTevPass kEnvDecal{
{GX_CC_RASC, GX_CC_TEXC, GX_CC_TEXA, GX_CC_ZERO}, {GX_CC_RASC, GX_CC_TEXC, GX_CC_TEXA, GX_CC_ZERO},
{GX_CA_ZERO, GX_CA_ZERO, GX_CA_ZERO, GX_CA_RASA}, {GX_CA_ZERO, GX_CA_ZERO, GX_CA_ZERO, GX_CA_RASA},
}; };
const CTevPass sTevPass805a5f54{ const CTevPass kEnvBlend{
{GX_CC_RASC, GX_CC_ONE, GX_CC_TEXC, GX_CC_ZERO}, {GX_CC_RASC, GX_CC_ONE, GX_CC_TEXC, GX_CC_ZERO},
{GX_CA_ZERO, GX_CA_TEXA, GX_CA_RASA, GX_CA_ZERO}, {GX_CA_ZERO, GX_CA_TEXA, GX_CA_RASA, GX_CA_ZERO},
}; };
const CTevPass sTevPass805a5fa0{ const CTevPass kEnvReplace{
{GX_CC_ZERO, GX_CC_ZERO, GX_CC_ZERO, GX_CC_TEXC}, {GX_CC_ZERO, GX_CC_ZERO, GX_CC_ZERO, GX_CC_TEXC},
{GX_CA_ZERO, GX_CA_ZERO, GX_CA_ZERO, GX_CA_TEXA}, {GX_CA_ZERO, GX_CA_ZERO, GX_CA_ZERO, GX_CA_TEXA},
}; };
const CTevPass sTevPass805a5fec{ const CTevPass kEnvModulateAlpha{
{GX_CC_ZERO, GX_CC_ZERO, GX_CC_ZERO, GX_CC_RASC}, {GX_CC_ZERO, GX_CC_ZERO, GX_CC_ZERO, GX_CC_RASC},
{GX_CA_ZERO, GX_CA_TEXA, GX_CA_RASA, GX_CA_ZERO}, {GX_CA_ZERO, GX_CA_TEXA, GX_CA_RASA, GX_CA_ZERO},
}; };
const CTevPass sTevPass805a6038{ const CTevPass kEnvModulateColor{
{GX_CC_ZERO, GX_CC_TEXC, GX_CC_RASC, GX_CC_ZERO}, {GX_CC_ZERO, GX_CC_TEXC, GX_CC_RASC, GX_CC_ZERO},
{GX_CA_ZERO, GX_CA_KONST, GX_CA_RASA, GX_CA_ZERO}, {GX_CA_ZERO, GX_CA_KONST, GX_CA_RASA, GX_CA_ZERO},
}; };
const CTevPass sTevPass805a6084{ const CTevPass kEnvModulateColorByAlpha{
{GX_CC_ZERO, GX_CC_CPREV, GX_CC_APREV, GX_CC_ZERO}, {GX_CC_ZERO, GX_CC_CPREV, GX_CC_APREV, GX_CC_ZERO},
{GX_CA_ZERO, GX_CA_ZERO, GX_CA_ZERO, GX_CA_APREV}, {GX_CA_ZERO, GX_CA_ZERO, GX_CA_ZERO, GX_CA_APREV},
}; };
@ -81,7 +77,7 @@ void Init() {
} }
void SetupPass(ERglTevStage stage, const CTevPass& pass) { void SetupPass(ERglTevStage stage, const CTevPass& pass) {
if (pass == skPassThru) { if (pass == kEnvPassthru) {
DeletePass(stage); DeletePass(stage);
return; return;
} }
@ -92,7 +88,7 @@ void SetupPass(ERglTevStage stage, const CTevPass& pass) {
} }
void DeletePass(ERglTevStage stage) { void DeletePass(ERglTevStage stage) {
SetPassCombiners(stage, skPassThru); SetPassCombiners(stage, kEnvPassthru);
sValidPasses[static_cast<size_t>(stage)] = false; sValidPasses[static_cast<size_t>(stage)] = false;
RecomputePasses(); RecomputePasses();
} }
@ -109,7 +105,7 @@ void RecomputePasses() {
void ResetStates() { void ResetStates() {
sValidPasses.fill(false); sValidPasses.fill(false);
skPassThru.Execute(ERglTevStage::Stage0); kEnvPassthru.Execute(ERglTevStage::Stage0);
sNumEnabledPasses = 1; sNumEnabledPasses = 1;
CGX::SetNumTevStages(1); CGX::SetNumTevStages(1);
} }

View File

@ -103,18 +103,18 @@ public:
} }
}; };
extern const CTevPass skPassThru; extern const CTevPass kEnvPassthru;
extern const CTevPass sTevPass804bfcc0; // TODO move below to CGraphics
extern const CTevPass sTevPass804bfe68; extern const CTevPass kEnvBlendCTandCConCF;
extern const CTevPass sTevPass805a5698; extern const CTevPass kEnvModulateConstColor;
extern const CTevPass sTevPass805a5e70; extern const CTevPass kEnvConstColor;
extern const CTevPass sTevPass805a5ebc; extern const CTevPass kEnvModulate;
extern const CTevPass sTevPass805a5f08; extern const CTevPass kEnvDecal;
extern const CTevPass sTevPass805a5f54; extern const CTevPass kEnvBlend;
extern const CTevPass sTevPass805a5fa0; extern const CTevPass kEnvReplace;
extern const CTevPass sTevPass805a5fec; extern const CTevPass kEnvModulateAlpha;
extern const CTevPass sTevPass805a6038; extern const CTevPass kEnvModulateColor;
extern const CTevPass sTevPass805a6084; extern const CTevPass kEnvModulateColorByAlpha;
void Init(); void Init();
void SetupPass(ERglTevStage stage, const CTevPass& pass); void SetupPass(ERglTevStage stage, const CTevPass& pass);

View File

@ -110,8 +110,8 @@ void CAuiEnergyBarT01::Draw(const CGuiWidgetDrawParms& drawParms) {
} }
if (barOffT != barMaxT) { if (barOffT != barMaxT) {
CGraphics::SetTevOp(ERglTevStage::Stage0, CTevCombiners::sTevPass805a5ebc); CGraphics::SetTevOp(ERglTevStage::Stage0, CTevCombiners::kEnvModulate);
CGraphics::SetTevOp(ERglTevStage::Stage1, CTevCombiners::skPassThru); CGraphics::SetTevOp(ERglTevStage::Stage1, CTevCombiners::kEnvPassthru);
xbc_tex->Load(GX_TEXMAP0, EClampMode::Repeat); xbc_tex->Load(GX_TEXMAP0, EClampMode::Repeat);
CGraphics::StreamBegin(GX_TRIANGLESTRIP); CGraphics::StreamBegin(GX_TRIANGLESTRIP);
CGraphics::StreamColor(useCol); CGraphics::StreamColor(useCol);

View File

@ -78,8 +78,8 @@ void CAuiImagePane::DoDrawImagePane(const zeus::CColor& color, CTexture& tex, in
if (!noBlur) { if (!noBlur) {
if ((x14c_deResFactor == 0.f && alpha == 1.f) || tex.GetNumberOfMipMaps() == 1) { if ((x14c_deResFactor == 0.f && alpha == 1.f) || tex.GetNumberOfMipMaps() == 1) {
CGraphics::SetTevOp(ERglTevStage::Stage0, CTevCombiners::sTevPass805a5ebc); CGraphics::SetTevOp(ERglTevStage::Stage0, CTevCombiners::kEnvModulate);
CGraphics::SetTevOp(ERglTevStage::Stage1, CTevCombiners::skPassThru); CGraphics::SetTevOp(ERglTevStage::Stage1, CTevCombiners::kEnvPassthru);
tex.LoadMipLevel(0, GX_TEXMAP0, EClampMode::Repeat); tex.LoadMipLevel(0, GX_TEXMAP0, EClampMode::Repeat);
CGraphics::StreamBegin(GX_TRIANGLESTRIP); CGraphics::StreamBegin(GX_TRIANGLESTRIP);
CGraphics::StreamColor(useColor); CGraphics::StreamColor(useColor);
@ -144,8 +144,8 @@ void CAuiImagePane::DoDrawImagePane(const zeus::CColor& color, CTexture& tex, in
CGX::End(); CGX::End();
} }
} else { } else {
CGraphics::SetTevOp(ERglTevStage::Stage0, CTevCombiners::sTevPass805a5fec); CGraphics::SetTevOp(ERglTevStage::Stage0, CTevCombiners::kEnvModulateAlpha);
CGraphics::SetTevOp(ERglTevStage::Stage1, CTevCombiners::skPassThru); CGraphics::SetTevOp(ERglTevStage::Stage1, CTevCombiners::kEnvPassthru);
tex.Load(GX_TEXMAP0, EClampMode::Repeat); tex.Load(GX_TEXMAP0, EClampMode::Repeat);
CGraphics::StreamBegin(GX_TRIANGLESTRIP); CGraphics::StreamBegin(GX_TRIANGLESTRIP);
CGraphics::StreamColor(useColor); CGraphics::StreamColor(useColor);

View File

@ -128,7 +128,7 @@ void CGuiFrame::Draw(const CGuiWidgetDrawParms& parms) const {
CGraphics::SetAmbientColor(zeus::skWhite); CGraphics::SetAmbientColor(zeus::skWhite);
DisableLights(); DisableLights();
x14_camera->Draw(parms); x14_camera->Draw(parms);
CGraphics::SetTevOp(ERglTevStage::Stage0, CTevCombiners::sTevPass805a5ebc); CGraphics::SetTevOp(ERglTevStage::Stage0, CTevCombiners::kEnvModulate);
CGraphics::SetBlendMode(ERglBlendMode::Blend, ERglBlendFactor::SrcAlpha, ERglBlendFactor::InvSrcAlpha, CGraphics::SetBlendMode(ERglBlendMode::Blend, ERglBlendFactor::SrcAlpha, ERglBlendFactor::InvSrcAlpha,
ERglLogicOp::Clear); ERglLogicOp::Clear);

View File

@ -16,7 +16,7 @@ void CGuiPane::Draw(const CGuiWidgetDrawParms& parms) {
auto col = xa8_color2; auto col = xa8_color2;
col.a() = parms.x0_alphaMod * xa8_color2.a(); col.a() = parms.x0_alphaMod * xa8_color2.a();
CGraphics::SetTevOp(ERglTevStage::Stage0, CTevCombiners::skPassThru); CGraphics::SetTevOp(ERglTevStage::Stage0, CTevCombiners::kEnvPassthru);
CGraphics::DrawPrimitive(GX_TRIANGLESTRIP, xc0_verts.data(), skDefaultNormal, col, xc0_verts.size()); CGraphics::DrawPrimitive(GX_TRIANGLESTRIP, xc0_verts.data(), skDefaultNormal, col, xc0_verts.size());
} }
CGuiWidget::Draw(parms); CGuiWidget::Draw(parms);

View File

@ -125,7 +125,7 @@ void CHudRadarInterface::Draw(const CStateManager& mgr, float alpha) {
g_Renderer->SetModelMatrix(drawParms.x3c_postTranslate); g_Renderer->SetModelMatrix(drawParms.x3c_postTranslate);
g_Renderer->SetBlendMode_AdditiveAlpha(); g_Renderer->SetBlendMode_AdditiveAlpha();
x0_txtrRadarPaint->Load(GX_TEXMAP0, EClampMode::Repeat); x0_txtrRadarPaint->Load(GX_TEXMAP0, EClampMode::Repeat);
CGraphics::SetTevOp(ERglTevStage::Stage0, CTevCombiners::sTevPass805a5ebc); CGraphics::SetTevOp(ERglTevStage::Stage0, CTevCombiners::kEnvModulate);
g_Renderer->SetDepthReadWrite(false, false); g_Renderer->SetDepthReadWrite(false, false);
zeus::CColor playerColor = g_tweakGuiColors->GetRadarPlayerPaintColor(); zeus::CColor playerColor = g_tweakGuiColors->GetRadarPlayerPaintColor();
playerColor.a() *= alpha; playerColor.a() *= alpha;

View File

@ -451,7 +451,7 @@ void CScanDisplay::Draw() {
g_Renderer->SetDepthReadWrite(false, false); g_Renderer->SetDepthReadWrite(false, false);
g_Renderer->SetViewportOrtho(true, -4096.f, 4096.f); g_Renderer->SetViewportOrtho(true, -4096.f, 4096.f);
g_Renderer->SetBlendMode_AdditiveAlpha(); g_Renderer->SetBlendMode_AdditiveAlpha();
CGraphics::SetTevOp(ERglTevStage::Stage0, CTevCombiners::sTevPass805a5ebc); CGraphics::SetTevOp(ERglTevStage::Stage0, CTevCombiners::kEnvModulate);
x0_dataDot->Load(GX_TEXMAP0, EClampMode::Repeat); x0_dataDot->Load(GX_TEXMAP0, EClampMode::Repeat);
const float vpRatio = CGraphics::GetViewportHeight() / 480.f; const float vpRatio = CGraphics::GetViewportHeight() / 480.f;

View File

@ -66,8 +66,8 @@ void CSplashScreen::Draw() {
CGraphics::SetAlphaCompare(ERglAlphaFunc::Always, 0, ERglAlphaOp::And, ERglAlphaFunc::Always, 0); CGraphics::SetAlphaCompare(ERglAlphaFunc::Always, 0, ERglAlphaOp::And, ERglAlphaFunc::Always, 0);
g_Renderer->SetModelMatrix({}); g_Renderer->SetModelMatrix({});
CGraphics::SetViewPointMatrix({}); CGraphics::SetViewPointMatrix({});
CGraphics::SetTevOp(ERglTevStage::Stage0, CTevCombiners::sTevPass805a5ebc); CGraphics::SetTevOp(ERglTevStage::Stage0, CTevCombiners::kEnvModulate);
CGraphics::SetTevOp(ERglTevStage::Stage1, CTevCombiners::skPassThru); CGraphics::SetTevOp(ERglTevStage::Stage1, CTevCombiners::kEnvPassthru);
g_Renderer->SetBlendMode_AlphaBlended(); g_Renderer->SetBlendMode_AlphaBlended();
auto& tex = *x28_texture.GetObj(); auto& tex = *x28_texture.GetObj();
const auto width = tex.GetWidth(); const auto width = tex.GetWidth();

View File

@ -1823,8 +1823,8 @@ void CFrontEndUI::Draw() {
if (x64_pressStartAlpha > 0.f && x38_pressStart.IsLoaded()) { if (x64_pressStartAlpha > 0.f && x38_pressStart.IsLoaded()) {
/* Render "Press Start" */ /* Render "Press Start" */
CGraphics::SetTevOp(ERglTevStage::Stage0, CTevCombiners::sTevPass805a5ebc); CGraphics::SetTevOp(ERglTevStage::Stage0, CTevCombiners::kEnvModulate);
CGraphics::SetTevOp(ERglTevStage::Stage1, CTevCombiners::skPassThru); CGraphics::SetTevOp(ERglTevStage::Stage1, CTevCombiners::kEnvPassthru);
g_Renderer->SetBlendMode_AdditiveAlpha(); g_Renderer->SetBlendMode_AdditiveAlpha();
g_Renderer->SetDepthReadWrite(false, false); g_Renderer->SetDepthReadWrite(false, false);
const auto width = x38_pressStart->GetWidth(); const auto width = x38_pressStart->GetWidth();

View File

@ -475,8 +475,8 @@ void CInGameGuiManager::Draw(CStateManager& stateMgr) {
if (x1d8_onScreenTexAlpha > 0.f && x1dc_onScreenTexTok.IsLoaded()) { if (x1d8_onScreenTexAlpha > 0.f && x1dc_onScreenTexTok.IsLoaded()) {
g_Renderer->SetDepthReadWrite(false, false); g_Renderer->SetDepthReadWrite(false, false);
g_Renderer->SetBlendMode_AlphaBlended(); g_Renderer->SetBlendMode_AlphaBlended();
CGraphics::SetTevOp(ERglTevStage::Stage0, CTevCombiners::sTevPass805a5ebc); CGraphics::SetTevOp(ERglTevStage::Stage0, CTevCombiners::kEnvModulate);
CGraphics::SetTevOp(ERglTevStage::Stage1, CTevCombiners::skPassThru); CGraphics::SetTevOp(ERglTevStage::Stage1, CTevCombiners::kEnvPassthru);
int w = x1c4_onScreenTex.x4_origin.x; int w = x1c4_onScreenTex.x4_origin.x;
int h = x1c4_onScreenTex.x4_origin.y; int h = x1c4_onScreenTex.x4_origin.y;
int x = CGraphics::GetViewportLeft() + (CGraphics::GetViewportWidth() - w) / 2 + x1c4_onScreenTex.xc_extent.x; int x = CGraphics::GetViewportLeft() + (CGraphics::GetViewportWidth() - w) / 2 + x1c4_onScreenTex.xc_extent.x;

View File

@ -107,8 +107,8 @@ void COmegaPirate::CFlash::Render(CStateManager& mgr) {
const auto rvS = GetTranslation() - rightVec; const auto rvS = GetTranslation() - rightVec;
const auto rvP = GetTranslation() + rightVec; const auto rvP = GetTranslation() + rightVec;
CGraphics::SetModelMatrix(zeus::CTransform()); CGraphics::SetModelMatrix(zeus::CTransform());
CGraphics::SetTevOp(ERglTevStage::Stage0, CTevCombiners::sTevPass805a5ebc); CGraphics::SetTevOp(ERglTevStage::Stage0, CTevCombiners::kEnvModulate);
CGraphics::SetTevOp(ERglTevStage::Stage1, CTevCombiners::skPassThru); CGraphics::SetTevOp(ERglTevStage::Stage1, CTevCombiners::kEnvPassthru);
CGraphics::SetDepthWriteMode(false, ERglEnum::Always, false); CGraphics::SetDepthWriteMode(false, ERglEnum::Always, false);
CGraphics::StreamColor(zeus::CColor{1.f, std::min(1.f, size)}); CGraphics::StreamColor(zeus::CColor{1.f, std::min(1.f, size)});
CGraphics::StreamBegin(GX_TRIANGLEFAN); CGraphics::StreamBegin(GX_TRIANGLEFAN);

View File

@ -1394,8 +1394,8 @@ void CThardus::RenderFlare(const CStateManager& mgr, float t) {
zeus::CVector3f min = x92c_currentRockPos - (scale * CGraphics::g_ViewMatrix.basis[0]); zeus::CVector3f min = x92c_currentRockPos - (scale * CGraphics::g_ViewMatrix.basis[0]);
CGraphics::SetModelMatrix({}); CGraphics::SetModelMatrix({});
CGraphics::SetBlendMode(ERglBlendMode::Blend, ERglBlendFactor::One, ERglBlendFactor::One, ERglLogicOp::Clear); CGraphics::SetBlendMode(ERglBlendMode::Blend, ERglBlendFactor::One, ERglBlendFactor::One, ERglLogicOp::Clear);
CGraphics::SetTevOp(ERglTevStage::Stage0, CTevCombiners::sTevPass805a5ebc); CGraphics::SetTevOp(ERglTevStage::Stage0, CTevCombiners::kEnvModulate);
CGraphics::SetTevOp(ERglTevStage::Stage1, CTevCombiners::skPassThru); CGraphics::SetTevOp(ERglTevStage::Stage1, CTevCombiners::kEnvPassthru);
CGraphics::SetDepthWriteMode(false, ERglEnum::Always, false); CGraphics::SetDepthWriteMode(false, ERglEnum::Always, false);
CGraphics::StreamColor({t, t}); CGraphics::StreamColor({t, t});
CGraphics::StreamBegin(GX_TRIANGLEFAN); CGraphics::StreamBegin(GX_TRIANGLEFAN);

View File

@ -915,7 +915,7 @@ void CElementGen::RenderModels() {
cachedTex = texr->GetValueTexture(partFrame).GetObj(); cachedTex = texr->GetValueTexture(partFrame).GetObj();
cachedTex->Load(GX_TEXMAP0, EClampMode::Repeat); cachedTex->Load(GX_TEXMAP0, EClampMode::Repeat);
CGraphics::SetTevOp(ERglTevStage::Stage0, CTevCombiners::sTevPass805a5ebc); CGraphics::SetTevOp(ERglTevStage::Stage0, CTevCombiners::kEnvModulate);
if (moveRedToAlphaBuffer) { if (moveRedToAlphaBuffer) {
CGX::SetTevColorIn(GX_TEVSTAGE1, GX_CC_ZERO, GX_CC_CPREV, GX_CC_APREV, GX_CC_ZERO); CGX::SetTevColorIn(GX_TEVSTAGE1, GX_CC_ZERO, GX_CC_CPREV, GX_CC_APREV, GX_CC_ZERO);
CGX::SetTevAlphaIn(GX_TEVSTAGE1, GX_CA_ZERO, GX_CA_TEXA, GX_CA_APREV, GX_CA_ZERO); CGX::SetTevAlphaIn(GX_TEVSTAGE1, GX_CA_ZERO, GX_CA_TEXA, GX_CA_APREV, GX_CA_ZERO);
@ -936,14 +936,14 @@ void CElementGen::RenderModels() {
CGX::SetTevOrder(GX_TEVSTAGE0, GX_TEXCOORD0, GX_TEXMAP0, GX_COLOR0A0); CGX::SetTevOrder(GX_TEVSTAGE0, GX_TEXCOORD0, GX_TEXMAP0, GX_COLOR0A0);
CGX::SetNumTexGens(1); CGX::SetNumTexGens(1);
} else { } else {
CGraphics::SetTevOp(ERglTevStage::Stage1, CTevCombiners::skPassThru); CGraphics::SetTevOp(ERglTevStage::Stage1, CTevCombiners::kEnvPassthru);
} }
texConst = texr->HasConstantTexture(); texConst = texr->HasConstantTexture();
texr->GetValueUV(partFrame, uvs); texr->GetValueUV(partFrame, uvs);
} else { } else {
CGraphics::SetTevOp(ERglTevStage::Stage0, CTevCombiners::skPassThru); CGraphics::SetTevOp(ERglTevStage::Stage0, CTevCombiners::kEnvPassthru);
CGraphics::SetTevOp(ERglTevStage::Stage1, CTevCombiners::skPassThru); CGraphics::SetTevOp(ERglTevStage::Stage1, CTevCombiners::kEnvPassthru);
} }
} }
@ -1255,19 +1255,23 @@ void CElementGen::RenderParticles() {
cachedTex = texr->GetValueTexture(partFrame).GetObj(); cachedTex = texr->GetValueTexture(partFrame).GetObj();
cachedTex->Load(GX_TEXMAP0, EClampMode::Repeat); cachedTex->Load(GX_TEXMAP0, EClampMode::Repeat);
CGraphics::SetTevOp(ERglTevStage::Stage0, CTevCombiners::sTevPass805a5ebc); CGraphics::SetTevOp(ERglTevStage::Stage0, CTevCombiners::kEnvModulate);
if (hasModuColor) { if (hasModuColor) {
/* Add RASC * PREVC pass for MODU color loaded into channel mat-color */ /* Add RASC * PREVC pass for MODU color loaded into channel mat-color */
CGraphics::SetTevOp(ERglTevStage::Stage1, CTevCombiners::sTevPass804bfe68); static const CTevCombiners::CTevPass kEnvModuColor{
{GX_CC_ZERO, GX_CC_CPREV, GX_CC_RASC, GX_CC_ZERO},
{GX_CA_ZERO, GX_CA_APREV, GX_CA_RASA, GX_CA_ZERO},
};
CGraphics::SetTevOp(ERglTevStage::Stage1, kEnvModuColor);
} else { } else {
CGraphics::SetTevOp(ERglTevStage::Stage1, CTevCombiners::skPassThru); CGraphics::SetTevOp(ERglTevStage::Stage1, CTevCombiners::kEnvPassthru);
} }
texr->GetValueUV(partFrame, uvs); texr->GetValueUV(partFrame, uvs);
constUVs = texr->HasConstantUV(); constUVs = texr->HasConstantUV();
} else { } else {
CGraphics::SetTevOp(ERglTevStage::Stage0, CTevCombiners::skPassThru); CGraphics::SetTevOp(ERglTevStage::Stage0, CTevCombiners::kEnvPassthru);
CGraphics::SetTevOp(ERglTevStage::Stage1, CTevCombiners::skPassThru); CGraphics::SetTevOp(ERglTevStage::Stage1, CTevCombiners::kEnvPassthru);
} }
constexpr std::array vtxDescList{ constexpr std::array vtxDescList{

View File

@ -182,8 +182,8 @@ void CVisorFlare::SetupRenderState(const CStateManager& mgr) const {
} else if (x0_blendMode == EBlendMode::Additive) { } else if (x0_blendMode == EBlendMode::Additive) {
g_Renderer->SetBlendMode_AdditiveAlpha(); g_Renderer->SetBlendMode_AdditiveAlpha();
} }
CGraphics::SetTevOp(ERglTevStage::Stage0, CTevCombiners::sTevPass805a5ebc); CGraphics::SetTevOp(ERglTevStage::Stage0, CTevCombiners::kEnvModulate);
CGraphics::SetTevOp(ERglTevStage::Stage1, CTevCombiners::skPassThru); CGraphics::SetTevOp(ERglTevStage::Stage1, CTevCombiners::kEnvPassthru);
} }
} }

View File

@ -74,8 +74,8 @@ void CWorldShadow::BuildLightShadowTexture(const CStateManager& mgr, TAreaId aid
CGraphics::SetDepthWriteMode(true, ERglEnum::LEqual, true); CGraphics::SetDepthWriteMode(true, ERglEnum::LEqual, true);
CGraphics::SetBlendMode(ERglBlendMode::Blend, ERglBlendFactor::SrcAlpha, ERglBlendFactor::InvSrcAlpha, CGraphics::SetBlendMode(ERglBlendMode::Blend, ERglBlendFactor::SrcAlpha, ERglBlendFactor::InvSrcAlpha,
ERglLogicOp::Clear); ERglLogicOp::Clear);
CGraphics::SetTevOp(ERglTevStage::Stage0, CTevCombiners::skPassThru); CGraphics::SetTevOp(ERglTevStage::Stage0, CTevCombiners::kEnvPassthru);
CGraphics::SetTevOp(ERglTevStage::Stage1, CTevCombiners::skPassThru); CGraphics::SetTevOp(ERglTevStage::Stage1, CTevCombiners::kEnvPassthru);
g_Renderer->BeginTriangleStrip(4); g_Renderer->BeginTriangleStrip(4);
g_Renderer->PrimVertex({-extent, 0.f, extent}); g_Renderer->PrimVertex({-extent, 0.f, extent});
g_Renderer->PrimVertex({extent, 0.f, extent}); g_Renderer->PrimVertex({extent, 0.f, extent});
@ -97,8 +97,8 @@ void CWorldShadow::BuildLightShadowTexture(const CStateManager& mgr, TAreaId aid
CGraphics::SetDepthWriteMode(false, ERglEnum::LEqual, false); CGraphics::SetDepthWriteMode(false, ERglEnum::LEqual, false);
CGraphics::SetBlendMode(ERglBlendMode::Blend, ERglBlendFactor::SrcAlpha, ERglBlendFactor::InvSrcAlpha, CGraphics::SetBlendMode(ERglBlendMode::Blend, ERglBlendFactor::SrcAlpha, ERglBlendFactor::InvSrcAlpha,
ERglLogicOp::Clear); ERglLogicOp::Clear);
CGraphics::SetTevOp(ERglTevStage::Stage0, CTevCombiners::skPassThru); CGraphics::SetTevOp(ERglTevStage::Stage0, CTevCombiners::kEnvPassthru);
CGraphics::SetTevOp(ERglTevStage::Stage1, CTevCombiners::skPassThru); CGraphics::SetTevOp(ERglTevStage::Stage1, CTevCombiners::kEnvPassthru);
CGraphics::StreamBegin(GX_TRIANGLESTRIP); CGraphics::StreamBegin(GX_TRIANGLESTRIP);
CGraphics::StreamColor(1.f, 1.f, 1.f, 0.25f); CGraphics::StreamColor(1.f, 1.f, 1.f, 0.25f);
CGraphics::StreamVertex(-extent, 0.f, extent); CGraphics::StreamVertex(-extent, 0.f, extent);
@ -114,8 +114,8 @@ void CWorldShadow::BuildLightShadowTexture(const CStateManager& mgr, TAreaId aid
CGraphics::SetBlendMode(ERglBlendMode::Blend, ERglBlendFactor::SrcAlpha, ERglBlendFactor::InvSrcAlpha, CGraphics::SetBlendMode(ERglBlendMode::Blend, ERglBlendFactor::SrcAlpha, ERglBlendFactor::InvSrcAlpha,
ERglLogicOp::Clear); ERglLogicOp::Clear);
CGraphics::SetAlphaCompare(ERglAlphaFunc::Always, 0, ERglAlphaOp::And, ERglAlphaFunc::Always, 0); CGraphics::SetAlphaCompare(ERglAlphaFunc::Always, 0, ERglAlphaOp::And, ERglAlphaFunc::Always, 0);
CGraphics::SetTevOp(ERglTevStage::Stage0, CTevCombiners::sTevPass805a5ebc); CGraphics::SetTevOp(ERglTevStage::Stage0, CTevCombiners::kEnvModulate);
CGraphics::SetTevOp(ERglTevStage::Stage1, CTevCombiners::skPassThru); CGraphics::SetTevOp(ERglTevStage::Stage1, CTevCombiners::kEnvPassthru);
CGraphics::Render2D(*x0_texture, 0, x0_texture->GetWidth() * 2, x0_texture->GetHeight() * 2, CGraphics::Render2D(*x0_texture, 0, x0_texture->GetWidth() * 2, x0_texture->GetHeight() * 2,
x0_texture->GetWidth() * -2, zeus::CColor{1.f, 0.85f}); x0_texture->GetWidth() * -2, zeus::CColor{1.f, 0.85f});
CGraphics::SetDepthWriteMode(true, ERglEnum::LEqual, true); CGraphics::SetDepthWriteMode(true, ERglEnum::LEqual, true);