diff --git a/Runtime/AutoMapper/CAutoMapper.cpp b/Runtime/AutoMapper/CAutoMapper.cpp index 585bac5d4..ff5028e9e 100644 --- a/Runtime/AutoMapper/CAutoMapper.cpp +++ b/Runtime/AutoMapper/CAutoMapper.cpp @@ -1441,7 +1441,6 @@ void CAutoMapper::Draw(const CStateManager& mgr, const zeus::CTransform& xf, flo zeus::CColor modColor = g_tweakAutoMapper->GetMiniMapSamusModColor(); modColor.a() *= colorAlpha; CModelFlags flags(5, 0, 8 | 1, modColor); /* Depth GEqual */ - flags.m_extendedShader = EExtendedShader::DepthGEqualNoZWrite; x30_miniMapSamus->Draw(flags); } if (IsInMapperState(EAutoMapperState::MapScreen)) { diff --git a/Runtime/Character/CModelData.cpp b/Runtime/Character/CModelData.cpp index 34099fa5c..7fe084e70 100644 --- a/Runtime/Character/CModelData.cpp +++ b/Runtime/Character/CModelData.cpp @@ -291,8 +291,8 @@ void CModelData::RenderThermal(const zeus::CColor& mulColor, const zeus::CColor& const CModelFlags& flags) const { CModelFlags drawFlags = flags; drawFlags.x4_color *= mulColor; - drawFlags.addColor = addColor; - drawFlags.m_extendedShader = EExtendedShader::Thermal; + drawFlags.m_addColor = addColor; + drawFlags.m_postType = EPostType::ThermalHot; if (x10_animData) { CSkinnedModel& model = PickAnimatedModel(EWhichModel::ThermalHot); @@ -380,46 +380,36 @@ void CModelData::Render(EWhichModel which, const zeus::CTransform& xf, const CAc void CModelData::InvSuitDraw(EWhichModel which, const zeus::CTransform& xf, const CActorLights* lights, const zeus::CColor& alphaColor, const zeus::CColor& additiveColor) { CGraphics::SetModelMatrix(xf * zeus::CTransform::Scale(x0_scale)); + constexpr CModelFlags zPrimeFlags{5, 0, 3, zeus::CColor{1.f, 0.f}}; + const CModelFlags normalFlags{5, 0, 1, alphaColor}; + const CModelFlags additiveFlags{7, 0, 1, additiveColor}; if (x10_animData) { CSkinnedModel& model = PickAnimatedModel(which); model.GetModelInst()->DisableAllLights(); CModelFlags flags = {}; /* Z-prime */ - flags.m_extendedShader = EExtendedShader::SolidColorBackfaceCullLEqualAlphaOnly; - flags.x4_color = zeus::skWhite; - x10_animData->Render(model, flags, std::nullopt, nullptr); + x10_animData->Render(model, zPrimeFlags, std::nullopt, nullptr); /* Normal Blended */ lights->ActivateLights(*model.GetModelInst()); - flags.m_extendedShader = EExtendedShader::ForcedAlpha; - flags.x4_color = alphaColor; - x10_animData->Render(model, flags, std::nullopt, nullptr); + x10_animData->Render(model, normalFlags, std::nullopt, nullptr); /* Selection Additive */ - flags.m_extendedShader = EExtendedShader::ForcedAdditive; - flags.x4_color = additiveColor; - x10_animData->Render(model, flags, std::nullopt, nullptr); + x10_animData->Render(model, additiveFlags, std::nullopt, nullptr); } else { CBooModel& model = *PickStaticModel(which); model.DisableAllLights(); - CModelFlags flags = {}; /* Z-prime */ - flags.m_extendedShader = EExtendedShader::SolidColorBackfaceCullLEqualAlphaOnly; - flags.x4_color = zeus::skWhite; - model.Draw(flags, nullptr, nullptr); + model.Draw(zPrimeFlags, nullptr, nullptr); /* Normal Blended */ lights->ActivateLights(model); - flags.m_extendedShader = EExtendedShader::ForcedAlpha; - flags.x4_color = alphaColor; - model.Draw(flags, nullptr, nullptr); + model.Draw(normalFlags, nullptr, nullptr); /* Selection Additive */ - flags.m_extendedShader = EExtendedShader::ForcedAdditive; - flags.x4_color = additiveColor; - model.Draw(flags, nullptr, nullptr); + model.Draw(additiveFlags, nullptr, nullptr); } } @@ -435,9 +425,9 @@ void CModelData::DisintegrateDraw(EWhichModel which, const zeus::CTransform& xf, CBooModel::SetDisintegrateTexture(tex.GetBooTexture()); CModelFlags flags(5, 0, 3, zeus::skWhite); - flags.m_extendedShader = EExtendedShader::Disintegrate; - flags.addColor = addColor; - flags.addColor.a() = t; // Stash T value in here (shader does not care) + flags.m_postType = EPostType::Disintegrate; + flags.m_addColor = addColor; + flags.m_addColor.a() = t; // Stash T value in here (shader does not care) if (x10_animData) { CSkinnedModel& sModel = PickAnimatedModel(which); diff --git a/Runtime/Graphics/CBooRenderer.cpp b/Runtime/Graphics/CBooRenderer.cpp index 1ddc88cb6..1a4f8ebec 100644 --- a/Runtime/Graphics/CBooRenderer.cpp +++ b/Runtime/Graphics/CBooRenderer.cpp @@ -282,9 +282,7 @@ void CBooRenderer::ActivateLightsForModel(CAreaListItem* item, CBooModel& model) } void CBooRenderer::RenderBucketItems(CAreaListItem* item) { - CModelFlags flags; - flags.m_noZWrite = true; - flags.m_extendedShader = EExtendedShader::Lighting; + CModelFlags flags{0, 0, 1, zeus::skWhite}; for (u16 idx : Buckets::sBucketIndex) { rstl::reserved_vector& bucket = (*Buckets::sBuckets)[idx]; @@ -315,9 +313,11 @@ void CBooRenderer::RenderBucketItems(CAreaListItem* item) { } } -void CBooRenderer::HandleUnsortedModel(CAreaListItem* item, CBooModel& model, const CModelFlags& flags) { +void CBooRenderer::HandleUnsortedModel(CAreaListItem* item, CBooModel& model, EPostType postType) { // ActivateLightsForModel(item, model); CBooSurface* surf = model.x38_firstUnsortedSurface; + CModelFlags flags{0, 0, 3, zeus::skWhite}; + flags.m_postType = postType; while (surf) { model.DrawSurface(*surf, flags); surf = surf->m_next; @@ -443,23 +443,24 @@ void CBooRenderer::RenderFogVolumeModel(const zeus::CAABox& aabb, const CModel* switch (pass) { case 0: default: - flags.m_extendedShader = EExtendedShader::SolidColorFrontfaceCullLEqualAlphaOnly; + //flags.m_extendedShader = EExtendedShader::SolidColorFrontfaceCullLEqualAlphaOnly; flags.x4_color = zeus::CColor(1.f, 1.f, 1.f, 1.f); break; case 1: - flags.m_extendedShader = EExtendedShader::SolidColorFrontfaceCullAlwaysAlphaOnly; + //flags.m_extendedShader = EExtendedShader::SolidColorFrontfaceCullAlwaysAlphaOnly; flags.x4_color = zeus::CColor(1.f, 1.f, 1.f, 1.f); break; case 2: - flags.m_extendedShader = EExtendedShader::SolidColorBackfaceCullLEqualAlphaOnly; + //flags.m_extendedShader = EExtendedShader::SolidColorBackfaceCullLEqualAlphaOnly; flags.x4_color = zeus::CColor(1.f, 1.f, 1.f, 0.f); break; case 3: - flags.m_extendedShader = EExtendedShader::SolidColorBackfaceCullGreaterAlphaOnly; + //flags.m_extendedShader = EExtendedShader::SolidColorBackfaceCullGreaterAlphaOnly; flags.x4_color = zeus::CColor(1.f, 1.f, 1.f, 0.f); break; } + // TODO: game uses DrawFlat if (sModel) { sModel->Draw(flags); } else { @@ -806,7 +807,7 @@ void CBooRenderer::DrawAreaGeometry(int areaIdx, int mask, int targetMask) { SCOPED_GRAPHICS_DEBUG_GROUP("CBooRenderer::DrawAreaGeometry", zeus::skPurple); x318_30_inAreaDraw = true; // SetupRendererStates(); - CModelFlags flags; + CModelFlags flags{0, 0, 3, zeus::skWhite}; for (CAreaListItem& item : x1c_areaListItems) { if (areaIdx != -1 || item.x18_areaIdx == areaIdx) { @@ -840,8 +841,7 @@ void CBooRenderer::DrawAreaGeometry(int areaIdx, int mask, int targetMask) { void CBooRenderer::DrawUnsortedGeometry(int areaIdx, int mask, int targetMask, bool shadowRender) { SCOPED_GRAPHICS_DEBUG_GROUP("CBooRenderer::DrawUnsortedGeometry", zeus::skPurple); // SetupRendererStates(); - CModelFlags flags; - flags.m_extendedShader = shadowRender ? EExtendedShader::SolidColor : EExtendedShader::Lighting; + EPostType postType = shadowRender ? EPostType::Solid : EPostType::Normal; CAreaListItem* lastOctreeItem = nullptr; @@ -900,7 +900,7 @@ void CBooRenderer::DrawUnsortedGeometry(int areaIdx, int mask, int targetMask, b } model->x40_25_modelVisible = true; - HandleUnsortedModel(lastOctreeItem, *model, flags); + HandleUnsortedModel(lastOctreeItem, *model, postType); } } @@ -941,9 +941,10 @@ void CBooRenderer::DrawStaticGeometry(int modelCount, int mask, int targetMask) } void CBooRenderer::DrawModelFlat(const CModel& model, const CModelFlags& flags, bool unsortedOnly) { + // TODO model.GetInstance().DrawFlat(unsortedOnly ? CBooModel::ESurfaceSelection::UnsortedOnly : CBooModel::ESurfaceSelection::All, - flags.m_extendedShader); + EExtendedShader::Flat); } void CBooRenderer::PostRenderFogs() { @@ -1120,9 +1121,10 @@ void CBooRenderer::DrawSpaceWarp(const zeus::CVector3f& pt, float strength) { void CBooRenderer::DrawThermalModel(const CModel& model, const zeus::CColor& mulCol, const zeus::CColor& addCol) { SCOPED_GRAPHICS_DEBUG_GROUP("CBooRenderer::DrawThermalModel", zeus::skPurple); CModelFlags flags; - flags.m_extendedShader = EExtendedShader::Thermal; + // TODO determine flags flags.x4_color = mulCol; - flags.addColor = addCol; + flags.m_postType = EPostType::ThermalHot; + flags.m_addColor = addCol; model.UpdateLastFrame(); model.Draw(flags); } @@ -1130,7 +1132,8 @@ void CBooRenderer::DrawThermalModel(const CModel& model, const zeus::CColor& mul void CBooRenderer::DrawXRayOutline(const zeus::CAABox& aabb) { SCOPED_GRAPHICS_DEBUG_GROUP("CBooRenderer::DrawXRayOutline", zeus::skPurple); CModelFlags flags; - flags.m_extendedShader = EExtendedShader::ForcedAlpha; + // TODO determine flags +// flags.m_extendedShader = EExtendedShader::ForcedAlpha; for (CAreaListItem& item : x1c_areaListItems) { if (item.x4_octTree) { @@ -1328,8 +1331,8 @@ int CBooRenderer::DrawOverlappingWorldModelIDs(int alphaVal, const std::vector6: additive, >4: blend, else opaque */ u8 x1_matSetIdx = 0; - EPostType m_postType = EPostType::Normal; - EExtendedShader m_extendedShader = EExtendedShader::Lighting; - bool m_noCull = false; - bool m_noZWrite = false; - bool m_depthGreater = false; u16 x2_flags = 0; /* Flags */ zeus::CColor x4_color; /* Set into kcolor slot specified by material */ - zeus::CColor addColor = zeus::skClear; - zeus::CAABox mbShadowBox; + EPostType m_postType = EPostType::Normal; + // For PostType::ThermalHot and Disintegrate + zeus::CColor m_addColor = zeus::skClear; + // For PostType::MBShadow + zeus::CAABox m_mbShadowBox; constexpr CModelFlags() = default; constexpr CModelFlags(u8 blendMode, u8 shadIdx, u16 flags, const zeus::CColor& col) - : x0_blendMode(blendMode), x1_matSetIdx(shadIdx), x2_flags(flags), x4_color(col) { - /* Blend mode will override this if the surface's original material is opaque */ - m_noZWrite = (x2_flags & 0x2) == 0; - m_depthGreater = (x2_flags & 0x8) != 0; - } + : x0_blendMode(blendMode), x1_matSetIdx(shadIdx), x2_flags(flags), x4_color(col) {} /* Flags 0x1: depth equal diff --git a/Runtime/Graphics/CModelBoo.cpp b/Runtime/Graphics/CModelBoo.cpp index 54e086ef3..2ce086fa0 100644 --- a/Runtime/Graphics/CModelBoo.cpp +++ b/Runtime/Graphics/CModelBoo.cpp @@ -538,7 +538,8 @@ void CBooModel::SyncLoadTextures() { void CBooModel::DrawFlat(ESurfaceSelection sel, EExtendedShader extendedIdx) const { const CBooSurface* surf; CModelFlags flags = {}; - flags.m_extendedShader = extendedIdx; + // TODO + // flags.m_extendedShader = extendedIdx; if (sel != ESurfaceSelection::SortedOnly) { surf = x38_firstUnsortedSurface; @@ -672,21 +673,21 @@ void CBooModel::DrawSurface(const CBooSurface& surf, const CModelFlags& flags) c CGraphics::DrawArrayIndexed(surf.m_data.idxStart, surf.m_data.idxCount); } -void CBooModel::WarmupDrawSurfaces() const { +void CBooModel::WarmupDrawSurfaces(const CModelFlags& unsortedFlags, const CModelFlags& sortedFlags) const { const CBooSurface* surf = x38_firstUnsortedSurface; while (surf) { - WarmupDrawSurface(*surf); + WarmupDrawSurface(*surf, unsortedFlags); surf = surf->m_next; } surf = x3c_firstSortedSurface; while (surf) { - WarmupDrawSurface(*surf); + WarmupDrawSurface(*surf, sortedFlags); surf = surf->m_next; } } -void CBooModel::WarmupDrawSurface(const CBooSurface& surf) const { +void CBooModel::WarmupDrawSurface(const CBooSurface& surf, const CModelFlags& flags) const { if (m_uniUpdateCount > m_instances.size()) return; const ModelInstance& inst = m_instances[m_uniUpdateCount - 1]; @@ -1124,7 +1125,7 @@ void CBooModel::DrawAlpha(const CModelFlags& flags, const CSkinRules* cskr, cons CModelFlags rFlags = flags; /* Check if we're overriding with RenderModelBlack */ if (g_RenderModelBlack) { - rFlags.m_extendedShader = EExtendedShader::SolidColor; + rFlags.m_postType = EPostType::Solid; rFlags.x4_color = zeus::skBlack; } @@ -1138,7 +1139,7 @@ void CBooModel::DrawNormal(const CModelFlags& flags, const CSkinRules* cskr, con CModelFlags rFlags = flags; /* Check if we're overriding with RenderModelBlack */ if (g_RenderModelBlack) { - rFlags.m_extendedShader = EExtendedShader::SolidColor; + rFlags.m_postType = EPostType::Solid; rFlags.x4_color = zeus::skBlack; } if (TryLockTextures()) { @@ -1151,7 +1152,7 @@ void CBooModel::Draw(const CModelFlags& flags, const CSkinRules* cskr, const CPo CModelFlags rFlags = flags; /* Check if we're overriding with RenderModelBlack */ if (g_RenderModelBlack) { - rFlags.m_extendedShader = EExtendedShader::SolidColor; + rFlags.m_postType = EPostType::Solid; rFlags.x4_color = zeus::skBlack; } diff --git a/Runtime/GuiSys/CGuiModel.cpp b/Runtime/GuiSys/CGuiModel.cpp index c8d1ef9c3..b724e997d 100644 --- a/Runtime/GuiSys/CGuiModel.cpp +++ b/Runtime/GuiSys/CGuiModel.cpp @@ -60,44 +60,32 @@ void CGuiModel::Draw(const CGuiWidgetDrawParms& parms) { switch (xac_drawFlags) { case EGuiModelDrawFlags::Shadeless: { - CModelFlags flags(0, 0, 3, zeus::skWhite); - flags.m_extendedShader = EExtendedShader::Flat; + constexpr CModelFlags flags(0, 0, 3, zeus::skWhite); model->Draw(flags); break; } case EGuiModelDrawFlags::Opaque: { CModelFlags flags(1, 0, 3, moduCol); - flags.m_extendedShader = EExtendedShader::Lighting; model->Draw(flags); break; } case EGuiModelDrawFlags::Alpha: { CModelFlags flags(5, 0, (u32(xb7_24_depthWrite) << 1) | u32(xb6_31_depthTest), moduCol); - flags.m_noCull = !xb6_29_cullFaces; - flags.m_noZWrite = !xb7_24_depthWrite; model->Draw(flags); break; } case EGuiModelDrawFlags::Additive: { CModelFlags flags(7, 0, (u32(xb7_24_depthWrite) << 1) | u32(xb6_31_depthTest), moduCol); - flags.m_noCull = !xb6_29_cullFaces; - flags.m_noZWrite = !xb7_24_depthWrite; - flags.m_depthGreater = xb6_30_depthGreater; model->Draw(flags); break; } case EGuiModelDrawFlags::AlphaAdditiveOverdraw: { - CModelFlags flags(5, 0, xb6_31_depthTest, moduCol); - flags.m_noCull = !xb6_29_cullFaces; - flags.m_noZWrite = !xb7_24_depthWrite; + const CModelFlags flags(5, 0, (u32(xb6_30_depthGreater) << 4) | u32(xb6_31_depthTest), moduCol); model->Draw(flags); - flags.x0_blendMode = 7; - flags.x1_matSetIdx = 0; - flags.x2_flags = (u32(xb7_24_depthWrite) << 1) | u32(xb6_31_depthTest); - flags.x4_color = moduCol; - flags.m_noCull = !xb6_29_cullFaces; - model->Draw(flags); + const CModelFlags overdrawFlags( + 8, 0, (u32(xb6_30_depthGreater) << 4) | (u32(xb7_24_depthWrite) << 1) | u32(xb6_31_depthTest), moduCol); + model->Draw(overdrawFlags); break; } default: diff --git a/Runtime/MP1/CArtifactDoll.cpp b/Runtime/MP1/CArtifactDoll.cpp index 7df5643b2..9a90bbc87 100644 --- a/Runtime/MP1/CArtifactDoll.cpp +++ b/Runtime/MP1/CArtifactDoll.cpp @@ -125,14 +125,14 @@ void CArtifactDoll::Draw(float alpha, const CStateManager& mgr, bool inArtifactC } CModelFlags flags(7, 0, 3, zeus::CColor(1.f, 0.f)); - flags.m_extendedShader = EExtendedShader::SolidColorFrontfaceCullLEqualAlphaOnly; + // TODO? + //flags.m_extendedShader = EExtendedShader::SolidColorFrontfaceCullLEqualAlphaOnly; x20_actorLights->ActivateLights(model->GetInstance()); model->Draw(flags); flags.x4_color = color; flags.x4_color.a() *= alpha; - flags.m_extendedShader = EExtendedShader::ForcedAdditive; - model->Draw(flags); + model->Draw({8, 0, 1, flags.x4_color}); } } diff --git a/Runtime/MP1/CPlayerVisor.cpp b/Runtime/MP1/CPlayerVisor.cpp index 361cbd61f..5f8150707 100644 --- a/Runtime/MP1/CPlayerVisor.cpp +++ b/Runtime/MP1/CPlayerVisor.cpp @@ -388,7 +388,6 @@ void CPlayerVisor::DrawScanEffect(const CStateManager& mgr, CTargetingManager* t CModelFlags flags(5, 0, 0, frameColor + g_tweakGuiColors->GetScanFrameImpulseColor() * zeus::CColor(x550_scanFrameColorImpulseInterp, x550_scanFrameColorImpulseInterp)); - flags.m_noCull = true; const zeus::CTransform verticalFlip = zeus::CTransform::Scale(1.f, 1.f, -1.f); const zeus::CTransform horizontalFlip = zeus::CTransform::Scale(-1.f, 1.f, 1.f); diff --git a/Runtime/MP1/CSamusDoll.cpp b/Runtime/MP1/CSamusDoll.cpp index 3aa911875..274371bba 100644 --- a/Runtime/MP1/CSamusDoll.cpp +++ b/Runtime/MP1/CSamusDoll.cpp @@ -350,19 +350,8 @@ void CSamusDoll::Draw(const CStateManager& mgr, float alpha) { { CGraphics::SetModelMatrix(gunXf); x1f4_invBeam->GetInstance().ActivateLights(x23c_lights); - CModelFlags flags = {}; - - flags.m_extendedShader = EExtendedShader::SolidColorBackfaceCullLEqualAlphaOnly; - flags.x4_color = zeus::skWhite; - x1f4_invBeam->Draw(flags); - - flags.m_extendedShader = EExtendedShader::ForcedAlpha; - flags.x4_color = zeus::CColor(1.f, alpha); - x1f4_invBeam->Draw(flags); - - flags.m_extendedShader = EExtendedShader::ForcedAdditive; - flags.x4_color = zeus::CColor(1.f, alpha * itemPulse * x5c_beamPulseFactor); - x1f4_invBeam->Draw(flags); + x1f4_invBeam->Draw({5, 0, 3, zeus::skWhite}); + x1f4_invBeam->Draw({7, 0, 1, zeus::CColor(1.f, alpha * itemPulse * x5c_beamPulseFactor)}); } { @@ -373,41 +362,22 @@ void CSamusDoll::Draw(const CStateManager& mgr, float alpha) { float addBlend = (visorT > 0.75f) ? 1.f - 4.f * (visorT - 0.75f) : (visorT > 0.5f) ? 4.f * (visorT - 0.5f) : 0.f; x200_invVisor->GetInstance().ActivateLights(x23c_lights); - CModelFlags flags = {}; - flags.m_extendedShader = EExtendedShader::Lighting; - flags.x4_color = - zeus::CColor::lerp(zeus::CColor(1.f, alpha), zeus::CColor(alphaBlend, alpha), x68_visorPulseFactor); - x200_invVisor->Draw(flags); - - flags.m_extendedShader = EExtendedShader::ForcedAdditive; - flags.x4_color = zeus::CColor(1.f, alpha * addBlend * x68_visorPulseFactor); - x200_invVisor->Draw(flags); + x200_invVisor->Draw( + {5, 0, 3, + zeus::CColor::lerp(zeus::CColor(1.f, alpha), zeus::CColor(alphaBlend, alpha), x68_visorPulseFactor)}); + x200_invVisor->Draw({7, 0, 1, zeus::CColor(1.f, alpha * addBlend * x68_visorPulseFactor)}); } if (x270_25_hasGrappleBeam) { CGraphics::SetModelMatrix(grappleXf); - x20c_invGrappleBeam->GetInstance().ActivateLights(x23c_lights); - CModelFlags flags = {}; - flags.m_extendedShader = EExtendedShader::ForcedAlpha; - flags.x4_color = zeus::CColor(1.f, alpha); - x20c_invGrappleBeam->Draw(flags); - - flags.m_extendedShader = EExtendedShader::ForcedAdditive; - flags.x4_color = zeus::CColor(1.f, alpha * itemPulse * x60_grapplePulseFactor); - x20c_invGrappleBeam->Draw(flags); + x20c_invGrappleBeam->Draw({5, 0, 3, zeus::CColor(1.f, alpha)}); + x20c_invGrappleBeam->Draw({7, 0, 1, zeus::CColor(1.f, alpha * itemPulse * x60_grapplePulseFactor)}); } else if (x44_suit >= CPlayerState::EPlayerSuit::FusionPower) { CGraphics::SetModelMatrix(grappleXf); - x218_invFins->GetInstance().ActivateLights(x23c_lights); - CModelFlags flags = {}; - flags.m_extendedShader = EExtendedShader::ForcedAlpha; - flags.x4_color = zeus::CColor(1.f, alpha); - x218_invFins->Draw(flags); - - flags.m_extendedShader = EExtendedShader::ForcedAdditive; - flags.x4_color = zeus::CColor(1.f, alpha * suitPulse); - x218_invFins->Draw(flags); + x218_invFins->Draw({5, 0, 3, zeus::CColor(1.f, alpha)}); + x218_invFins->Draw({7, 0, 1, zeus::CColor(1.f, alpha * suitPulse)}); } if (x54_remTransitionTime > 0.f) { @@ -420,19 +390,12 @@ void CSamusDoll::Draw(const CStateManager& mgr, float alpha) { ballAlpha = std::max(0.f, (x54_remTransitionTime - (x50_totalTransitionTime - 0.25f)) / 0.25f); if (ballAlpha > 0.f) { - CModelFlags flags = {}; - flags.x1_matSetIdx = x1e0_ballMatIdx; - flags.m_extendedShader = EExtendedShader::SolidColorBackfaceCullLEqualAlphaOnly; - flags.x4_color = zeus::skWhite; - x184_ballModelData->Render(mgr, x10_ballXf, x24c_actorLights.get(), flags); - - flags.m_extendedShader = EExtendedShader::ForcedAlpha; - flags.x4_color = zeus::skWhite; + CModelFlags flags = {5, u8(x1e0_ballMatIdx), 1, zeus::skWhite}; flags.x4_color.a() = alpha * ballAlpha; x184_ballModelData->Render(mgr, x10_ballXf, x24c_actorLights.get(), flags); - flags.m_extendedShader = EExtendedShader::ForcedAdditive; - flags.x4_color = zeus::skWhite; + flags.x0_blendMode = 7; + flags.x2_flags = 3; flags.x4_color.a() = x6c_ballPulseFactor * alpha * ballAlpha * itemPulse; x184_ballModelData->Render(mgr, x10_ballXf, x24c_actorLights.get(), flags); } @@ -455,10 +418,7 @@ void CSamusDoll::Draw(const CStateManager& mgr, float alpha) { zeus::CRelAngle spinAngle = zeus::degToRad(360.f * oneMinusBallEndT); spinAlpha *= 0.5f; if (spinAlpha > 0.f) { - CModelFlags flags = {}; - flags.m_extendedShader = EExtendedShader::ForcedAdditive; - flags.x1_matSetIdx = x1e0_ballMatIdx; - flags.x4_color = zeus::CColor(1.f, spinAlpha * alpha); + CModelFlags flags{7, u8(x1e0_ballMatIdx), 1, zeus::CColor(1.f, spinAlpha * alpha)}; x184_ballModelData->Render( mgr, x10_ballXf * zeus::CTransform::RotateZ(spinAngle) * zeus::CTransform::Scale(spinScale), x24c_actorLights.get(), flags); @@ -467,23 +427,10 @@ void CSamusDoll::Draw(const CStateManager& mgr, float alpha) { if (x270_24_hasSpiderBall) { CGraphics::SetModelMatrix(x10_ballXf); - CModelFlags flags = {}; - flags.x1_matSetIdx = x1e4_glassMatIdx; x1d4_spiderBallGlass->GetInstance().ActivateLights(x23c_lights); - - flags.m_extendedShader = EExtendedShader::SolidColorBackfaceCullLEqualAlphaOnly; - flags.x4_color = zeus::skWhite; - x1d4_spiderBallGlass->Draw(flags); - - flags.m_extendedShader = EExtendedShader::ForcedAlpha; - flags.x4_color = zeus::skWhite; - flags.x4_color.a() = alpha; - x1d4_spiderBallGlass->Draw(flags); - - flags.m_extendedShader = EExtendedShader::ForcedAdditive; - flags.x4_color = zeus::skWhite; - flags.x4_color.a() = x6c_ballPulseFactor * alpha * itemPulse; - x1d4_spiderBallGlass->Draw(flags); + x1d4_spiderBallGlass->Draw({5, 0, 1, zeus::CColor{1.f, 0.f}}); + x1d4_spiderBallGlass->Draw({5, u8(x1e4_glassMatIdx), 3, zeus::CColor{1.f, alpha}}); + x1d4_spiderBallGlass->Draw({7, 0, 3, zeus::CColor{1.f, x6c_ballPulseFactor * alpha * itemPulse}}); } } @@ -496,21 +443,10 @@ void CSamusDoll::Draw(const CStateManager& mgr, float alpha) { 0.1f, offset, offset); } } else { - CModelFlags flags = {}; - flags.x1_matSetIdx = x1e0_ballMatIdx; - flags.m_extendedShader = EExtendedShader::SolidColorBackfaceCullLEqualAlphaOnly; - flags.x4_color = zeus::skWhite; - x184_ballModelData->Render(mgr, x10_ballXf, x24c_actorLights.get(), flags); - - flags.m_extendedShader = EExtendedShader::ForcedAlpha; - flags.x4_color = zeus::skWhite; - flags.x4_color.a() = alpha; - x184_ballModelData->Render(mgr, x10_ballXf, x24c_actorLights.get(), flags); - - flags.m_extendedShader = EExtendedShader::ForcedAdditive; - flags.x4_color = zeus::skWhite; - flags.x4_color.a() = x6c_ballPulseFactor * alpha * itemPulse; - x184_ballModelData->Render(mgr, x10_ballXf, x24c_actorLights.get(), flags); + x184_ballModelData->Render(mgr, x10_ballXf, x24c_actorLights.get(), + {5, u8(x1e0_ballMatIdx), 3, zeus::CColor{1.f, alpha}}); + x184_ballModelData->Render(mgr, x10_ballXf, x24c_actorLights.get(), + {7, u8(x1e0_ballMatIdx), 3, zeus::CColor{1.f, x6c_ballPulseFactor * alpha * itemPulse}}); const CMorphBall::ColorArray ballGlowColorData = CMorphBall::BallGlowColors[x1e8_ballGlowColorIdx]; const zeus::CColor ballGlowColor{ @@ -548,23 +484,11 @@ void CSamusDoll::Draw(const CStateManager& mgr, float alpha) { if (x270_24_hasSpiderBall) { CGraphics::SetModelMatrix(x10_ballXf); - CModelFlags spiderBallGlassFlags = {}; - spiderBallGlassFlags.x1_matSetIdx = x1e4_glassMatIdx; x1d4_spiderBallGlass->GetInstance().ActivateLights(x23c_lights); - - spiderBallGlassFlags.m_extendedShader = EExtendedShader::SolidColorBackfaceCullLEqualAlphaOnly; - spiderBallGlassFlags.x4_color = zeus::skWhite; - x1d4_spiderBallGlass->Draw(spiderBallGlassFlags); - - spiderBallGlassFlags.m_extendedShader = EExtendedShader::ForcedAlpha; - spiderBallGlassFlags.x4_color = zeus::skWhite; - spiderBallGlassFlags.x4_color.a() = alpha; - x1d4_spiderBallGlass->Draw(spiderBallGlassFlags); - - spiderBallGlassFlags.m_extendedShader = EExtendedShader::ForcedAdditive; - spiderBallGlassFlags.x4_color = zeus::skWhite; - spiderBallGlassFlags.x4_color.a() = x6c_ballPulseFactor * alpha * itemPulse; - x1d4_spiderBallGlass->Draw(spiderBallGlassFlags); + x1d4_spiderBallGlass->Draw({5, u8(x1e4_glassMatIdx), 1, zeus::CColor{1.f, 0.f}}); + x1d4_spiderBallGlass->Draw({5, u8(x1e4_glassMatIdx), 3, zeus::CColor{1.f, alpha}}); + x1d4_spiderBallGlass->Draw( + {7, u8(x1e4_glassMatIdx), 3, zeus::CColor{1.f, x6c_ballPulseFactor * alpha * itemPulse}}); } } diff --git a/Runtime/MP1/World/CBeetle.cpp b/Runtime/MP1/World/CBeetle.cpp index 98b89e08a..350e5fd41 100644 --- a/Runtime/MP1/World/CBeetle.cpp +++ b/Runtime/MP1/World/CBeetle.cpp @@ -154,8 +154,7 @@ void CBeetle::Render(CStateManager& mgr) { zeus::CTransform tailXf = GetLctrTransform("Target_Tail"sv); if (x428_damageCooldownTimer >= 0.f && x42c_color.a() == 1.f) { if (x5ac_tailModel) { - CModelFlags flags(2, 0, 3, zeus::skWhite); - flags.addColor = x42c_color; + CModelFlags flags(2, 0, 3, x42c_color); x5ac_tailModel->Render(mgr, tailXf, x90_actorLights.get(), flags); } } else if (x5ac_tailModel) { diff --git a/Runtime/MP1/World/CGrenadeLauncher.cpp b/Runtime/MP1/World/CGrenadeLauncher.cpp index 488271482..4dbd70d19 100644 --- a/Runtime/MP1/World/CGrenadeLauncher.cpp +++ b/Runtime/MP1/World/CGrenadeLauncher.cpp @@ -127,9 +127,8 @@ std::optional CGrenadeLauncher::GetTouchBounds() const { void CGrenadeLauncher::PreRender(CStateManager& mgr, const zeus::CFrustum& frustum) { if (x3f4_damageAddColor.a() == 1.f) { - xb4_drawFlags = CModelFlags{2, 0, 3, zeus::skWhite}; // Original code redundantly sets a() = 1.f - xb4_drawFlags.addColor = x3f4_damageAddColor; + xb4_drawFlags = CModelFlags{2, 0, 3, x3f4_damageAddColor}; } else { xb4_drawFlags = CModelFlags{5, 0, 3, x3f4_damageAddColor}; } diff --git a/Runtime/Weapon/CGunWeapon.cpp b/Runtime/Weapon/CGunWeapon.cpp index b396acd6a..2c017dc95 100644 --- a/Runtime/Weapon/CGunWeapon.cpp +++ b/Runtime/Weapon/CGunWeapon.cpp @@ -503,9 +503,10 @@ void CGunWeapon::DrawHologram(const CStateManager& mgr, const zeus::CTransform& return; if (x218_29_drawHologram) { - CModelFlags useFlags = flags; - useFlags.m_extendedShader = EExtendedShader::Flat; - x60_holoModelData->Render(CModelData::EWhichModel::Normal, xf, nullptr, useFlags); + // TODO + // CModelFlags useFlags = flags; + // useFlags.m_extendedShader = EExtendedShader::Flat; + x60_holoModelData->Render(CModelData::EWhichModel::Normal, xf, nullptr, flags); } else { CGraphics::SetModelMatrix(xf * zeus::CTransform::Scale(x10_solidModelData->GetScale())); // CGraphics::DisableAllLights(); diff --git a/Runtime/Weapon/CPlayerGun.cpp b/Runtime/Weapon/CPlayerGun.cpp index eacb4a4f2..929a0a9cf 100644 --- a/Runtime/Weapon/CPlayerGun.cpp +++ b/Runtime/Weapon/CPlayerGun.cpp @@ -2145,9 +2145,10 @@ void CPlayerGun::Render(const CStateManager& mgr, const zeus::CVector3f& pos, co CGraphics::CProjectionState projState = CGraphics::GetProjectionState(); CModelFlags useFlags = flags; - if (x0_lights.HasShadowLight()) { - useFlags.m_extendedShader = EExtendedShader::LightingCubeReflectionWorldShadow; - } + // TODO? +// if (x0_lights.HasShadowLight()) { +// useFlags.m_extendedShader = EExtendedShader::LightingCubeReflectionWorldShadow; +// } CModelFlags beamFlags = useFlags; if (mgr.GetPlayerState()->GetCurrentVisor() == CPlayerState::EPlayerVisor::Thermal) { beamFlags = kThermalFlags[size_t(x310_currentBeam)]; diff --git a/Runtime/World/CActor.hpp b/Runtime/World/CActor.hpp index 301d6a386..9a5abb2ce 100644 --- a/Runtime/World/CActor.hpp +++ b/Runtime/World/CActor.hpp @@ -38,7 +38,7 @@ protected: std::unique_ptr x94_simpleShadow; TLockedToken x98_scanObjectInfo; zeus::CAABox x9c_renderBounds; - CModelFlags xb4_drawFlags; + CModelFlags xb4_drawFlags{0, 0, 3, zeus::skWhite}; float xbc_time = 0.f; float xc0_pitchBend = 0.f; TUniqueId xc4_fluidId = kInvalidUniqueId; diff --git a/Runtime/World/CGameArea.cpp b/Runtime/World/CGameArea.cpp index 786c254cc..bd92326b4 100644 --- a/Runtime/World/CGameArea.cpp +++ b/Runtime/World/CGameArea.cpp @@ -409,11 +409,12 @@ CGameArea::CGameArea(CAssetId mreaId) : x84_mrea(mreaId), xf0_25_active{false} { zeus::CTransform backupModel = CGraphics::g_GXModelMatrix; CGraphics::SetViewPointMatrix(zeus::CTransform::Translate(0.f, -2048.f, 0.f)); CGraphics::SetOrtho(-2048.f, 2048.f, 2048.f, -2048.f, 0.f, 4096.f); - CModelFlags defaultFlags; + CModelFlags unsortedFlags{0, 0, 1, zeus::skWhite}; + CModelFlags sortedFlags{0, 0, 3, zeus::skWhite}; for (CMetroidModelInstance& inst : x12c_postConstructed->x4c_insts) { CGraphics::SetModelMatrix(zeus::CTransform::Translate(-inst.x34_aabb.center())); - inst.m_instance->UpdateUniformData(defaultFlags, nullptr, nullptr); - inst.m_instance->WarmupDrawSurfaces(); + inst.m_instance->UpdateUniformData(unsortedFlags, nullptr, nullptr); + inst.m_instance->WarmupDrawSurfaces(unsortedFlags, sortedFlags); } CGraphics::SetProjectionState(backupProj); CGraphics::SetViewPointMatrix(backupViewPoint); diff --git a/Runtime/World/CMorphBall.cpp b/Runtime/World/CMorphBall.cpp index 800f8f7c5..1cb5ed77f 100644 --- a/Runtime/World/CMorphBall.cpp +++ b/Runtime/World/CMorphBall.cpp @@ -1657,7 +1657,6 @@ void CMorphBall::Render(const CStateManager& mgr, const CActorLights* lights) co if (dying) { const zeus::CColor modColor(0.f, zeus::clamp(0.f, 1.f - x0_player.x9f4_deathTime / 0.2f * 6.f, 1.f)); CModelFlags flags(7, u8(x5c_ballModelShader), 1, modColor); - flags.m_extendedShader = EExtendedShader::LightingCubeReflection; x58_ballModel->Render(mgr, ballToWorld, nullptr, flags); } @@ -1665,7 +1664,6 @@ void CMorphBall::Render(const CStateManager& mgr, const CActorLights* lights) co if (x1e44_damageEffect > 0.f) { flags = CModelFlags(1, 0, 3, zeus::CColor(1.f, 1.f - x1e44_damageEffect, 1.f - x1e44_damageEffect, 1.f)); } - flags.m_extendedShader = EExtendedShader::LightingCubeReflection; if (x1c1c_rainSplashGen && x1c1c_rainSplashGen->IsRaining()) { CSkinnedModel::SetPointGeneratorFunc(x1c1c_rainSplashGen.get(), PointGenerator); @@ -1674,7 +1672,6 @@ void CMorphBall::Render(const CStateManager& mgr, const CActorLights* lights) co if (x1c34_boostLightFactor != 1.f) { if (lights->HasShadowLight()) { x1c14_worldShadow->EnableModelProjectedShadow(ballToWorld, lights->GetShadowLightArrIndex(), 1.f); - flags.m_extendedShader = EExtendedShader::LightingCubeReflectionWorldShadow; } x58_ballModel->Render(mgr, ballToWorld, lights, flags); x1c14_worldShadow->DisableModelProjectedShadow(); @@ -1737,11 +1734,9 @@ void CMorphBall::Render(const CStateManager& mgr, const CActorLights* lights) co if (mgr.GetPlayerState()->HasPowerUp(CPlayerState::EItemType::SpiderBall) && x60_spiderBallGlassModel) { const float tmp = std::max(x1c38_spiderLightFactor, x1c34_boostLightFactor); CModelFlags sflags(0, u8(x64_spiderBallGlassModelShader), 3, zeus::skWhite); - sflags.m_extendedShader = EExtendedShader::LightingCubeReflection; if (tmp != 1.f) { if (lights->HasShadowLight()) { x1c14_worldShadow->EnableModelProjectedShadow(ballToWorld, lights->GetShadowLightArrIndex(), 1.f); - sflags.m_extendedShader = EExtendedShader::LightingCubeReflectionWorldShadow; } x60_spiderBallGlassModel->Render(mgr, ballToWorld, x1c18_actorLights.get(), sflags); x1c14_worldShadow->DisableModelProjectedShadow(); @@ -1853,7 +1848,7 @@ void CMorphBall::RenderDamageEffects(const CStateManager& mgr, const zeus::CTran CModelFlags flags(7, 0, 1, zeus::CColor(0.25f * x1e44_damageEffect, 0.1f * x1e44_damageEffect, 0.1f * x1e44_damageEffect, 1.f)); // No Z update - flags.m_extendedShader = EExtendedShader::SolidColorAdditive; + flags.m_postType = EPostType::Solid; for (int i = 0; i < 5; ++i) { rand.Float(); const float translateMag = 0.15f * x1e44_damageEffect * std::sin(30.f * x1e4c_damageTime + rand.Float() * M_PIF); diff --git a/Runtime/World/CMorphBallShadow.cpp b/Runtime/World/CMorphBallShadow.cpp index 162901b17..543707be7 100644 --- a/Runtime/World/CMorphBallShadow.cpp +++ b/Runtime/World/CMorphBallShadow.cpp @@ -72,7 +72,7 @@ void CMorphBallShadow::RenderIdBuffer(const zeus::CAABox& aabb, const CStateMana CGraphics::SetModelMatrix(modelXf); CModelFlags flags(0, 0, 3, zeus::CColor{1.f, 1.f, 1.f, alphaVal / 255.f}); - flags.m_extendedShader = EExtendedShader::SolidColor; // Do solid color draw + flags.m_postType = EPostType::Solid; // Do solid color draw CBooModel& model = *modelData->PickStaticModel(CModelData::EWhichModel::Normal); model.VerifyCurrentShader(flags.x1_matSetIdx); model.DrawNormal(flags, nullptr, nullptr); @@ -117,9 +117,10 @@ void CMorphBallShadow::Render(const CStateManager& mgr, float alpha) { return; CModelFlags flags; + // TODO determine flags flags.x4_color.a() = alpha; - flags.m_extendedShader = EExtendedShader::MorphBallShadow; - flags.mbShadowBox = xb8_shadowVolume; + flags.m_postType = EPostType::MBShadow; + flags.m_mbShadowBox = xb8_shadowVolume; int alphaVal = 4; for (const CActor* actor : x0_actors) { diff --git a/Runtime/World/CPatterned.cpp b/Runtime/World/CPatterned.cpp index 4db58ca19..c27232542 100644 --- a/Runtime/World/CPatterned.cpp +++ b/Runtime/World/CPatterned.cpp @@ -1580,9 +1580,7 @@ void CPatterned::PreRender(CStateManager& mgr, const zeus::CFrustum& frustum) { /* Being damaged */ zeus::CColor col2 = col; col2.a() = alpha / 255.f; - xb4_drawFlags = CModelFlags(2, 0, 3, zeus::skWhite); - /* Make color additive */ - xb4_drawFlags.addColor = col2; + xb4_drawFlags = CModelFlags(2, 0, 3, col2); } else { xb4_drawFlags = CModelFlags(0, 0, 3, zeus::skWhite); } diff --git a/Runtime/World/CPlayer.cpp b/Runtime/World/CPlayer.cpp index 68a9beabf..14423b3ea 100644 --- a/Runtime/World/CPlayer.cpp +++ b/Runtime/World/CPlayer.cpp @@ -1403,7 +1403,6 @@ void CPlayer::RenderGun(const CStateManager& mgr, const zeus::CVector3f& pos) co x498_gunHolsterState == EGunHolsterState::Holstering)) { CBooModel::SetReflectionCube(m_reflectionCube); CModelFlags flags(5, 0, 3, zeus::CColor(1.f, x494_gunAlpha)); - flags.m_extendedShader = EExtendedShader::LightingCubeReflection; x490_gun->Render(mgr, pos, flags); } } @@ -1428,7 +1427,6 @@ void CPlayer::Render(CStateManager& mgr) { if (HasTransitionBeamModel()) { x7f0_ballTransitionBeamModel->Touch(mgr, 0); CModelFlags flags(0, 0, 3, zeus::skWhite); - flags.m_extendedShader = EExtendedShader::LightingCubeReflection; x7f0_ballTransitionBeamModel->Render(mgr, x7f4_gunWorldXf, x90_actorLights.get(), flags); } break; @@ -1452,7 +1450,6 @@ void CPlayer::Render(CStateManager& mgr) { CPhysicsActor::Render(mgr); if (HasTransitionBeamModel()) { CModelFlags flags(5, 0, 3, zeus::CColor(1.f, x588_alpha)); - flags.m_extendedShader = EExtendedShader::LightingCubeReflection; x7f0_ballTransitionBeamModel->Render(CModelData::EWhichModel::Normal, x7f4_gunWorldXf, x90_actorLights.get(), flags); } @@ -1475,13 +1472,11 @@ void CPlayer::Render(CStateManager& mgr) { const float alpha = transitionAlpha * (1.f - (ni + 1) / float(mdsp1)) * *x71c_transitionModelAlphas.GetEntry(ni); if (alpha != 0.f) { CModelData& data = *x730_transitionModels[i]; - CModelFlags flags(5, 0, 3, zeus::CColor(1.f, alpha)); - flags.m_extendedShader = EExtendedShader::LightingCubeReflection; + CModelFlags flags(5, 0, 1, zeus::CColor(1.f, alpha)); data.Render(CModelData::GetRenderingModel(mgr), *x658_transitionModelXfs.GetEntry(ni), x90_actorLights.get(), flags); if (HasTransitionBeamModel()) { - CModelFlags transFlags(5, 0, 3, zeus::CColor(1.f, alpha)); - transFlags.m_extendedShader = EExtendedShader::LightingCubeReflection; + CModelFlags transFlags(5, 0, 1, zeus::CColor(1.f, alpha)); x7f0_ballTransitionBeamModel->Render(CModelData::EWhichModel::Normal, *x594_transisionBeamXfs.GetEntry(ni), x90_actorLights.get(), transFlags); } @@ -1501,7 +1496,6 @@ void CPlayer::Render(CStateManager& mgr) { if (morphFactor > ballAlphaStart) { CModelFlags flags(5, u8(x768_morphball->GetMorphballModelShader()), 3, zeus::CColor(1.f, ballAlphaMag * (morphFactor - ballAlphaStart))); - flags.m_extendedShader = EExtendedShader::LightingCubeReflection; x768_morphball->GetMorphballModelData().Render(mgr, x768_morphball->GetBallToWorld(), x90_actorLights.get(), flags); } @@ -1525,8 +1519,7 @@ void CPlayer::Render(CStateManager& mgr) { const float theta = zeus::degToRad(360.f * rotate); ballAlpha *= 0.5f; if (ballAlpha > 0.f) { - CModelFlags flags(7, 0, 3, zeus::CColor(1.f, ballAlpha)); - flags.m_extendedShader = EExtendedShader::LightingCubeReflection; + CModelFlags flags(7, u8(x768_morphball->GetMorphballModelShader()), 1, zeus::CColor(1.f, ballAlpha)); x768_morphball->GetMorphballModelData().Render( mgr, x768_morphball->GetBallToWorld() * zeus::CTransform::RotateZ(theta) * zeus::CTransform::Scale(scale), diff --git a/Runtime/World/CScriptColorModulate.cpp b/Runtime/World/CScriptColorModulate.cpp index 2a87c61ee..f43b2355b 100644 --- a/Runtime/World/CScriptColorModulate.cpp +++ b/Runtime/World/CScriptColorModulate.cpp @@ -135,7 +135,7 @@ CModelFlags CScriptColorModulate::CalculateFlags(const zeus::CColor& col) const ret.x0_blendMode = 2; ret.x1_matSetIdx = 0; ret.x2_flags = x54_26_depthCompare << 0 | x54_27_depthUpdate << 1 | 0x8; - ret.addColor = col; + ret.x4_color = col; } else { ret.x2_flags = 3; ret.x4_color = zeus::skWhite; @@ -179,7 +179,7 @@ CModelFlags CScriptColorModulate::CalculateFlags(const zeus::CColor& col) const ret.x0_blendMode = 2; ret.x1_matSetIdx = 0; ret.x2_flags = x54_26_depthCompare << 0 | x54_27_depthUpdate << 1; - ret.addColor = col; + ret.x4_color = col; } else { ret.x2_flags = 3; ret.x4_color = zeus::skWhite; diff --git a/Runtime/World/CScriptPlayerActor.cpp b/Runtime/World/CScriptPlayerActor.cpp index b087277c5..602bdb45a 100644 --- a/Runtime/World/CScriptPlayerActor.cpp +++ b/Runtime/World/CScriptPlayerActor.cpp @@ -386,7 +386,6 @@ void CScriptPlayerActor::PreRender(CStateManager& mgr, const zeus::CFrustum& fru if (x2e8_suitRes.GetCharacterNodeId() == 3) { g_Renderer->AllocatePhazonSuitMaskTexture(); } - xb4_drawFlags.m_extendedShader = EExtendedShader::LightingCubeReflection; CScriptActor::PreRender(mgr, frustum); } @@ -414,11 +413,7 @@ void CScriptPlayerActor::Render(CStateManager& mgr) { if (x314_beamModelData && !x314_beamModelData->IsNull() && x64_modelData && !x64_modelData->IsNull()) { zeus::CTransform modelXf = GetTransform() * x64_modelData->GetScaledLocatorTransform("GUN_LCTR"); - CModelFlags flags(5, 0, 3, zeus::skWhite); - flags.m_extendedShader = EExtendedShader::SolidColorBackfaceCullLEqualAlphaOnly; - x314_beamModelData->Render(mgr, modelXf, x90_actorLights.get(), flags); - flags.m_extendedShader = EExtendedShader::LightingCubeReflection; - flags.x4_color = zeus::CColor{1.f, xb4_drawFlags.x4_color.a()}; + CModelFlags flags(5, 0, 3, zeus::CColor{1.f, xb4_drawFlags.x4_color.a()}); x314_beamModelData->Render(mgr, modelXf, x90_actorLights.get(), flags); } diff --git a/Runtime/World/CWorld.cpp b/Runtime/World/CWorld.cpp index 0bb1d61d1..616bb880a 100644 --- a/Runtime/World/CWorld.cpp +++ b/Runtime/World/CWorld.cpp @@ -669,8 +669,7 @@ void CWorld::DrawSky(const zeus::CTransform& xf) const { g_Renderer->SetAmbientColor(zeus::skWhite); CGraphics::SetDepthRange(DEPTH_SKY, DEPTH_FAR); - CModelFlags flags(0, 0, 1, zeus::skWhite); - flags.m_noZWrite = true; + constexpr CModelFlags flags(0, 0, 1, zeus::skWhite); model->Draw(flags); CGraphics::SetDepthRange(DEPTH_WORLD, DEPTH_FAR); diff --git a/Runtime/World/CWorldTransManager.cpp b/Runtime/World/CWorldTransManager.cpp index a1c3b80d8..f577fc3ff 100644 --- a/Runtime/World/CWorldTransManager.cpp +++ b/Runtime/World/CWorldTransManager.cpp @@ -172,8 +172,7 @@ void CWorldTransManager::Update(float dt) { } void CWorldTransManager::DrawPlatformModels(CActorLights* lights) { - CModelFlags flags = {}; - flags.m_extendedShader = EExtendedShader::Lighting; + CModelFlags flags{0, 0, 3, zeus::skWhite}; if (!x4_modelData->x100_bgModelData[0].IsNull()) { zeus::CTransform xf0 = zeus::CTransform::Translate(0.f, 0.f, -(2.f * x1c_bgHeight - x18_bgOffset)); @@ -198,8 +197,7 @@ void CWorldTransManager::DrawAllModels(CActorLights* lights) { DrawPlatformModels(lights); if (!x4_modelData->x1c_samusModelData.IsNull()) { - CModelFlags flags = {}; - flags.m_extendedShader = EExtendedShader::LightingCubeReflection; + CModelFlags flags{0, 0, 3, zeus::skWhite}; x4_modelData->x1c_samusModelData.GetAnimationData()->PreRender(); x4_modelData->x1c_samusModelData.Render(CModelData::EWhichModel::Normal, zeus::CTransform(), lights,