mirror of https://github.com/AxioDL/metaforce.git
Runtime: GX state accuracy updates
CullMode, AlphaUpdate, ColorUpdate, DstAlpha
This commit is contained in:
parent
4995a1524e
commit
73c7755e4c
|
@ -468,18 +468,23 @@ void CActorLights::ActivateLights(CBooModel& model) const {
|
|||
|
||||
if (x298_28_inArea) {
|
||||
if (!x298_26_hasAreaLights || x299_26_ambientOnly) {
|
||||
// g_Renderer->SetAmbientColor(zeus::skWhite);
|
||||
g_Renderer->SetAmbientColor(zeus::skWhite);
|
||||
lights.push_back(CLight::BuildLocalAmbient(zeus::skZero3f, zeus::skWhite));
|
||||
model.ActivateLights(lights);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
zeus::CColor amb = x288_ambientColor;
|
||||
amb.a() = 1.f;
|
||||
g_Renderer->SetAmbientColor(amb);
|
||||
|
||||
lights = BuildLightVector();
|
||||
model.ActivateLights(lights);
|
||||
|
||||
if (x298_31_disableWorldLights) {
|
||||
zeus::CColor color(x2d4_worldLightingLevel);
|
||||
g_Renderer->SetAmbientColor(zeus::skBlack);
|
||||
g_Renderer->SetGXRegister1Color(color);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -386,7 +386,6 @@ void CModelData::InvSuitDraw(EWhichModel which, const zeus::CTransform& xf, cons
|
|||
if (x10_animData) {
|
||||
CSkinnedModel& model = PickAnimatedModel(which);
|
||||
model.GetModelInst()->DisableAllLights();
|
||||
CModelFlags flags = {};
|
||||
|
||||
/* Z-prime */
|
||||
x10_animData->Render(model, zPrimeFlags, std::nullopt, nullptr);
|
||||
|
|
|
@ -555,12 +555,16 @@ void CBooRenderer::ReallyRenderFogVolume(const zeus::CColor& color, const zeus::
|
|||
fvs = nullptr;
|
||||
}
|
||||
|
||||
CGraphics::SetCullMode(ERglCullMode::Front);
|
||||
CGraphics::SetDstAlpha(true, 1.f);
|
||||
RenderFogVolumeModel(aabb, model, CGraphics::g_GXModelMatrix, CGraphics::g_ViewMatrix, sModel, 0, fvs);
|
||||
if (camInModel)
|
||||
RenderFogVolumeModel(aabb, model, CGraphics::g_GXModelMatrix, CGraphics::g_ViewMatrix, sModel, 1, fvs);
|
||||
CGraphics::SetDstAlpha(true, 0.f);
|
||||
|
||||
CGraphics::ResolveSpareDepth(rect, 0);
|
||||
|
||||
CGraphics::SetCullMode(ERglCullMode::Back);
|
||||
RenderFogVolumeModel(aabb, model, CGraphics::g_GXModelMatrix, CGraphics::g_ViewMatrix, sModel, 2, fvs);
|
||||
if (camInModel)
|
||||
RenderFogVolumeModel(aabb, model, CGraphics::g_GXModelMatrix, CGraphics::g_ViewMatrix, sModel, 3, fvs);
|
||||
|
@ -1055,7 +1059,7 @@ void CBooRenderer::SetDebugOption(EDebugOption, int) {}
|
|||
|
||||
void CBooRenderer::BeginScene() {
|
||||
CGraphics::SetViewport(0, 0, g_Viewport.x8_width, g_Viewport.xc_height);
|
||||
CGraphics::SetCullMode(ERglCullMode::Front);
|
||||
CGraphics::SetCullMode(ERglCullMode::Back);
|
||||
CGraphics::SetDepthWriteMode(true, ERglEnum::LEqual, true);
|
||||
CGraphics::SetBlendMode(ERglBlendMode::Blend, ERglBlendFactor::SrcAlpha, ERglBlendFactor::InvSrcAlpha,
|
||||
ERglLogicOp::Clear);
|
||||
|
@ -1074,7 +1078,7 @@ void CBooRenderer::BeginScene() {
|
|||
x318_26_requestRGBA6 = false;
|
||||
// GXSetPixelFmt(x318_27_currentRGBA6);
|
||||
CGraphics::SetAlphaUpdate(true);
|
||||
// GXSetDstAlpha(true, 0);
|
||||
CGraphics::SetDstAlpha(true, 0.f);
|
||||
CGraphics::BeginScene();
|
||||
m_nextFogVolumePlaneShader = m_fogVolumePlaneShaders.begin();
|
||||
m_nextFogVolumeFilter = m_fogVolumeFilters.begin();
|
||||
|
@ -1278,6 +1282,8 @@ void CBooRenderer::DrawPhazonSuitIndirectEffect(const zeus::CColor& nonIndirectM
|
|||
ReallyDrawPhazonSuitIndirectEffect(zeus::skWhite, *indTex, indirectMod, scale, offX, offY);
|
||||
else
|
||||
ReallyDrawPhazonSuitEffect(nonIndirectMod);
|
||||
|
||||
CGraphics::SetDstAlpha(false);
|
||||
}
|
||||
|
||||
void CBooRenderer::AllocatePhazonSuitMaskTexture() {
|
||||
|
@ -1351,7 +1357,7 @@ int CBooRenderer::DrawOverlappingWorldModelIDs(int alphaVal, const std::vector<u
|
|||
return alphaVal;
|
||||
}
|
||||
|
||||
flags.x4_color.a() = static_cast<float>(alphaVal) / 255.f;
|
||||
CGraphics::SetDstAlpha(true, alphaVal);
|
||||
CBooModel& model = *item.x10_models[wordModel + j];
|
||||
model.UpdateUniformData(flags, nullptr, nullptr, 3);
|
||||
model.VerifyCurrentShader(0);
|
||||
|
|
|
@ -17,9 +17,15 @@ ERglBlendMode gx_BlendMode;
|
|||
ERglBlendFactor gx_BlendSrcFac;
|
||||
ERglBlendFactor gx_BlendDstFac;
|
||||
ERglLogicOp gx_BlendOp;
|
||||
bool gx_AlphaWrite;
|
||||
bool gx_AlphaUpdate = true;
|
||||
bool gx_ColorUpdate = true;
|
||||
bool gx_DstAlpha = false;
|
||||
float gx_DstAlphaValue = 0.f;
|
||||
ERglCullMode gx_CullMode;
|
||||
std::array<zeus::CColor, 2> gx_AmbientColors;
|
||||
std::array<zeus::CColor, 2> gx_AmbientColors = {{
|
||||
zeus::CColor{0.2f, 0.2f, 0.2f, 1.f},
|
||||
zeus::CColor{0.2f, 0.2f, 0.2f, 1.f},
|
||||
}};
|
||||
/// End GX state
|
||||
|
||||
hsh::owner<hsh::render_texture2d> CGraphics::g_SpareTexture;
|
||||
|
@ -124,8 +130,16 @@ void CGraphics::SetBlendMode(ERglBlendMode type, ERglBlendFactor srcFac, ERglBle
|
|||
|
||||
void CGraphics::SetCullMode(ERglCullMode mode) { gx_CullMode = mode; }
|
||||
|
||||
// URDE addition (GXSetAlphaUpdate)
|
||||
void CGraphics::SetAlphaUpdate(bool value) { gx_AlphaWrite = value; }
|
||||
// URDE additions (GXSetAlphaUpdate, GXSetColorUpdate, GXSetDstAlpha)
|
||||
void CGraphics::SetAlphaUpdate(bool value) { gx_AlphaUpdate = value; }
|
||||
void CGraphics::SetColorUpdate(bool value) { gx_ColorUpdate = value; }
|
||||
void CGraphics::SetDstAlpha(bool enabled, float alpha) {
|
||||
gx_DstAlpha = enabled;
|
||||
gx_DstAlphaValue = alpha;
|
||||
if (enabled) {
|
||||
hsh::set_blend_constants(0.f, 0.f, 0.f, alpha);
|
||||
}
|
||||
}
|
||||
|
||||
void CGraphics::BeginScene() {}
|
||||
|
||||
|
|
|
@ -71,7 +71,7 @@ enum class ERglLogicOp {
|
|||
Set = 15
|
||||
};
|
||||
|
||||
enum class ERglCullMode { None = 0, Front = 1, Back = 2, All = 3 };
|
||||
enum class ERglCullMode { None = 0, Back = 1, Front = 2, All = 3 };
|
||||
|
||||
enum class ERglAlphaFunc {
|
||||
Never = 0,
|
||||
|
@ -119,7 +119,10 @@ extern ERglBlendMode gx_BlendMode;
|
|||
extern ERglBlendFactor gx_BlendSrcFac;
|
||||
extern ERglBlendFactor gx_BlendDstFac;
|
||||
extern ERglLogicOp gx_BlendOp;
|
||||
extern bool gx_AlphaWrite;
|
||||
extern bool gx_ColorUpdate;
|
||||
extern bool gx_AlphaUpdate;
|
||||
extern bool gx_DstAlpha;
|
||||
extern float gx_DstAlphaValue;
|
||||
extern ERglCullMode gx_CullMode;
|
||||
// GX_COLOR0A0 & GX_COLOR1A1
|
||||
extern std::array<zeus::CColor, 2> gx_AmbientColors;
|
||||
|
@ -299,6 +302,8 @@ public:
|
|||
static void SetBlendMode(ERglBlendMode type, ERglBlendFactor srcFac, ERglBlendFactor dstFac, ERglLogicOp op);
|
||||
static void SetCullMode(ERglCullMode mode);
|
||||
static void SetAlphaUpdate(bool value);
|
||||
static void SetColorUpdate(bool value);
|
||||
static void SetDstAlpha(bool enabled, float alpha = 0.f);
|
||||
static void BeginScene();
|
||||
static void EndScene();
|
||||
static void SetAlphaCompare(ERglAlphaFunc comp0, u8 ref0, ERglAlphaOp op, ERglAlphaFunc comp1, u8 ref1);
|
||||
|
@ -337,7 +342,7 @@ public:
|
|||
|
||||
static const std::array<zeus::CMatrix3f, 6> skCubeBasisMats;
|
||||
|
||||
static void InitializeBoo(hsh::surface surface) { g_SpareTexture = hsh::create_render_texture2d(surface, 4, 1); }
|
||||
static void InitializeBoo(hsh::surface surface) { g_SpareTexture = hsh::create_render_texture2d(surface, 3, 3); }
|
||||
|
||||
static void ShutdownBoo() { g_SpareTexture.reset(); }
|
||||
|
||||
|
@ -346,10 +351,12 @@ public:
|
|||
g_SpareTexture.resolve_color_binding(bindIdx, wrect);
|
||||
if (clearDepth)
|
||||
hsh::clear_attachments(false, true);
|
||||
hsh::set_blend_constants(0.f, 0.f, 0.f, gx_DstAlphaValue);
|
||||
}
|
||||
static void ResolveSpareDepth(const SClipScreenRect& rect, int bindIdx = 0) {
|
||||
hsh::rect2d wrect = {{rect.x4_left, rect.x8_top}, {rect.xc_width, rect.x10_height}};
|
||||
g_SpareTexture.resolve_depth_binding(bindIdx, wrect);
|
||||
hsh::set_blend_constants(0.f, 0.f, 0.f, gx_DstAlphaValue);
|
||||
}
|
||||
|
||||
static const CTevCombiners::CTevPass sTevPass805a564c;
|
||||
|
|
|
@ -1388,7 +1388,7 @@ void CModel::_WarmupShaders() {
|
|||
for (SShader& shader : x18_matSets) {
|
||||
GetInstance().RemapMaterialData(shader);
|
||||
GetInstance().UpdateUniformData(defaultFlags, nullptr, nullptr);
|
||||
GetInstance().WarmupDrawSurfaces();
|
||||
GetInstance().WarmupDrawSurfaces(defaultFlags, defaultFlags);
|
||||
}
|
||||
CGraphics::SetProjectionState(backupProj);
|
||||
CGraphics::SetViewPointMatrix(backupViewPoint);
|
||||
|
|
|
@ -485,12 +485,14 @@ void CCompoundTargetReticle::Draw(const CStateManager& mgr, bool hideLockon) {
|
|||
SCOPED_GRAPHICS_DEBUG_GROUP("CCompoundTargetReticle::Draw", zeus::skCyan);
|
||||
const zeus::CTransform camXf = mgr.GetCameraManager()->GetCurrentCameraTransform(mgr);
|
||||
CGraphics::SetViewPointMatrix(camXf);
|
||||
CGraphics::SetCullMode(ERglCullMode::None);
|
||||
if (!hideLockon) {
|
||||
DrawCurrLockOnGroup(camXf.basis, mgr);
|
||||
DrawNextLockOnGroup(camXf.basis, mgr);
|
||||
DrawOrbitZoneGroup(camXf.basis, mgr);
|
||||
}
|
||||
DrawGrappleGroup(camXf.basis, mgr, hideLockon);
|
||||
CGraphics::SetCullMode(ERglCullMode::Back);
|
||||
}
|
||||
|
||||
if (x28_noDrawTicks > 0) {
|
||||
|
|
|
@ -73,10 +73,10 @@ void CGuiFrame::EnableLights(u32 lights, CBooModel& model) const {
|
|||
++idx;
|
||||
}
|
||||
if (lightsOut.empty()) {
|
||||
// CGraphics::SetAmbientColor(zeus::skWhite);
|
||||
CGraphics::SetAmbientColor(zeus::skWhite);
|
||||
lightsOut.push_back(CLight::BuildLocalAmbient(zeus::skZero3f, zeus::skWhite));
|
||||
} else {
|
||||
// CGraphics::SetAmbientColor(ambColor);
|
||||
CGraphics::SetAmbientColor(ambColor);
|
||||
lightsOut.push_back(CLight::BuildLocalAmbient(zeus::skZero3f, ambColor));
|
||||
}
|
||||
|
||||
|
@ -126,9 +126,7 @@ void CGuiFrame::SetMaxAspect(float c) {
|
|||
CGuiSys::ViewportResizeFrame(this);
|
||||
}
|
||||
|
||||
void CGuiFrame::Reset() {
|
||||
x10_rootWidget->Reset(ETraversalMode::Children);
|
||||
}
|
||||
void CGuiFrame::Reset() { x10_rootWidget->Reset(ETraversalMode::Children); }
|
||||
|
||||
void CGuiFrame::Update(float dt) { xc_headWidget->Update(dt); }
|
||||
|
||||
|
@ -200,8 +198,7 @@ void CGuiFrame::ProcessUserInput(const CFinalInput& input) const {
|
|||
|
||||
bool CGuiFrame::ProcessMouseInput(const CFinalInput& input, const CGuiWidgetDrawParms& parms) {
|
||||
if (const auto& kbm = input.GetKBM()) {
|
||||
zeus::CVector2f point(kbm->m_mouseCoord.x * 2.f - 1.f,
|
||||
kbm->m_mouseCoord.y * 2.f - 1.f);
|
||||
zeus::CVector2f point(kbm->m_mouseCoord.x * 2.f - 1.f, kbm->m_mouseCoord.y * 2.f - 1.f);
|
||||
CGuiWidget* hit = BestCursorHit(point, parms);
|
||||
if (hit != m_lastMouseOverWidget) {
|
||||
if (m_inMouseDown && m_mouseDownWidget != hit) {
|
||||
|
|
|
@ -55,8 +55,8 @@ void CGuiModel::Draw(const CGuiWidgetDrawParms& parms) {
|
|||
zeus::CColor moduCol = xa8_color2;
|
||||
moduCol.a() *= parms.x0_alphaMod;
|
||||
xb0_frame->EnableLights(xcc_lightMask, model->GetInstance());
|
||||
// if (xb6_29_cullFaces)
|
||||
// CGraphics::SetCullMode(ERglCullMode::Front);
|
||||
if (xb6_29_cullFaces)
|
||||
CGraphics::SetCullMode(ERglCullMode::Back);
|
||||
|
||||
switch (xac_drawFlags) {
|
||||
case EGuiModelDrawFlags::Shadeless: {
|
||||
|
@ -92,8 +92,8 @@ void CGuiModel::Draw(const CGuiWidgetDrawParms& parms) {
|
|||
break;
|
||||
}
|
||||
|
||||
// if (xb6_29_cullFaces)
|
||||
// CGraphics::SetCullMode(ERglCullMode::None);
|
||||
if (xb6_29_cullFaces)
|
||||
CGraphics::SetCullMode(ERglCullMode::None);
|
||||
xb0_frame->DisableLights();
|
||||
}
|
||||
|
||||
|
|
|
@ -101,6 +101,7 @@ void CArtifactDoll::Draw(float alpha, const CStateManager& mgr, bool inArtifactC
|
|||
CGraphics::SetModelMatrix(zeus::CTransform::RotateX(zeus::degToRad(std::sin(angle) * 8.f)) *
|
||||
zeus::CTransform::RotateZ(zeus::degToRad(std::cos(angle) * 8.f)) *
|
||||
zeus::CTransform::RotateX(M_PIF / 2.f) * zeus::CTransform::Scale(0.2f));
|
||||
CGraphics::SetCullMode(ERglCullMode::None);
|
||||
|
||||
CPlayerState& playerState = *mgr.GetPlayerState();
|
||||
for (size_t i = 0; i < x0_models.size(); ++i) {
|
||||
|
@ -134,6 +135,8 @@ void CArtifactDoll::Draw(float alpha, const CStateManager& mgr, bool inArtifactC
|
|||
flags.x4_color.a() *= alpha;
|
||||
model->Draw({8, 0, 1, flags.x4_color});
|
||||
}
|
||||
CGraphics::SetCullMode(ERglCullMode::Back);
|
||||
// CGraphics::DisableAllLights();
|
||||
}
|
||||
|
||||
void CArtifactDoll::UpdateActorLights() {
|
||||
|
|
|
@ -379,7 +379,7 @@ void CPlayerVisor::DrawScanEffect(const CStateManager& mgr, CTargetingManager* t
|
|||
}};
|
||||
x108_newScanPane.drawVerts(zeus::CColor(1.f, transFactor), rttVerts);
|
||||
|
||||
// No cull faces
|
||||
CGraphics::SetCullMode(ERglCullMode::None);
|
||||
|
||||
zeus::CColor frameColor = zeus::CColor::lerp(g_tweakGuiColors->GetScanFrameInactiveColor(),
|
||||
g_tweakGuiColors->GetScanFrameActiveColor(), x54c_scanFrameColorInterp);
|
||||
|
@ -451,7 +451,7 @@ void CPlayerVisor::DrawScanEffect(const CStateManager& mgr, CTargetingManager* t
|
|||
xf0_scanFrameStretchSide->Draw(flags);
|
||||
}
|
||||
|
||||
// cull faces
|
||||
CGraphics::SetCullMode(ERglCullMode::Back);
|
||||
}
|
||||
|
||||
void CPlayerVisor::DrawXRayEffect(const CStateManager&) {
|
||||
|
|
|
@ -332,7 +332,9 @@ void CSamusDoll::Draw(const CStateManager& mgr, float alpha) {
|
|||
float bootsPulse = std::max(suitPulse, itemPulse * x64_bootsPulseFactor);
|
||||
|
||||
bool phazonSuit = x44_suit == CPlayerState::EPlayerSuit::Phazon;
|
||||
// Enable dst alpha 1.0
|
||||
if (phazonSuit) {
|
||||
CGraphics::SetDstAlpha(true, 1.f);
|
||||
}
|
||||
|
||||
for (size_t i = 0; i <= x118_suitModel1and2.size(); ++i) {
|
||||
TCachedToken<CSkinnedModel> backupModelData = xc8_suitModel0->GetAnimationData()->GetModelData();
|
||||
|
|
|
@ -800,6 +800,8 @@ void CMain::Init(const hecl::Runtime::FileStoreManager& storeMgr, hecl::CVarMana
|
|||
x164_archSupport->PreloadAudio();
|
||||
std::srand(static_cast<u32>(std::time(nullptr)));
|
||||
// g_TweakManager->ReadFromMemoryCard("AudioTweaks");
|
||||
|
||||
m_alphaPass.SetFilter(EFilterType::NoColor, EFilterShape::Fullscreen, 0.f, zeus::skBlack, {});
|
||||
}
|
||||
|
||||
static logvisor::Module WarmupLog("ShaderWarmup");
|
||||
|
@ -911,8 +913,11 @@ void CMain::Draw() {
|
|||
return;
|
||||
}
|
||||
|
||||
#if !HSH_PROFILE_MODE
|
||||
hsh::clear_attachments();
|
||||
x164_archSupport->Draw();
|
||||
m_alphaPass.Draw();
|
||||
#endif
|
||||
}
|
||||
|
||||
void CMain::ShutdownSubsystems() {
|
||||
|
|
|
@ -254,6 +254,7 @@ private:
|
|||
using delta_clock = std::chrono::high_resolution_clock;
|
||||
std::chrono::time_point<delta_clock> m_prevFrameTime;
|
||||
DataSpec::URDEVersionInfo m_version;
|
||||
CCameraFilterPass<CColoredQuadFilter> m_alphaPass;
|
||||
|
||||
void InitializeSubsystems();
|
||||
static void InitializeDiscord();
|
||||
|
|
|
@ -855,8 +855,11 @@ void CElementGen::Render(const CActorLights* actorLights) {
|
|||
void CElementGen::RenderModels(const CActorLights* actorLights) {
|
||||
CGenDescription* desc = x1c_genDesc.GetObj();
|
||||
|
||||
if (x26d_26_modelsUseLights)
|
||||
if (x26d_26_modelsUseLights) {
|
||||
CGraphics::SetLightState(x274_backupLightActive);
|
||||
} else {
|
||||
CGraphics::SetAmbientColor(zeus::skWhite);
|
||||
}
|
||||
CGlobalRandom gr(x27c_randState);
|
||||
|
||||
SUVElementSet uvs = {0.f, 0.f, 1.f, 1.f};
|
||||
|
@ -882,9 +885,8 @@ void CElementGen::RenderModels(const CActorLights* actorLights) {
|
|||
CGraphics::SetBlendMode(ERglBlendMode::Blend, ERglBlendFactor::SrcAlpha, ERglBlendFactor::InvSrcAlpha,
|
||||
ERglLogicOp::Clear);
|
||||
}
|
||||
|
||||
CGraphics::SetCullMode(ERglCullMode::None);
|
||||
#endif
|
||||
CGraphics::SetCullMode(ERglCullMode::None);
|
||||
|
||||
if (texr) {
|
||||
CParticle& target = x30_particles[0];
|
||||
|
|
|
@ -491,13 +491,13 @@ void CGrappleArm::PreRender(const CStateManager& mgr, const zeus::CFrustum& frus
|
|||
|
||||
void CGrappleArm::RenderXRayModel(const CStateManager& mgr, const zeus::CTransform& modelXf, const CModelFlags& flags) {
|
||||
CGraphics::SetModelMatrix(modelXf * zeus::CTransform::Scale(x0_grappleArmModel->GetScale()));
|
||||
// CGraphics::DisableAllLights();
|
||||
// g_Renderer->SetAmbientColor(zeus::skWhite);
|
||||
CGraphics::DisableAllLights();
|
||||
CGraphics::SetAmbientColor(zeus::skWhite);
|
||||
CSkinnedModel& model = *x50_grappleArmSkeletonModel->GetAnimationData()->GetModelData();
|
||||
model.GetModelInst()->ActivateLights({CLight::BuildLocalAmbient({}, zeus::skWhite)});
|
||||
x0_grappleArmModel->GetAnimationData()->Render(model, flags, std::nullopt, nullptr);
|
||||
// g_Renderer->SetAmbientColor(zeus::skWhite);
|
||||
// CGraphics::DisableAllLights();
|
||||
CGraphics::SetAmbientColor(zeus::skWhite);
|
||||
CGraphics::DisableAllLights();
|
||||
}
|
||||
|
||||
void CGrappleArm::PointGenerator(void* ctx, const std::vector<std::pair<zeus::CVector3f, zeus::CVector3f>>& vn) {
|
||||
|
|
|
@ -509,13 +509,13 @@ void CGunWeapon::DrawHologram(const CStateManager& mgr, const zeus::CTransform&
|
|||
x60_holoModelData->Render(CModelData::EWhichModel::Normal, xf, nullptr, flags);
|
||||
} else {
|
||||
CGraphics::SetModelMatrix(xf * zeus::CTransform::Scale(x10_solidModelData->GetScale()));
|
||||
// CGraphics::DisableAllLights();
|
||||
// g_Renderer->SetAmbientColor(zeus::skWhite);
|
||||
CGraphics::DisableAllLights();
|
||||
CGraphics::SetAmbientColor(zeus::skWhite);
|
||||
CSkinnedModel& model = *x60_holoModelData->GetAnimationData()->GetModelData();
|
||||
model.GetModelInst()->ActivateLights({CLight::BuildLocalAmbient({}, zeus::skWhite)});
|
||||
x10_solidModelData->GetAnimationData()->Render(model, flags, std::nullopt, nullptr);
|
||||
// g_Renderer->SetAmbientColor(zeus::skWhite);
|
||||
// CGraphics::DisableAllLights();
|
||||
CGraphics::SetAmbientColor(zeus::skWhite);
|
||||
CGraphics::DisableAllLights();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -169,7 +169,7 @@ void CPhazonBeam::DrawClipScaleCube() {
|
|||
g_Renderer->SetBlendMode_AlphaBlended();
|
||||
CGraphics::SetCullMode(ERglCullMode::None);
|
||||
m_aaboxShaderScale.draw(zeus::CColor{1.f, 1.f, 1.f, 0.f});
|
||||
CGraphics::SetCullMode(ERglCullMode::Front);
|
||||
CGraphics::SetCullMode(ERglCullMode::Back);
|
||||
}
|
||||
|
||||
void CPhazonBeam::DrawClipTranslateCube() {
|
||||
|
@ -177,7 +177,7 @@ void CPhazonBeam::DrawClipTranslateCube() {
|
|||
g_Renderer->SetBlendMode_AlphaBlended();
|
||||
CGraphics::SetCullMode(ERglCullMode::None);
|
||||
m_aaboxShaderTranslate.draw(zeus::CColor{1.f, 1.f, 1.f, 0.f});
|
||||
CGraphics::SetCullMode(ERglCullMode::Front);
|
||||
CGraphics::SetCullMode(ERglCullMode::Back);
|
||||
}
|
||||
|
||||
void CPhazonBeam::Draw(bool drawSuitArm, const CStateManager& mgr, const zeus::CTransform& xf, const CModelFlags& flags,
|
||||
|
@ -187,9 +187,7 @@ void CPhazonBeam::Draw(bool drawSuitArm, const CStateManager& mgr, const zeus::C
|
|||
|
||||
if (drawIndirect) {
|
||||
CGraphics::ResolveSpareTexture(g_Viewport);
|
||||
CModelFlags tmpFlags = flags;
|
||||
tmpFlags.m_extendedShader = EExtendedShader::SolidColorBackfaceCullLEqualAlphaOnly;
|
||||
CGunWeapon::Draw(drawSuitArm, mgr, xf, tmpFlags, lights);
|
||||
CGraphics::SetDstAlpha(true, 1.f);
|
||||
}
|
||||
|
||||
CGunWeapon::Draw(drawSuitArm, mgr, xf, flags, lights);
|
||||
|
|
|
@ -2137,7 +2137,7 @@ void CPlayerGun::DrawClipCube(const zeus::CAABox& aabb) {
|
|||
g_Renderer->SetBlendMode_AlphaBlended();
|
||||
CGraphics::SetCullMode(ERglCullMode::None);
|
||||
m_aaboxShader.draw(zeus::CColor{1.f, 1.f, 1.f, 0.f});
|
||||
CGraphics::SetCullMode(ERglCullMode::Front);
|
||||
CGraphics::SetCullMode(ERglCullMode::Back);
|
||||
}
|
||||
|
||||
void CPlayerGun::Render(const CStateManager& mgr, const zeus::CVector3f& pos, const CModelFlags& flags) {
|
||||
|
|
|
@ -54,7 +54,17 @@ void CMorphBallShadow::RenderIdBuffer(const zeus::CAABox& aabb, const CStateMana
|
|||
rstl::reserved_vector<TUniqueId, 1024> nearItems;
|
||||
mgr.BuildNearList(nearItems, aabb, CMaterialFilter::skPassEverything, &player);
|
||||
|
||||
CGraphics::SetAlphaUpdate(true);
|
||||
CGraphics::SetDstAlpha(true, 0.f);
|
||||
CGraphics::SetColorUpdate(false);
|
||||
// CGX::SetZMode(true,GX_ALWAYS,true)
|
||||
//CGraphics::SetCullMode(ERglCullMode::None);
|
||||
CGraphics::SetViewPointMatrix(viewMtx);
|
||||
// CGraphics::SetAlphaCompare(Always,0,And,Always,0);
|
||||
// CGraphics::SetBlendMode(Blend,One,Zero,Clear);
|
||||
|
||||
CBooModel::SetRenderModelBlack(true);
|
||||
// TODO
|
||||
|
||||
int alphaVal = 4;
|
||||
for (TUniqueId id : nearItems) {
|
||||
|
@ -84,6 +94,10 @@ void CMorphBallShadow::RenderIdBuffer(const zeus::CAABox& aabb, const CStateMana
|
|||
g_Renderer->FindOverlappingWorldModels(x30_worldModelBits, aabb);
|
||||
alphaVal = g_Renderer->DrawOverlappingWorldModelIDs(alphaVal, x30_worldModelBits, aabb);
|
||||
|
||||
CBooModel::SetRenderModelBlack(false);
|
||||
CGraphics::SetColorUpdate(true);
|
||||
CGraphics::SetDstAlpha(false, 0.f);
|
||||
|
||||
g_Renderer->ResolveBallShadowIdTarget();
|
||||
|
||||
g_Renderer->BindMainDrawTarget();
|
||||
|
|
|
@ -402,11 +402,7 @@ void CScriptPlayerActor::Render(CStateManager& mgr) {
|
|||
const bool phazonSuit = x2e8_suitRes.GetCharacterNodeId() == 3;
|
||||
if (phazonSuit) {
|
||||
// Draw into alpha buffer
|
||||
CModelFlags flags = xb4_drawFlags;
|
||||
flags.x4_color = zeus::skWhite;
|
||||
flags.m_extendedShader = EExtendedShader::SolidColorBackfaceCullLEqualAlphaOnly;
|
||||
CModelData::EWhichModel which = CModelData::GetRenderingModel(mgr);
|
||||
x64_modelData->Render(which, x34_transform, x90_actorLights.get(), flags);
|
||||
CGraphics::SetDstAlpha(true, 1.f);
|
||||
}
|
||||
|
||||
CPhysicsActor::Render(mgr);
|
||||
|
|
Loading…
Reference in New Issue