mirror of https://github.com/AxioDL/metaforce.git
Windows Fixes; D3D depth support
This commit is contained in:
parent
dc978a4c79
commit
929f8263fc
|
@ -154,6 +154,7 @@ void ProjectResourceFactoryBase::BackgroundIndexProc()
|
||||||
{
|
{
|
||||||
std::unique_lock<std::mutex> lk(m_backgroundIndexMutex);
|
std::unique_lock<std::mutex> lk(m_backgroundIndexMutex);
|
||||||
m_tagToPath.reserve(cacheReader.getRootNode()->m_mapChildren.size());
|
m_tagToPath.reserve(cacheReader.getRootNode()->m_mapChildren.size());
|
||||||
|
size_t loadIdx = 0;
|
||||||
for (const auto& child : cacheReader.getRootNode()->m_mapChildren)
|
for (const auto& child : cacheReader.getRootNode()->m_mapChildren)
|
||||||
{
|
{
|
||||||
unsigned long id = strtoul(child.first.c_str(), nullptr, 16);
|
unsigned long id = strtoul(child.first.c_str(), nullptr, 16);
|
||||||
|
@ -161,7 +162,10 @@ void ProjectResourceFactoryBase::BackgroundIndexProc()
|
||||||
hecl::ProjectPath path(m_proj->getProjectWorkingPath(),
|
hecl::ProjectPath path(m_proj->getProjectWorkingPath(),
|
||||||
child.second->m_seqChildren.at(1)->m_scalarString);
|
child.second->m_seqChildren.at(1)->m_scalarString);
|
||||||
m_tagToPath[SObjectTag(type, id)] = path;
|
m_tagToPath[SObjectTag(type, id)] = path;
|
||||||
|
fprintf(stderr, "\r %" PRISize " / %" PRISize, loadIdx++,
|
||||||
|
cacheReader.getRootNode()->m_mapChildren.size());
|
||||||
}
|
}
|
||||||
|
fprintf(stderr, "\n");
|
||||||
}
|
}
|
||||||
fclose(cacheFile);
|
fclose(cacheFile);
|
||||||
Log.report(logvisor::Info, _S("Cache index of '%s' loaded; %d tags"),
|
Log.report(logvisor::Info, _S("Cache index of '%s' loaded; %d tags"),
|
||||||
|
|
|
@ -10,6 +10,7 @@
|
||||||
#include "Runtime/Graphics/CLineRenderer.hpp"
|
#include "Runtime/Graphics/CLineRenderer.hpp"
|
||||||
#include "Runtime/Graphics/CMoviePlayer.hpp"
|
#include "Runtime/Graphics/CMoviePlayer.hpp"
|
||||||
#include "Runtime/Graphics/CModel.hpp"
|
#include "Runtime/Graphics/CModel.hpp"
|
||||||
|
#include "Runtime/Particle/CGenDescription.hpp"
|
||||||
|
|
||||||
namespace urde
|
namespace urde
|
||||||
{
|
{
|
||||||
|
|
|
@ -132,7 +132,8 @@ void CGraphics::SetModelMatrix(const zeus::CTransform& xf)
|
||||||
}
|
}
|
||||||
|
|
||||||
zeus::CMatrix4f CGraphics::CalculatePerspectiveMatrix(float fovy, float aspect,
|
zeus::CMatrix4f CGraphics::CalculatePerspectiveMatrix(float fovy, float aspect,
|
||||||
float near, float far)
|
float near, float far,
|
||||||
|
bool forRenderer)
|
||||||
{
|
{
|
||||||
CProjectionState st;
|
CProjectionState st;
|
||||||
float tfov = std::tan(zeus::degToRad(fovy * 0.5f));
|
float tfov = std::tan(zeus::degToRad(fovy * 0.5f));
|
||||||
|
@ -147,26 +148,86 @@ zeus::CMatrix4f CGraphics::CalculatePerspectiveMatrix(float fovy, float aspect,
|
||||||
float rpl = st.x8_right + st.x4_left;
|
float rpl = st.x8_right + st.x4_left;
|
||||||
float tmb = st.xc_top - st.x10_bottom;
|
float tmb = st.xc_top - st.x10_bottom;
|
||||||
float tpb = st.xc_top + st.x10_bottom;
|
float tpb = st.xc_top + st.x10_bottom;
|
||||||
float nmf = g_Proj.x14_near - g_Proj.x18_far;
|
|
||||||
float fpn = st.x18_far + st.x14_near;
|
float fpn = st.x18_far + st.x14_near;
|
||||||
return zeus::CMatrix4f(2.f * st.x14_near / rml, 0.f, rpl / rml, 0.f,
|
float fmn = st.x18_far - st.x14_near;
|
||||||
0.f, 2.f * st.x14_near / tmb, tpb / tmb, 0.f,
|
|
||||||
0.f, 0.f, fpn / nmf, 2.f * st.x18_far * st.x14_near / nmf,
|
if (!forRenderer)
|
||||||
0.f, 0.f, -1.f, 0.f);
|
{
|
||||||
|
return zeus::CMatrix4f(2.f * st.x14_near / rml, 0.f, rpl / rml, 0.f,
|
||||||
|
0.f, 2.f * st.x14_near / tmb, tpb / tmb, 0.f,
|
||||||
|
0.f, 0.f, -fpn / fmn, -2.f * st.x18_far * st.x14_near / fmn,
|
||||||
|
0.f, 0.f, -1.f, 0.f);
|
||||||
|
}
|
||||||
|
|
||||||
|
switch (g_BooPlatform)
|
||||||
|
{
|
||||||
|
case boo::IGraphicsDataFactory::Platform::OGL:
|
||||||
|
default:
|
||||||
|
{
|
||||||
|
return zeus::CMatrix4f(2.f * st.x14_near / rml, 0.f, rpl / rml, 0.f,
|
||||||
|
0.f, 2.f * st.x14_near / tmb, tpb / tmb, 0.f,
|
||||||
|
0.f, 0.f, -fpn / fmn, -2.f * st.x18_far * st.x14_near / fmn,
|
||||||
|
0.f, 0.f, -1.f, 0.f);
|
||||||
|
}
|
||||||
|
case boo::IGraphicsDataFactory::Platform::D3D11:
|
||||||
|
case boo::IGraphicsDataFactory::Platform::D3D12:
|
||||||
|
{
|
||||||
|
zeus::CMatrix4f mat2(2.f * st.x14_near / rml, 0.f, rpl / rml, 0.f,
|
||||||
|
0.f, 2.f * st.x14_near / tmb, tpb / tmb, 0.f,
|
||||||
|
0.f, 0.f, st.x18_far / fmn, st.x14_near * st.x18_far / fmn,
|
||||||
|
0.f, 0.f, -1.f, 0.f);
|
||||||
|
|
||||||
|
static const zeus::CMatrix4f PlusOneZ(1.f, 0.f, 0.f, 0.f,
|
||||||
|
0.f, 1.f, 0.f, 0.f,
|
||||||
|
0.f, 0.f, 1.f, 1.f,
|
||||||
|
0.f, 0.f, 0.f, 1.f);
|
||||||
|
return PlusOneZ * mat2;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
zeus::CMatrix4f CGraphics::GetPerspectiveProjectionMatrix()
|
zeus::CMatrix4f CGraphics::GetPerspectiveProjectionMatrix(bool forRenderer)
|
||||||
{
|
{
|
||||||
float rml = g_Proj.x8_right - g_Proj.x4_left;
|
float rml = g_Proj.x8_right - g_Proj.x4_left;
|
||||||
float rpl = g_Proj.x8_right + g_Proj.x4_left;
|
float rpl = g_Proj.x8_right + g_Proj.x4_left;
|
||||||
float tmb = g_Proj.xc_top - g_Proj.x10_bottom;
|
float tmb = g_Proj.xc_top - g_Proj.x10_bottom;
|
||||||
float tpb = g_Proj.xc_top + g_Proj.x10_bottom;
|
float tpb = g_Proj.xc_top + g_Proj.x10_bottom;
|
||||||
float nmf = g_Proj.x14_near - g_Proj.x18_far;
|
|
||||||
float fpn = g_Proj.x18_far + g_Proj.x14_near;
|
float fpn = g_Proj.x18_far + g_Proj.x14_near;
|
||||||
return zeus::CMatrix4f(2.f * g_Proj.x14_near / rml, 0.f, rpl / rml, 0.f,
|
float fmn = g_Proj.x18_far - g_Proj.x14_near;
|
||||||
0.f, 2.f * g_Proj.x14_near / tmb, tpb / tmb, 0.f,
|
|
||||||
0.f, 0.f, fpn / nmf, 2.f * g_Proj.x18_far * g_Proj.x14_near / nmf,
|
if (!forRenderer)
|
||||||
0.f, 0.f, -1.f, 0.f);
|
{
|
||||||
|
return zeus::CMatrix4f(2.f * g_Proj.x14_near / rml, 0.f, rpl / rml, 0.f,
|
||||||
|
0.f, 2.f * g_Proj.x14_near / tmb, tpb / tmb, 0.f,
|
||||||
|
0.f, 0.f, -fpn / fmn, -2.f * g_Proj.x18_far * g_Proj.x14_near / fmn,
|
||||||
|
0.f, 0.f, -1.f, 0.f);
|
||||||
|
}
|
||||||
|
|
||||||
|
switch (g_BooPlatform)
|
||||||
|
{
|
||||||
|
case boo::IGraphicsDataFactory::Platform::OGL:
|
||||||
|
default:
|
||||||
|
{
|
||||||
|
return zeus::CMatrix4f(2.f * g_Proj.x14_near / rml, 0.f, rpl / rml, 0.f,
|
||||||
|
0.f, 2.f * g_Proj.x14_near / tmb, tpb / tmb, 0.f,
|
||||||
|
0.f, 0.f, -fpn / fmn, -2.f * g_Proj.x18_far * g_Proj.x14_near / fmn,
|
||||||
|
0.f, 0.f, -1.f, 0.f);
|
||||||
|
}
|
||||||
|
case boo::IGraphicsDataFactory::Platform::D3D11:
|
||||||
|
case boo::IGraphicsDataFactory::Platform::D3D12:
|
||||||
|
{
|
||||||
|
zeus::CMatrix4f mat2(2.f * g_Proj.x14_near / rml, 0.f, rpl / rml, 0.f,
|
||||||
|
0.f, 2.f * g_Proj.x14_near / tmb, tpb / tmb, 0.f,
|
||||||
|
0.f, 0.f, g_Proj.x18_far / fmn, g_Proj.x14_near * g_Proj.x18_far / fmn,
|
||||||
|
0.f, 0.f, -1.f, 0.f);
|
||||||
|
|
||||||
|
static const zeus::CMatrix4f PlusOneZ(1.f, 0.f, 0.f, 0.f,
|
||||||
|
0.f, 1.f, 0.f, 0.f,
|
||||||
|
0.f, 0.f, 1.f, 1.f,
|
||||||
|
0.f, 0.f, 0.f, 1.f);
|
||||||
|
return PlusOneZ * mat2;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const CGraphics::CProjectionState& CGraphics::GetProjectionState()
|
const CGraphics::CProjectionState& CGraphics::GetProjectionState()
|
||||||
|
@ -225,7 +286,7 @@ void CGraphics::FlushProjection()
|
||||||
|
|
||||||
zeus::CVector2i CGraphics::ProjectPoint(const zeus::CVector3f& point)
|
zeus::CVector2i CGraphics::ProjectPoint(const zeus::CVector3f& point)
|
||||||
{
|
{
|
||||||
zeus::CVector3f projPt = GetPerspectiveProjectionMatrix().multiplyOneOverW(point);
|
zeus::CVector3f projPt = GetPerspectiveProjectionMatrix(false).multiplyOneOverW(point);
|
||||||
return {int(projPt.x * g_ViewportResolutionHalf.x) + g_ViewportResolutionHalf.x,
|
return {int(projPt.x * g_ViewportResolutionHalf.x) + g_ViewportResolutionHalf.x,
|
||||||
g_ViewportResolution.y - (int(projPt.y * g_ViewportResolutionHalf.y) + g_ViewportResolutionHalf.y)};
|
g_ViewportResolution.y - (int(projPt.y * g_ViewportResolutionHalf.y) + g_ViewportResolutionHalf.y)};
|
||||||
}
|
}
|
||||||
|
@ -293,7 +354,7 @@ SClipScreenRect CGraphics::ClipScreenRectFromVS(const zeus::CVector3f& p1,
|
||||||
zeus::CVector3f CGraphics::ProjectModelPointToViewportSpace(const zeus::CVector3f& point)
|
zeus::CVector3f CGraphics::ProjectModelPointToViewportSpace(const zeus::CVector3f& point)
|
||||||
{
|
{
|
||||||
zeus::CVector3f pt = g_GXModelView * point;
|
zeus::CVector3f pt = g_GXModelView * point;
|
||||||
return GetPerspectiveProjectionMatrix().multiplyOneOverW(pt);
|
return GetPerspectiveProjectionMatrix(false).multiplyOneOverW(pt);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CGraphics::SetViewportResolution(const zeus::CVector2i& res)
|
void CGraphics::SetViewportResolution(const zeus::CVector2i& res)
|
||||||
|
@ -312,6 +373,7 @@ float CGraphics::GetSecondsMod900()
|
||||||
return g_ExternalTimeProvider->x0_currentTime;
|
return g_ExternalTimeProvider->x0_currentTime;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
boo::IGraphicsDataFactory::Platform CGraphics::g_BooPlatform = boo::IGraphicsDataFactory::Platform::Null;
|
||||||
boo::IGraphicsDataFactory* CGraphics::g_BooFactory = nullptr;
|
boo::IGraphicsDataFactory* CGraphics::g_BooFactory = nullptr;
|
||||||
boo::IGraphicsCommandQueue* CGraphics::g_BooMainCommandQueue = nullptr;
|
boo::IGraphicsCommandQueue* CGraphics::g_BooMainCommandQueue = nullptr;
|
||||||
boo::ITextureR* CGraphics::g_SpareTexture = nullptr;
|
boo::ITextureR* CGraphics::g_SpareTexture = nullptr;
|
||||||
|
|
|
@ -199,11 +199,12 @@ public:
|
||||||
static void SetViewMatrix();
|
static void SetViewMatrix();
|
||||||
static void SetModelMatrix(const zeus::CTransform& xf);
|
static void SetModelMatrix(const zeus::CTransform& xf);
|
||||||
static zeus::CMatrix4f CalculatePerspectiveMatrix(float fovy, float aspect,
|
static zeus::CMatrix4f CalculatePerspectiveMatrix(float fovy, float aspect,
|
||||||
float near, float far);
|
float znear, float zfar,
|
||||||
static zeus::CMatrix4f GetPerspectiveProjectionMatrix();
|
bool forRenderer);
|
||||||
|
static zeus::CMatrix4f GetPerspectiveProjectionMatrix(bool forRenderer);
|
||||||
static const CProjectionState& GetProjectionState();
|
static const CProjectionState& GetProjectionState();
|
||||||
static void SetProjectionState(const CProjectionState&);
|
static void SetProjectionState(const CProjectionState&);
|
||||||
static void SetPerspective(float fovy, float aspect, float near, float far);
|
static void SetPerspective(float fovy, float aspect, float znear, float zfar);
|
||||||
static void SetOrtho(float left, float right,
|
static void SetOrtho(float left, float right,
|
||||||
float top, float bottom,
|
float top, float bottom,
|
||||||
float znear, float zfar);
|
float znear, float zfar);
|
||||||
|
@ -220,6 +221,7 @@ public:
|
||||||
{g_ExternalTimeProvider = provider;}
|
{g_ExternalTimeProvider = provider;}
|
||||||
static float GetSecondsMod900();
|
static float GetSecondsMod900();
|
||||||
|
|
||||||
|
static boo::IGraphicsDataFactory::Platform g_BooPlatform;
|
||||||
static boo::IGraphicsDataFactory* g_BooFactory;
|
static boo::IGraphicsDataFactory* g_BooFactory;
|
||||||
static boo::IGraphicsCommandQueue* g_BooMainCommandQueue;
|
static boo::IGraphicsCommandQueue* g_BooMainCommandQueue;
|
||||||
static boo::ITextureR* g_SpareTexture;
|
static boo::ITextureR* g_SpareTexture;
|
||||||
|
@ -230,6 +232,7 @@ public:
|
||||||
boo::ITextureR* spareTex,
|
boo::ITextureR* spareTex,
|
||||||
hecl::Runtime::ShaderCacheManager* shadCacheMgr)
|
hecl::Runtime::ShaderCacheManager* shadCacheMgr)
|
||||||
{
|
{
|
||||||
|
g_BooPlatform = factory->platform();
|
||||||
g_BooFactory = factory;
|
g_BooFactory = factory;
|
||||||
g_BooMainCommandQueue = cc;
|
g_BooMainCommandQueue = cc;
|
||||||
g_SpareTexture = spareTex;
|
g_SpareTexture = spareTex;
|
||||||
|
|
|
@ -23,6 +23,10 @@ struct CModelFlags
|
||||||
u16 m_flags = 0; /* Flags */
|
u16 m_flags = 0; /* Flags */
|
||||||
zeus::CColor color; /* Set into kcolor slot specified by material */
|
zeus::CColor color; /* Set into kcolor slot specified by material */
|
||||||
|
|
||||||
|
CModelFlags() = default;
|
||||||
|
CModelFlags(u8 blendMode, u8 shadIdx, u16 flags, const zeus::CColor& col)
|
||||||
|
: m_blendMode(blendMode), m_matSetIdx(shadIdx), m_flags(flags), color(col) {}
|
||||||
|
|
||||||
/* Flags
|
/* Flags
|
||||||
0x4: render without texture lock
|
0x4: render without texture lock
|
||||||
0x8: depth greater
|
0x8: depth greater
|
||||||
|
|
|
@ -44,8 +44,8 @@ void CBooModel::BuildGfxToken()
|
||||||
m_gfxToken = CGraphics::CommitResources(
|
m_gfxToken = CGraphics::CommitResources(
|
||||||
[&](boo::IGraphicsDataFactory::Context& ctx) -> bool
|
[&](boo::IGraphicsDataFactory::Context& ctx) -> bool
|
||||||
{
|
{
|
||||||
m_unskinnedXfBuffer = ctx.newDynamicBuffer(boo::BufferUse::Vertex,
|
m_unskinnedXfBuffer = ctx.newDynamicBuffer(boo::BufferUse::Uniform,
|
||||||
sizeof(SUnskinnedXf), 1);
|
sizeof(SUnskinnedXf), 1);
|
||||||
boo::IGraphicsBuffer* bufs[] = {m_unskinnedXfBuffer};
|
boo::IGraphicsBuffer* bufs[] = {m_unskinnedXfBuffer};
|
||||||
m_shaderDataBindings.clear();
|
m_shaderDataBindings.clear();
|
||||||
m_shaderDataBindings.reserve(x4_matSet->materials.size());
|
m_shaderDataBindings.reserve(x4_matSet->materials.size());
|
||||||
|
@ -276,7 +276,7 @@ void CBooModel::UpdateUniformData() const
|
||||||
SUnskinnedXf unskinnedXf;
|
SUnskinnedXf unskinnedXf;
|
||||||
unskinnedXf.mv = CGraphics::g_GXModelView.toMatrix4f();
|
unskinnedXf.mv = CGraphics::g_GXModelView.toMatrix4f();
|
||||||
unskinnedXf.mvinv = CGraphics::g_GXModelViewInvXpose.toMatrix4f();
|
unskinnedXf.mvinv = CGraphics::g_GXModelViewInvXpose.toMatrix4f();
|
||||||
unskinnedXf.proj = CGraphics::GetPerspectiveProjectionMatrix();
|
unskinnedXf.proj = CGraphics::GetPerspectiveProjectionMatrix(true);
|
||||||
m_unskinnedXfBuffer->load(&unskinnedXf, sizeof(unskinnedXf));
|
m_unskinnedXfBuffer->load(&unskinnedXf, sizeof(unskinnedXf));
|
||||||
|
|
||||||
if (m_uvAnimBuffer)
|
if (m_uvAnimBuffer)
|
||||||
|
@ -376,7 +376,8 @@ CModel::CModel(std::unique_ptr<u8[]>&& in, u32 dataLen, IObjectStore* store)
|
||||||
{
|
{
|
||||||
hecl::Runtime::ShaderTag tag(mat.heclIr,
|
hecl::Runtime::ShaderTag tag(mat.heclIr,
|
||||||
hmdlMeta.colorCount, hmdlMeta.uvCount, hmdlMeta.weightCount,
|
hmdlMeta.colorCount, hmdlMeta.uvCount, hmdlMeta.weightCount,
|
||||||
0, mat.uvAnims.size(), boo::Primitive(hmdlMeta.topology), true, true, true);
|
0, mat.uvAnims.size(), boo::Primitive(hmdlMeta.topology),
|
||||||
|
true, true, true);
|
||||||
matSet.m_shaders.push_back(CGraphics::g_ShaderCacheMgr->buildShader(tag, mat.heclIr, "CMDL", ctx));
|
matSet.m_shaders.push_back(CGraphics::g_ShaderCacheMgr->buildShader(tag, mat.heclIr, "CMDL", ctx));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -31,7 +31,8 @@ zeus::CVector3f CGuiCamera::ConvertToScreenSpace(const zeus::CVector3f& vec) con
|
||||||
return {-1.f, -1.f, 1.f};
|
return {-1.f, -1.f, 1.f};
|
||||||
|
|
||||||
zeus::CMatrix4f mat = CGraphics::CalculatePerspectiveMatrix(xfc_fov, x100_aspect,
|
zeus::CMatrix4f mat = CGraphics::CalculatePerspectiveMatrix(xfc_fov, x100_aspect,
|
||||||
x104_znear, x108_zfar);
|
x104_znear, x108_zfar,
|
||||||
|
false);
|
||||||
return mat.multiplyOneOverW(local);
|
return mat.multiplyOneOverW(local);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -65,51 +65,31 @@ void CGuiModel::Draw(const CGuiWidgetDrawParms& parms) const
|
||||||
{
|
{
|
||||||
case EGuiModelDrawFlags::Shadeless:
|
case EGuiModelDrawFlags::Shadeless:
|
||||||
{
|
{
|
||||||
CModelFlags flags;
|
CModelFlags flags(0, 0, 3, zeus::CColor::skWhite);
|
||||||
flags.m_blendMode = 0;
|
|
||||||
flags.m_matSetIdx = 0;
|
|
||||||
flags.m_flags = 3;
|
|
||||||
flags.color = zeus::CColor::skWhite;
|
|
||||||
model->Draw(flags);
|
model->Draw(flags);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case EGuiModelDrawFlags::Opaque:
|
case EGuiModelDrawFlags::Opaque:
|
||||||
{
|
{
|
||||||
CModelFlags flags;
|
CModelFlags flags(1, 0, 3, moduCol);
|
||||||
flags.m_blendMode = 1;
|
|
||||||
flags.m_matSetIdx = 0;
|
|
||||||
flags.m_flags = 3;
|
|
||||||
flags.color = moduCol;
|
|
||||||
model->Draw(flags);
|
model->Draw(flags);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case EGuiModelDrawFlags::Alpha:
|
case EGuiModelDrawFlags::Alpha:
|
||||||
{
|
{
|
||||||
CModelFlags flags;
|
CModelFlags flags(4, 0, (xf7_24_depthWrite << 1) | xf6_31_depthTest, moduCol);
|
||||||
flags.m_blendMode = 4;
|
|
||||||
flags.m_matSetIdx = 0;
|
|
||||||
flags.m_flags = (xf7_24_depthWrite << 1) | xf6_31_depthTest;
|
|
||||||
flags.color = moduCol;
|
|
||||||
model->Draw(flags);
|
model->Draw(flags);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case EGuiModelDrawFlags::Additive:
|
case EGuiModelDrawFlags::Additive:
|
||||||
{
|
{
|
||||||
CModelFlags flags;
|
CModelFlags flags(3, 0, (xf7_24_depthWrite << 1) | xf6_31_depthTest, moduCol);
|
||||||
flags.m_blendMode = 3;
|
|
||||||
flags.m_matSetIdx = 0;
|
|
||||||
flags.m_flags = (xf7_24_depthWrite << 1) | xf6_31_depthTest;
|
|
||||||
flags.color = moduCol;
|
|
||||||
model->Draw(flags);
|
model->Draw(flags);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case EGuiModelDrawFlags::AlphaAdditiveOverdraw:
|
case EGuiModelDrawFlags::AlphaAdditiveOverdraw:
|
||||||
{
|
{
|
||||||
CModelFlags flags;
|
CModelFlags flags(4, 0, xf6_31_depthTest, moduCol);
|
||||||
flags.m_blendMode = 4;
|
|
||||||
flags.m_matSetIdx = 0;
|
|
||||||
flags.m_flags = xf6_31_depthTest;
|
|
||||||
flags.color = moduCol;
|
|
||||||
model->Draw(flags);
|
model->Draw(flags);
|
||||||
|
|
||||||
flags.m_blendMode = 5;
|
flags.m_blendMode = 5;
|
||||||
|
|
|
@ -14,7 +14,7 @@ namespace urde
|
||||||
{
|
{
|
||||||
class CGuiObject;
|
class CGuiObject;
|
||||||
class CVParamTransfer;
|
class CVParamTransfer;
|
||||||
class SObjectTag;
|
struct SObjectTag;
|
||||||
class IFactory;
|
class IFactory;
|
||||||
class CSimplePool;
|
class CSimplePool;
|
||||||
class CGuiWidget;
|
class CGuiWidget;
|
||||||
|
|
|
@ -153,7 +153,7 @@ void CTextRenderBuffer::Render(const zeus::CColor& col, float time) const
|
||||||
{
|
{
|
||||||
((CTextRenderBuffer*)this)->CommitResources();
|
((CTextRenderBuffer*)this)->CommitResources();
|
||||||
|
|
||||||
BooUniform uniforms = {CGraphics::GetPerspectiveProjectionMatrix() *
|
BooUniform uniforms = {CGraphics::GetPerspectiveProjectionMatrix(true) *
|
||||||
CGraphics::g_GXModelView.toMatrix4f(), col};
|
CGraphics::g_GXModelView.toMatrix4f(), col};
|
||||||
m_uniBuf->load(&uniforms, sizeof(uniforms));
|
m_uniBuf->load(&uniforms, sizeof(uniforms));
|
||||||
|
|
||||||
|
|
|
@ -20,6 +20,7 @@
|
||||||
#include "Particle/CElementGen.hpp"
|
#include "Particle/CElementGen.hpp"
|
||||||
#include "Character/CAnimData.hpp"
|
#include "Character/CAnimData.hpp"
|
||||||
#include "Particle/CDecalManager.hpp"
|
#include "Particle/CDecalManager.hpp"
|
||||||
|
#include "Particle/CGenDescription.hpp"
|
||||||
#include "Graphics/CBooRenderer.hpp"
|
#include "Graphics/CBooRenderer.hpp"
|
||||||
#include "Audio/CAudioSys.hpp"
|
#include "Audio/CAudioSys.hpp"
|
||||||
#include "Input/CInputGenerator.hpp"
|
#include "Input/CInputGenerator.hpp"
|
||||||
|
|
|
@ -3,6 +3,7 @@
|
||||||
#include "CParticleGlobals.hpp"
|
#include "CParticleGlobals.hpp"
|
||||||
#include "CRandom16.hpp"
|
#include "CRandom16.hpp"
|
||||||
#include "zeus/Math.hpp"
|
#include "zeus/Math.hpp"
|
||||||
|
#include "CGenDescription.hpp"
|
||||||
|
|
||||||
/* Documentation at: http://www.metroid2002.com/retromodding/wiki/Particle_Script#Color_Elements */
|
/* Documentation at: http://www.metroid2002.com/retromodding/wiki/Particle_Script#Color_Elements */
|
||||||
|
|
||||||
|
|
|
@ -1598,7 +1598,7 @@ void CElementGen::RenderParticles()
|
||||||
|
|
||||||
SParticleUniforms uniformData =
|
SParticleUniforms uniformData =
|
||||||
{
|
{
|
||||||
CGraphics::GetPerspectiveProjectionMatrix() * CGraphics::g_GXModelView.toMatrix4f(),
|
CGraphics::GetPerspectiveProjectionMatrix(true) * CGraphics::g_GXModelView.toMatrix4f(),
|
||||||
{1.f, 1.f, 1.f, 1.f}
|
{1.f, 1.f, 1.f, 1.f}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -1933,7 +1933,7 @@ void CElementGen::RenderParticlesIndirectTexture()
|
||||||
|
|
||||||
SParticleUniforms uniformData =
|
SParticleUniforms uniformData =
|
||||||
{
|
{
|
||||||
CGraphics::GetPerspectiveProjectionMatrix() * CGraphics::g_GXModelView.toMatrix4f(),
|
CGraphics::GetPerspectiveProjectionMatrix(true) * CGraphics::g_GXModelView.toMatrix4f(),
|
||||||
{1.f, 1.f, 1.f, 1.f}
|
{1.f, 1.f, 1.f, 1.f}
|
||||||
};
|
};
|
||||||
m_uniformBuf->load(&uniformData, sizeof(SParticleUniforms));
|
m_uniformBuf->load(&uniformData, sizeof(SParticleUniforms));
|
||||||
|
|
|
@ -2,6 +2,8 @@
|
||||||
#include "CParticleGlobals.hpp"
|
#include "CParticleGlobals.hpp"
|
||||||
#include "CRandom16.hpp"
|
#include "CRandom16.hpp"
|
||||||
#include "CElementGen.hpp"
|
#include "CElementGen.hpp"
|
||||||
|
#include "CGenDescription.hpp"
|
||||||
|
|
||||||
/* Documentation at: http://www.metroid2002.com/retromodding/wiki/Particle_Script#Int_Elements */
|
/* Documentation at: http://www.metroid2002.com/retromodding/wiki/Particle_Script#Int_Elements */
|
||||||
|
|
||||||
namespace urde
|
namespace urde
|
||||||
|
|
|
@ -4,6 +4,7 @@
|
||||||
#include "CElementGen.hpp"
|
#include "CElementGen.hpp"
|
||||||
#include "Graphics/CTexture.hpp"
|
#include "Graphics/CTexture.hpp"
|
||||||
#include "zeus/Math.hpp"
|
#include "zeus/Math.hpp"
|
||||||
|
#include "CGenDescription.hpp"
|
||||||
|
|
||||||
/* Documentation at: http://www.metroid2002.com/retromodding/wiki/Particle_Script#Real_Elements */
|
/* Documentation at: http://www.metroid2002.com/retromodding/wiki/Particle_Script#Real_Elements */
|
||||||
|
|
||||||
|
|
|
@ -3,6 +3,7 @@
|
||||||
#include "CRandom16.hpp"
|
#include "CRandom16.hpp"
|
||||||
#include "CElementGen.hpp"
|
#include "CElementGen.hpp"
|
||||||
#include "zeus/Math.hpp"
|
#include "zeus/Math.hpp"
|
||||||
|
#include "CGenDescription.hpp"
|
||||||
|
|
||||||
/* Documentation at: http://www.metroid2002.com/retromodding/wiki/Particle_Script#Vector_Elements */
|
/* Documentation at: http://www.metroid2002.com/retromodding/wiki/Particle_Script#Vector_Elements */
|
||||||
|
|
||||||
|
|
2
hecl
2
hecl
|
@ -1 +1 @@
|
||||||
Subproject commit fd9dd2662baa04ae31b8caa525327abe5087ebae
|
Subproject commit 15a3b271e8c642f6983d897c397ea31e689d9071
|
Loading…
Reference in New Issue