#include "CElementGenShaders.hpp" #include "Particle/CElementGen.hpp" namespace urde { boo::ObjToken CElementGenShaders::m_texZTestZWrite; boo::ObjToken CElementGenShaders::m_texNoZTestZWrite; boo::ObjToken CElementGenShaders::m_texZTestNoZWrite; boo::ObjToken CElementGenShaders::m_texNoZTestNoZWrite; boo::ObjToken CElementGenShaders::m_texAdditiveZTest; boo::ObjToken CElementGenShaders::m_texAdditiveNoZTest; boo::ObjToken CElementGenShaders::m_texRedToAlphaZTest; boo::ObjToken CElementGenShaders::m_texRedToAlphaNoZTest; boo::ObjToken CElementGenShaders::m_texZTestNoZWriteSub; boo::ObjToken CElementGenShaders::m_texNoZTestNoZWriteSub; boo::ObjToken CElementGenShaders::m_texRedToAlphaZTestSub; boo::ObjToken CElementGenShaders::m_texRedToAlphaNoZTestSub; boo::ObjToken CElementGenShaders::m_indTexZWrite; boo::ObjToken CElementGenShaders::m_indTexNoZWrite; boo::ObjToken CElementGenShaders::m_indTexAdditive; boo::ObjToken CElementGenShaders::m_cindTexZWrite; boo::ObjToken CElementGenShaders::m_cindTexNoZWrite; boo::ObjToken CElementGenShaders::m_cindTexAdditive; boo::ObjToken CElementGenShaders::m_noTexZTestZWrite; boo::ObjToken CElementGenShaders::m_noTexNoZTestZWrite; boo::ObjToken CElementGenShaders::m_noTexZTestNoZWrite; boo::ObjToken CElementGenShaders::m_noTexNoZTestNoZWrite; boo::ObjToken CElementGenShaders::m_noTexAdditiveZTest; boo::ObjToken CElementGenShaders::m_noTexAdditiveNoZTest; boo::ObjToken CElementGenShaders::m_vtxFormatTex; boo::ObjToken CElementGenShaders::m_vtxFormatIndTex; boo::ObjToken CElementGenShaders::m_vtxFormatNoTex; CElementGenShaders::EShaderClass CElementGenShaders::GetShaderClass(CElementGen& gen) { CGenDescription* desc = gen.x1c_genDesc.GetObj(); if (desc->x54_x40_TEXR) { if (desc->x58_x44_TIND) return EShaderClass::IndTex; else return EShaderClass::Tex; } else return EShaderClass::NoTex; } void CElementGenShaders::BuildShaderDataBinding(boo::IGraphicsDataFactory::Context& ctx, CElementGen& gen) { CGenDescription* desc = gen.x1c_genDesc.GetObj(); boo::ObjToken regPipeline; boo::ObjToken regPipelineSub; boo::ObjToken redToAlphaPipeline; boo::ObjToken redToAlphaPipelineSub; boo::ObjToken regPipelinePmus; boo::ObjToken redToAlphaPipelinePmus; if (desc->x54_x40_TEXR) { if (desc->x58_x44_TIND) { if (desc->x45_30_x32_24_CIND) { if (gen.x26c_26_AAPH) regPipeline = m_cindTexAdditive; else { if (gen.x26c_27_ZBUF) regPipeline = m_cindTexZWrite; else regPipeline = m_cindTexNoZWrite; } } else { if (gen.x26c_26_AAPH) regPipeline = m_indTexAdditive; else { if (gen.x26c_27_ZBUF) regPipeline = m_indTexZWrite; else regPipeline = m_indTexNoZWrite; } } } else { if (gen.x26c_28_zTest) { redToAlphaPipeline = m_texRedToAlphaZTest; regPipelineSub = m_texZTestNoZWriteSub; redToAlphaPipelineSub = m_texRedToAlphaZTestSub; } else { redToAlphaPipeline = m_texRedToAlphaNoZTest; regPipelineSub = m_texNoZTestNoZWriteSub; redToAlphaPipelineSub = m_texRedToAlphaNoZTestSub; } if (gen.x26c_26_AAPH) { if (gen.x26c_28_zTest) regPipeline = m_texAdditiveZTest; else regPipeline = m_texAdditiveNoZTest; } else { if (gen.x26c_28_zTest) { if (gen.x26c_27_ZBUF) regPipeline = m_texZTestZWrite; else regPipeline = m_texZTestNoZWrite; } else { if (gen.x26c_27_ZBUF) regPipeline = m_texNoZTestZWrite; else regPipeline = m_texNoZTestNoZWrite; } } } } else { if (gen.x26c_26_AAPH) { if (gen.x26c_28_zTest) regPipeline = m_noTexAdditiveZTest; else regPipeline = m_noTexAdditiveNoZTest; } else { if (gen.x26c_28_zTest) { if (gen.x26c_27_ZBUF) regPipeline = m_noTexZTestZWrite; else regPipeline = m_noTexZTestNoZWrite; } else { if (gen.x26c_27_ZBUF) regPipeline = m_noTexNoZTestZWrite; else regPipeline = m_noTexNoZTestNoZWrite; } } } if (desc->x45_24_x31_26_PMUS) { if (desc->x54_x40_TEXR) { redToAlphaPipelinePmus = m_texRedToAlphaZTest; if (desc->x44_31_x31_25_PMAB) regPipelinePmus = m_texAdditiveZTest; else regPipelinePmus = m_texZTestZWrite; } else { if (desc->x44_31_x31_25_PMAB) regPipelinePmus = m_noTexAdditiveZTest; else regPipelinePmus = m_noTexZTestZWrite; } } CElementGenShaders shad(gen, regPipeline, regPipelineSub, redToAlphaPipeline, redToAlphaPipelineSub, regPipelinePmus, redToAlphaPipelinePmus); TShader::BuildShaderDataBinding(ctx, shad); } URDE_SPECIALIZE_SHADER(CElementGenShaders) }