mirror of https://github.com/AxioDL/metaforce.git
Fixes for extended shaders
This commit is contained in:
parent
95033d3988
commit
05a52c00be
|
@ -75,6 +75,10 @@ void ViewManager::ParticleView::draw(boo::IGraphicsCommandQueue *gfxQ)
|
||||||
if (m_vm.m_modelTest.IsLoaded())
|
if (m_vm.m_modelTest.IsLoaded())
|
||||||
{
|
{
|
||||||
CModelFlags flags;
|
CModelFlags flags;
|
||||||
|
flags.addColor.r = 0.0f;
|
||||||
|
|
||||||
|
flags.m_extendedShaderIdx = 2;
|
||||||
|
if (std::fmod(m_theta, M_PIF) < M_PIF / 2.f)
|
||||||
flags.m_extendedShaderIdx = 1;
|
flags.m_extendedShaderIdx = 1;
|
||||||
|
|
||||||
m_theta += 0.01f;
|
m_theta += 0.01f;
|
||||||
|
|
|
@ -584,6 +584,11 @@ void CBooRenderer::DrawSpaceWarp(const zeus::CVector3f& pt, float strength)
|
||||||
|
|
||||||
void CBooRenderer::DrawThermalModel(const CModel& model, const zeus::CColor& mulCol, const zeus::CColor& addCol)
|
void CBooRenderer::DrawThermalModel(const CModel& model, const zeus::CColor& mulCol, const zeus::CColor& addCol)
|
||||||
{
|
{
|
||||||
|
CModelFlags flags;
|
||||||
|
flags.m_extendedShaderIdx = 2;
|
||||||
|
flags.color = mulCol;
|
||||||
|
flags.addColor = addCol;
|
||||||
|
model.Draw(flags);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CBooRenderer::DrawXRayOutline(const CModel&, const float*, const float*)
|
void CBooRenderer::DrawXRayOutline(const CModel&, const float*, const float*)
|
||||||
|
|
|
@ -25,7 +25,7 @@ struct CModelFlags
|
||||||
u8 m_extendedShaderIdx = 0; /* 0 for shadeless, 1 for lighting, others defined in CModelShaders */
|
u8 m_extendedShaderIdx = 0; /* 0 for shadeless, 1 for lighting, others defined in CModelShaders */
|
||||||
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 */
|
||||||
zeus::CColor addColor;
|
zeus::CColor addColor = zeus::CColor::skClear;
|
||||||
|
|
||||||
CModelFlags() = default;
|
CModelFlags() = default;
|
||||||
CModelFlags(u8 blendMode, u8 shadIdx, u16 flags, const zeus::CColor& col)
|
CModelFlags(u8 blendMode, u8 shadIdx, u16 flags, const zeus::CColor& col)
|
||||||
|
|
|
@ -450,7 +450,7 @@ void CBooModel::UVAnimationBuffer::Update(u8*& bufOut, const MaterialSet* matSet
|
||||||
u8* bufOrig = bufOut;
|
u8* bufOrig = bufOut;
|
||||||
for (const UVAnimation& anim : mat.uvAnims)
|
for (const UVAnimation& anim : mat.uvAnims)
|
||||||
ProcessAnimation(bufOut, anim);
|
ProcessAnimation(bufOut, anim);
|
||||||
bufOut = bufOrig + sizeof(zeus::CMatrix4f) * 2;
|
bufOut = bufOrig + sizeof(zeus::CMatrix4f) * 2 * 8;
|
||||||
PadOutBuffer(start, bufOut);
|
PadOutBuffer(start, bufOut);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -50,10 +50,9 @@ static const char* ThermalPostGLSL =
|
||||||
" vec4 mulColor;\n"
|
" vec4 mulColor;\n"
|
||||||
" vec4 addColor;\n"
|
" vec4 addColor;\n"
|
||||||
"};\n"
|
"};\n"
|
||||||
"TBINDING7 uniform sampler2D thermalLookup;\n"
|
|
||||||
"vec4 ThermalPostFunc(vec4 colorIn)\n"
|
"vec4 ThermalPostFunc(vec4 colorIn)\n"
|
||||||
"{\n"
|
"{\n"
|
||||||
" return texture(thermalLookup, vtf.extTcgs[0]).rrrr * mulColor + addColor;\n"
|
" return texture(tex7, vtf.extTcgs[0]).rrrr * mulColor + addColor;\n"
|
||||||
"}\n"
|
"}\n"
|
||||||
"\n";
|
"\n";
|
||||||
|
|
||||||
|
@ -67,7 +66,7 @@ static const char* ThermalBlockNames[] = {HECL_GLSL_VERT_UNIFORM_BLOCK_NAME,
|
||||||
|
|
||||||
static const hecl::Backend::TextureInfo ThermalTextures[] =
|
static const hecl::Backend::TextureInfo ThermalTextures[] =
|
||||||
{
|
{
|
||||||
{hecl::Backend::TexGenSrc::Normal, 0, 7, true}
|
{hecl::Backend::TexGenSrc::Normal, 7, 0, 7, true}
|
||||||
};
|
};
|
||||||
|
|
||||||
hecl::Runtime::ShaderCacheExtensions
|
hecl::Runtime::ShaderCacheExtensions
|
||||||
|
@ -76,10 +75,12 @@ CModelShaders::GetShaderExtensionsGLSL(boo::IGraphicsDataFactory::Platform plat)
|
||||||
hecl::Runtime::ShaderCacheExtensions ext(plat);
|
hecl::Runtime::ShaderCacheExtensions ext(plat);
|
||||||
|
|
||||||
/* Normal lit shading */
|
/* Normal lit shading */
|
||||||
ext.registerExtensionSlot({LightingGLSL, "LightingFunc"}, {}, 3, BlockNames, 0, nullptr);
|
ext.registerExtensionSlot({LightingGLSL, "LightingFunc"}, {}, 3, BlockNames, 0, nullptr,
|
||||||
|
hecl::Backend::BlendFactor::Original, hecl::Backend::BlendFactor::Original);
|
||||||
|
|
||||||
/* Thermal Visor shading */
|
/* Thermal Visor shading */
|
||||||
ext.registerExtensionSlot({}, {ThermalPostGLSL, "ThermalPostFunc"}, 3, ThermalBlockNames, 1, ThermalTextures);
|
ext.registerExtensionSlot({}, {ThermalPostGLSL, "ThermalPostFunc"}, 3, ThermalBlockNames, 1, ThermalTextures,
|
||||||
|
hecl::Backend::BlendFactor::One, hecl::Backend::BlendFactor::One);
|
||||||
|
|
||||||
return ext;
|
return ext;
|
||||||
}
|
}
|
||||||
|
|
2
hecl
2
hecl
|
@ -1 +1 @@
|
||||||
Subproject commit 956e4874dd95c06bf7d9ebd675774143c59db4b7
|
Subproject commit 3f47a0524451e46c73915e81de85e0a926a29e12
|
Loading…
Reference in New Issue