2
0
mirror of https://github.com/AxioDL/metaforce.git synced 2025-12-08 13:44:56 +00:00

More thermal visor fixes; face reflection fix

This commit is contained in:
Jack Andersen
2019-02-26 18:52:01 -10:00
parent 67b9882dbe
commit 4cb26976bd
5 changed files with 27 additions and 22 deletions

View File

@@ -172,8 +172,8 @@ layout(location=0) out vec4 colorOut;
TBINDING0 uniform sampler2D tex;
void main()
{
colorOut = vtf.color;
colorOut.a = texture(tex, vtf.uv).r;
colorOut = vtf.color * texture(tex, vtf.uv);
colorOut.a = colorOut.r;
}
@@ -189,7 +189,9 @@ struct VertToFrag
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) ]],
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;
}

View File

@@ -80,8 +80,8 @@ void main()
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;
float indScene = dot(texture(sceneTex, vtf.sceneUv + indCoord), kRGBToYPrime);
colorOut = vtf.colorReg0 * indScene + vtf.colorReg1 * noiseTexel + vtf.colorReg2;
colorOut.a = vtf.colorReg1.a + vtf.colorReg1.a * noiseTexel.a + vtf.colorReg2.a;
colorOut = vtf.colorReg0 * indScene + vtf.colorReg2 - vtf.colorReg1 * noiseTexel.r;
colorOut.a = vtf.colorReg1.a + vtf.colorReg1.a * noiseTexel.r + vtf.colorReg2.a;
}
#vertex hlsl
@@ -160,8 +160,8 @@ float4 main(in VertToFrag vtf) : SV_Target0
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;
float indScene = dot(sceneTex.Sample(samp, vtf.sceneUv + indCoord), kRGBToYPrime);
float4 colorOut = vtf.colorReg0 * indScene + vtf.colorReg1 * noiseTexel + vtf.colorReg2;
colorOut.a = vtf.colorReg1.a + vtf.colorReg1.a * noiseTexel.a + vtf.colorReg2.a;
float4 colorOut = vtf.colorReg0 * indScene + vtf.colorReg2 - vtf.colorReg1 * noiseTexel.r;
colorOut.a = vtf.colorReg1.a + vtf.colorReg1.a * noiseTexel.r + vtf.colorReg2.a;
return colorOut;
}
@@ -247,7 +247,6 @@ fragment float4 fmain(VertToFrag vtf [[ stage_in ]],
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;
float indScene = dot(sceneTex.sample(samp, vtf.sceneUv + indCoord), kRGBToYPrime);
float4 colorOut = vtf.colorReg0 * indScene + vtf.colorReg1 * noiseTexel + vtf.colorReg2;
colorOut.a = vtf.colorReg1.a + vtf.colorReg1.a * noiseTexel.a + vtf.colorReg2.a;
return colorOut;
float4 colorOut = vtf.colorReg0 * indScene + vtf.colorReg2 - vtf.colorReg1 * noiseTexel.r;
colorOut.a = vtf.colorReg1.a + vtf.colorReg1.a * noiseTexel.r + vtf.colorReg2.a;
}