mirror of https://github.com/AxioDL/metaforce.git
CModelShaders: Check noZWrite for thermal depth test
Adds back LightingAlphaWrite extended shader
This commit is contained in:
parent
6ff305da06
commit
9e5f28ba80
|
@ -578,7 +578,7 @@ static EExtendedShader ResolveExtendedShader(const MaterialSet::Material& data,
|
||||||
if (intermediateExtended == EExtendedShader::Lighting) {
|
if (intermediateExtended == EExtendedShader::Lighting) {
|
||||||
/* Transform lighting into thermal cold if the thermal visor is active */
|
/* Transform lighting into thermal cold if the thermal visor is active */
|
||||||
if (g_Renderer->IsThermalVisorHotPass())
|
if (g_Renderer->IsThermalVisorHotPass())
|
||||||
return EExtendedShader::LightingAlphaWriteNoZTest;
|
return noZWrite ? EExtendedShader::LightingAlphaWriteNoZTestNoZWrite : EExtendedShader::LightingAlphaWrite;
|
||||||
else if (g_Renderer->IsThermalVisorActive())
|
else if (g_Renderer->IsThermalVisorActive())
|
||||||
return EExtendedShader::ThermalCold;
|
return EExtendedShader::ThermalCold;
|
||||||
if (data.blendMode == MaterialSet::Material::BlendMaterial::BlendMode::Opaque) {
|
if (data.blendMode == MaterialSet::Material::BlendMaterial::BlendMode::Opaque) {
|
||||||
|
|
|
@ -80,7 +80,7 @@ constexpr std::array<hecl::Backend::TextureInfo, 2> DisintegrateTextures{{
|
||||||
{TexCoordSource::Position, 1, false}, // Ashy tex
|
{TexCoordSource::Position, 1, false}, // Ashy tex
|
||||||
}};
|
}};
|
||||||
|
|
||||||
static std::array<hecl::Backend::ExtensionSlot, 26> g_ExtensionSlots{{
|
static std::array<hecl::Backend::ExtensionSlot, size_t(EExtendedShader::MAX)> g_ExtensionSlots{{
|
||||||
/* Default solid shading */
|
/* Default solid shading */
|
||||||
{},
|
{},
|
||||||
/* Normal lit shading */
|
/* Normal lit shading */
|
||||||
|
@ -149,9 +149,12 @@ static std::array<hecl::Backend::ExtensionSlot, 26> g_ExtensionSlots{{
|
||||||
/* Thermal cold shading */
|
/* Thermal cold shading */
|
||||||
{0, nullptr, hecl::Backend::BlendFactor::Original, hecl::Backend::BlendFactor::Original,
|
{0, nullptr, hecl::Backend::BlendFactor::Original, hecl::Backend::BlendFactor::Original,
|
||||||
hecl::Backend::ZTest::Original, hecl::Backend::CullMode::Original, false, false, true, false, false, false, true},
|
hecl::Backend::ZTest::Original, hecl::Backend::CullMode::Original, false, false, true, false, false, false, true},
|
||||||
/* Normal lit shading with alpha without depth test */
|
/* Normal lit shading with alpha */
|
||||||
{0, nullptr, hecl::Backend::BlendFactor::Original, hecl::Backend::BlendFactor::Original,
|
{0, nullptr, hecl::Backend::BlendFactor::Original, hecl::Backend::BlendFactor::Original,
|
||||||
hecl::Backend::ZTest::None, hecl::Backend::CullMode::Backface},
|
hecl::Backend::ZTest::Original, hecl::Backend::CullMode::Backface},
|
||||||
|
/* Normal lit shading with alpha without Z-write or depth test */
|
||||||
|
{0, nullptr, hecl::Backend::BlendFactor::Original, hecl::Backend::BlendFactor::Original,
|
||||||
|
hecl::Backend::ZTest::None, hecl::Backend::CullMode::Backface, true},
|
||||||
/* Normal lit shading with cube reflection */
|
/* Normal lit shading with cube reflection */
|
||||||
{0, nullptr, hecl::Backend::BlendFactor::Original, hecl::Backend::BlendFactor::Original,
|
{0, nullptr, hecl::Backend::BlendFactor::Original, hecl::Backend::BlendFactor::Original,
|
||||||
hecl::Backend::ZTest::Original, hecl::Backend::CullMode::Backface, false, false, true},
|
hecl::Backend::ZTest::Original, hecl::Backend::CullMode::Backface, false, false, true},
|
||||||
|
@ -160,7 +163,7 @@ static std::array<hecl::Backend::ExtensionSlot, 26> g_ExtensionSlots{{
|
||||||
hecl::Backend::ZTest::Original, hecl::Backend::CullMode::Backface, false, false, true},
|
hecl::Backend::ZTest::Original, hecl::Backend::CullMode::Backface, false, false, true},
|
||||||
}};
|
}};
|
||||||
|
|
||||||
constexpr std::array<const char*, 26> ShaderMacros{
|
constexpr std::array<const char*, size_t(EExtendedShader::MAX)> ShaderMacros{
|
||||||
"URDE_LIGHTING",
|
"URDE_LIGHTING",
|
||||||
"URDE_LIGHTING",
|
"URDE_LIGHTING",
|
||||||
"URDE_THERMAL_HOT",
|
"URDE_THERMAL_HOT",
|
||||||
|
@ -185,6 +188,7 @@ constexpr std::array<const char*, 26> ShaderMacros{
|
||||||
"URDE_LIGHTING",
|
"URDE_LIGHTING",
|
||||||
"URDE_THERMAL_COLD",
|
"URDE_THERMAL_COLD",
|
||||||
"URDE_LIGHTING",
|
"URDE_LIGHTING",
|
||||||
|
"URDE_LIGHTING",
|
||||||
"URDE_LIGHTING_CUBE_REFLECTION",
|
"URDE_LIGHTING_CUBE_REFLECTION",
|
||||||
"URDE_LIGHTING_CUBE_REFLECTION_SHADOW",
|
"URDE_LIGHTING_CUBE_REFLECTION_SHADOW",
|
||||||
};
|
};
|
||||||
|
|
|
@ -45,7 +45,8 @@ enum class EExtendedShader : uint8_t {
|
||||||
Disintegrate,
|
Disintegrate,
|
||||||
ForcedAdditiveNoZWriteDepthGreater,
|
ForcedAdditiveNoZWriteDepthGreater,
|
||||||
ThermalCold,
|
ThermalCold,
|
||||||
LightingAlphaWriteNoZTest,
|
LightingAlphaWrite,
|
||||||
|
LightingAlphaWriteNoZTestNoZWrite,
|
||||||
LightingCubeReflection,
|
LightingCubeReflection,
|
||||||
LightingCubeReflectionWorldShadow,
|
LightingCubeReflectionWorldShadow,
|
||||||
MAX
|
MAX
|
||||||
|
|
Loading…
Reference in New Issue