mirror of https://github.com/AxioDL/metaforce.git
More thermal visor fixes; face reflection fix
This commit is contained in:
parent
67b9882dbe
commit
4cb26976bd
|
@ -1093,17 +1093,19 @@ void CBooRenderer::SetThermalColdScale(float scale) { x2f8_thermColdScale = zeus
|
||||||
void CBooRenderer::DoThermalBlendCold() {
|
void CBooRenderer::DoThermalBlendCold() {
|
||||||
zeus::CColor a = zeus::CColor::lerp(x2f4_thermColor, zeus::skWhite, x2f8_thermColdScale);
|
zeus::CColor a = zeus::CColor::lerp(x2f4_thermColor, zeus::skWhite, x2f8_thermColdScale);
|
||||||
m_thermColdFilter->setColorA(a);
|
m_thermColdFilter->setColorA(a);
|
||||||
float bFac = 0.f;
|
|
||||||
float bAlpha = 1.f;
|
float bAlpha = 1.f;
|
||||||
if (x2f8_thermColdScale < 0.5f) {
|
if (x2f8_thermColdScale < 0.5f)
|
||||||
bAlpha = x2f8_thermColdScale * 2.f;
|
bAlpha = x2f8_thermColdScale * 2.f;
|
||||||
bFac = (1.f - bAlpha) / 8.f;
|
float bFac = (1.f - bAlpha) / 8.f;
|
||||||
}
|
m_thermColdFilter->setColorB(zeus::CColor(bFac, bAlpha));
|
||||||
zeus::CColor b{bFac, bFac, bFac, bAlpha};
|
float cFac;
|
||||||
m_thermColdFilter->setColorB(b);
|
if (x2f8_thermColdScale < 0.25f)
|
||||||
zeus::CColor c = zeus::CColor::lerp(zeus::skBlack, zeus::skWhite,
|
cFac = 0.f;
|
||||||
zeus::clamp(0.f, (x2f8_thermColdScale - 0.25f) * 4.f / 3.f, 1.f));
|
else if (x2f8_thermColdScale >= 1.f)
|
||||||
m_thermColdFilter->setColorC(c);
|
cFac = 1.f;
|
||||||
|
else
|
||||||
|
cFac = (x2f8_thermColdScale - 0.25f) * 4.f / 3.f;
|
||||||
|
m_thermColdFilter->setColorC(zeus::CColor(cFac, cFac));
|
||||||
|
|
||||||
m_thermColdFilter->setScale(x2f8_thermColdScale);
|
m_thermColdFilter->setScale(x2f8_thermColdScale);
|
||||||
|
|
||||||
|
|
|
@ -681,7 +681,7 @@ void CBooModel::UVAnimationBuffer::ProcessAnimation(u8*& bufOut, const UVAnimati
|
||||||
}
|
}
|
||||||
case UVAnimation::Mode::Model: {
|
case UVAnimation::Mode::Model: {
|
||||||
texMtxOut = CGraphics::g_GXModelMatrix.toMatrix4f();
|
texMtxOut = CGraphics::g_GXModelMatrix.toMatrix4f();
|
||||||
texMtxOut[3].zeroOut();
|
texMtxOut[3] = zeus::CVector4f(0.f, 0.f, 0.f, 1.f);
|
||||||
postMtxOut[0].x() = 0.5f;
|
postMtxOut[0].x() = 0.5f;
|
||||||
postMtxOut[1].y() = 0.f;
|
postMtxOut[1].y() = 0.f;
|
||||||
postMtxOut[2].y() = 0.5f;
|
postMtxOut[2].y() = 0.5f;
|
||||||
|
|
|
@ -172,8 +172,8 @@ layout(location=0) out vec4 colorOut;
|
||||||
TBINDING0 uniform sampler2D tex;
|
TBINDING0 uniform sampler2D tex;
|
||||||
void main()
|
void main()
|
||||||
{
|
{
|
||||||
colorOut = vtf.color;
|
colorOut = vtf.color * texture(tex, vtf.uv);
|
||||||
colorOut.a = texture(tex, vtf.uv).r;
|
colorOut.a = colorOut.r;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -189,7 +189,9 @@ struct VertToFrag
|
||||||
|
|
||||||
float4 main(in VertToFrag vtf) : SV_Target0
|
float4 main(in VertToFrag vtf) : SV_Target0
|
||||||
{
|
{
|
||||||
return float4(vtf.color.rgb, tex0.Sample(samp, vtf.uv).r);
|
float4 colorOut = vtf.color * tex0.Sample(samp, vtf.uv);
|
||||||
|
colorOut.a = colorOut.r;
|
||||||
|
return colorOut;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -205,7 +207,9 @@ fragment float4 fmain(VertToFrag vtf [[ stage_in ]],
|
||||||
sampler samp [[ sampler(0) ]],
|
sampler samp [[ sampler(0) ]],
|
||||||
texture2d<float> tex0 [[ texture(0) ]])
|
texture2d<float> tex0 [[ texture(0) ]])
|
||||||
{
|
{
|
||||||
return float4(vtf.color.rgb, tex0.sample(samp, vtf.uv).r);
|
float4 colorOut = vtf.color * tex0.sample(samp, vtf.uv);
|
||||||
|
colorOut.a = colorOut.r;
|
||||||
|
return colorOut;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -80,8 +80,8 @@ void main()
|
||||||
vec4 noiseTexel = texelFetch(noiseTex, Lookup8BPP(vtf.noiseUv, vtf.randOff), 0);
|
vec4 noiseTexel = texelFetch(noiseTex, Lookup8BPP(vtf.noiseUv, vtf.randOff), 0);
|
||||||
vec2 indCoord = (vtf.indMtx * vec3(noiseTexel.r - 0.5, noiseTexel.a - 0.5, 1.0)).xy;
|
vec2 indCoord = (vtf.indMtx * vec3(noiseTexel.r - 0.5, noiseTexel.a - 0.5, 1.0)).xy;
|
||||||
float indScene = dot(texture(sceneTex, vtf.sceneUv + indCoord), kRGBToYPrime);
|
float indScene = dot(texture(sceneTex, vtf.sceneUv + indCoord), kRGBToYPrime);
|
||||||
colorOut = vtf.colorReg0 * indScene + vtf.colorReg1 * noiseTexel + vtf.colorReg2;
|
colorOut = vtf.colorReg0 * indScene + vtf.colorReg2 - vtf.colorReg1 * noiseTexel.r;
|
||||||
colorOut.a = vtf.colorReg1.a + vtf.colorReg1.a * noiseTexel.a + vtf.colorReg2.a;
|
colorOut.a = vtf.colorReg1.a + vtf.colorReg1.a * noiseTexel.r + vtf.colorReg2.a;
|
||||||
}
|
}
|
||||||
|
|
||||||
#vertex hlsl
|
#vertex hlsl
|
||||||
|
@ -160,8 +160,8 @@ float4 main(in VertToFrag vtf) : SV_Target0
|
||||||
float4 noiseTexel = noiseTex.Load(Lookup8BPP(vtf.noiseUv, vtf.randOff));
|
float4 noiseTexel = noiseTex.Load(Lookup8BPP(vtf.noiseUv, vtf.randOff));
|
||||||
float2 indCoord = mul(vtf.indMtx, float3(noiseTexel.r - 0.5, noiseTexel.a - 0.5, 1.0)).xy;
|
float2 indCoord = mul(vtf.indMtx, float3(noiseTexel.r - 0.5, noiseTexel.a - 0.5, 1.0)).xy;
|
||||||
float indScene = dot(sceneTex.Sample(samp, vtf.sceneUv + indCoord), kRGBToYPrime);
|
float indScene = dot(sceneTex.Sample(samp, vtf.sceneUv + indCoord), kRGBToYPrime);
|
||||||
float4 colorOut = vtf.colorReg0 * indScene + vtf.colorReg1 * noiseTexel + vtf.colorReg2;
|
float4 colorOut = vtf.colorReg0 * indScene + vtf.colorReg2 - vtf.colorReg1 * noiseTexel.r;
|
||||||
colorOut.a = vtf.colorReg1.a + vtf.colorReg1.a * noiseTexel.a + vtf.colorReg2.a;
|
colorOut.a = vtf.colorReg1.a + vtf.colorReg1.a * noiseTexel.r + vtf.colorReg2.a;
|
||||||
return colorOut;
|
return colorOut;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -247,7 +247,6 @@ fragment float4 fmain(VertToFrag vtf [[ stage_in ]],
|
||||||
float4 noiseTexel = noiseTex.read(Lookup8BPP(vtf.noiseUv, vtf.randOff));
|
float4 noiseTexel = noiseTex.read(Lookup8BPP(vtf.noiseUv, vtf.randOff));
|
||||||
float2 indCoord = (vtf.indMtx * float3(noiseTexel.r - 0.5, noiseTexel.a - 0.5, 1.0)).xy;
|
float2 indCoord = (vtf.indMtx * float3(noiseTexel.r - 0.5, noiseTexel.a - 0.5, 1.0)).xy;
|
||||||
float indScene = dot(sceneTex.sample(samp, vtf.sceneUv + indCoord), kRGBToYPrime);
|
float indScene = dot(sceneTex.sample(samp, vtf.sceneUv + indCoord), kRGBToYPrime);
|
||||||
float4 colorOut = vtf.colorReg0 * indScene + vtf.colorReg1 * noiseTexel + vtf.colorReg2;
|
float4 colorOut = vtf.colorReg0 * indScene + vtf.colorReg2 - vtf.colorReg1 * noiseTexel.r;
|
||||||
colorOut.a = vtf.colorReg1.a + vtf.colorReg1.a * noiseTexel.a + vtf.colorReg2.a;
|
colorOut.a = vtf.colorReg1.a + vtf.colorReg1.a * noiseTexel.r + vtf.colorReg2.a;
|
||||||
return colorOut;
|
|
||||||
}
|
}
|
||||||
|
|
2
hecl
2
hecl
|
@ -1 +1 @@
|
||||||
Subproject commit 947155734274041bc7b3ab1bb8267d0491e48554
|
Subproject commit b92572e4d1331813f5bfc2b70a6a69bb473db67f
|
Loading…
Reference in New Issue