2
0
mirror of https://github.com/AxioDL/metaforce.git synced 2025-12-09 15:47:46 +00:00

Implement actual CParticleSwoosh rendering

This commit is contained in:
Jack Andersen
2017-06-09 19:34:39 -10:00
parent 302bd76ebd
commit f3acc97d63
18 changed files with 851 additions and 312 deletions

View File

@@ -0,0 +1,78 @@
#include "CParticleSwooshShaders.hpp"
#include "Particle/CParticleSwoosh.hpp"
#include "Particle/CSwooshDescription.hpp"
namespace urde
{
boo::IShaderPipeline* CParticleSwooshShaders::m_texZWrite = nullptr;
boo::IShaderPipeline* CParticleSwooshShaders::m_texNoZWrite = nullptr;
boo::IShaderPipeline* CParticleSwooshShaders::m_texAdditiveZWrite = nullptr;
boo::IShaderPipeline* CParticleSwooshShaders::m_texAdditiveNoZWrite = nullptr;
boo::IShaderPipeline* CParticleSwooshShaders::m_noTexZWrite = nullptr;
boo::IShaderPipeline* CParticleSwooshShaders::m_noTexNoZWrite = nullptr;
boo::IShaderPipeline* CParticleSwooshShaders::m_noTexAdditiveZWrite = nullptr;
boo::IShaderPipeline* CParticleSwooshShaders::m_noTexAdditiveNoZWrite = nullptr;
boo::IVertexFormat* CParticleSwooshShaders::m_vtxFormat = nullptr;
CParticleSwooshShaders::EShaderClass CParticleSwooshShaders::GetShaderClass(CParticleSwoosh& gen)
{
CSwooshDescription* desc = gen.GetDesc();
if (desc->x3c_TEXR)
return EShaderClass::Tex;
else
return EShaderClass::NoTex;
}
void CParticleSwooshShaders::BuildShaderDataBinding(boo::IGraphicsDataFactory::Context& ctx, CParticleSwoosh& gen)
{
CSwooshDescription* desc = gen.GetDesc();
boo::IShaderPipeline* pipeline = nullptr;
if (desc->x3c_TEXR)
{
if (desc->x44_31_AALP)
{
if (desc->x45_24_ZBUF)
pipeline = m_texAdditiveZWrite;
else
pipeline = m_texAdditiveNoZWrite;
}
else
{
if (desc->x45_24_ZBUF)
pipeline = m_texZWrite;
else
pipeline = m_texNoZWrite;
}
}
else
{
if (desc->x44_31_AALP)
{
if (desc->x45_24_ZBUF)
pipeline = m_noTexAdditiveZWrite;
else
pipeline = m_noTexAdditiveNoZWrite;
}
else
{
if (desc->x45_24_ZBUF)
pipeline = m_noTexZWrite;
else
pipeline = m_noTexNoZWrite;
}
}
CParticleSwooshShaders shad(gen, pipeline);
TShader<CParticleSwooshShaders>::BuildShaderDataBinding(ctx, shad);
}
void CParticleSwooshShaders::Shutdown() {}
URDE_SPECIALIZE_SHADER(CParticleSwooshShaders)
}