From 40e0b70d0ef758946b996b70e3ba64d84eea6deb Mon Sep 17 00:00:00 2001 From: Jack Andersen Date: Sun, 31 Jul 2016 20:36:51 -1000 Subject: [PATCH] ColorRegs for CModelFlags --- Editor/ViewManager.cpp | 9 ++++++--- Runtime/Graphics/CModel.hpp | 1 + Runtime/Graphics/CModelBoo.cpp | 3 +++ hecl | 2 +- 4 files changed, 11 insertions(+), 4 deletions(-) diff --git a/Editor/ViewManager.cpp b/Editor/ViewManager.cpp index d45882d7a..10329717a 100644 --- a/Editor/ViewManager.cpp +++ b/Editor/ViewManager.cpp @@ -25,7 +25,8 @@ URDE_DECL_SPECIALIZE_SHADER(CSpaceWarpFilter) void ViewManager::BuildTestPART(urde::IObjectStore& objStore) { - m_modelTest = objStore.GetObj("gun_cmdl"); + //m_modelTest = objStore.GetObj("gun_cmdl"); + m_modelTest = objStore.GetObj("MP1/Shared/CMDL_B2B41738.blend"); //m_modelTest = objStore.GetObj("CMDL_GameCube"); m_modelTest.Lock(); @@ -81,7 +82,9 @@ void ViewManager::ParticleView::draw(boo::IGraphicsCommandQueue *gfxQ) flags.m_extendedShaderIdx = 1; m_theta += 0.01f; - CGraphics::SetModelMatrix(zeus::CTransform::RotateZ(m_theta) * zeus::CTransform::Scale(10.f)); + CGraphics::SetModelMatrix(zeus::CTransform::Translate(0.f, 0.f, -3.f) * + zeus::CTransform::RotateZ(m_theta) * + zeus::CTransform::Scale(1.f)); //CGraphics::SetModelMatrix(zeus::CTransform::Identity()); CGraphics::SetViewPointMatrix(zeus::lookAt(zeus::CVector3f{0.f, -10.f, 4.f}, {0.f, 0.f, 0.f})); boo::SWindowRect windowRect = m_vm.m_mainWindow->getWindowFrame(); @@ -97,7 +100,7 @@ void ViewManager::ParticleView::draw(boo::IGraphicsCommandQueue *gfxQ) m_vm.m_modelTest->Draw(flags); m_spaceWarpFilter.setStrength(std::sin(m_theta * 5.f) * 0.5f + 0.5f); - m_spaceWarpFilter.draw(zeus::CVector2f{0.f, 0.f}); + //m_spaceWarpFilter.draw(zeus::CVector2f{0.f, 0.f}); } if (m_vm.m_partGen) { diff --git a/Runtime/Graphics/CModel.hpp b/Runtime/Graphics/CModel.hpp index aac144322..c66755726 100644 --- a/Runtime/Graphics/CModel.hpp +++ b/Runtime/Graphics/CModel.hpp @@ -26,6 +26,7 @@ struct CModelFlags u16 m_flags = 0; /* Flags */ zeus::CColor color; /* Set into kcolor slot specified by material */ zeus::CColor addColor = zeus::CColor::skClear; + zeus::CColor regColors[3]; CModelFlags() = default; CModelFlags(u8 blendMode, u8 shadIdx, u16 flags, const zeus::CColor& col) diff --git a/Runtime/Graphics/CModelBoo.cpp b/Runtime/Graphics/CModelBoo.cpp index 345dfa3b0..daa5c1524 100644 --- a/Runtime/Graphics/CModelBoo.cpp +++ b/Runtime/Graphics/CModelBoo.cpp @@ -518,6 +518,9 @@ void CBooModel::UpdateUniformData(const CModelFlags& flags) const { CModelShaders::LightingUniform& lightingOut = *reinterpret_cast(dataCur); lightingOut = m_lightingData; + lightingOut.colorRegs[0] = flags.regColors[0]; + lightingOut.colorRegs[1] = flags.regColors[1]; + lightingOut.colorRegs[2] = flags.regColors[2]; } m_uniformBuffer->unmap(); diff --git a/hecl b/hecl index 883076358..e5a19203f 160000 --- a/hecl +++ b/hecl @@ -1 +1 @@ -Subproject commit 8830763583627a50b755d1e9ef4a02ec76c91c6f +Subproject commit e5a19203f99b180beb27660f480b9192ea6fcff2