mirror of
https://github.com/AxioDL/metaforce.git
synced 2025-12-08 13:44:56 +00:00
Thermal visor fixes
This commit is contained in:
@@ -78,7 +78,7 @@ const vec4 kRGBToYPrime = vec4(0.299, 0.587, 0.114, 0.0);
|
||||
void main()
|
||||
{
|
||||
vec4 noiseTexel = texelFetch(noiseTex, Lookup8BPP(vtf.noiseUv, vtf.randOff), 0);
|
||||
vec2 indCoord = (vtf.indMtx * vec3(noiseTexel.x - 0.5, noiseTexel.y - 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);
|
||||
colorOut = vtf.colorReg0 * indScene + vtf.colorReg1 * noiseTexel + vtf.colorReg2;
|
||||
colorOut.a = vtf.colorReg1.a + vtf.colorReg1.a * noiseTexel.a + vtf.colorReg2.a;
|
||||
@@ -158,7 +158,7 @@ static const float4 kRGBToYPrime = {0.299, 0.587, 0.114, 0.0};
|
||||
float4 main(in VertToFrag vtf) : SV_Target0
|
||||
{
|
||||
float4 noiseTexel = noiseTex.Load(Lookup8BPP(vtf.noiseUv, vtf.randOff));
|
||||
float2 indCoord = mul(vtf.indMtx, float3(noiseTexel.x - 0.5, noiseTexel.y - 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);
|
||||
float4 colorOut = vtf.colorReg0 * indScene + vtf.colorReg1 * noiseTexel + vtf.colorReg2;
|
||||
colorOut.a = vtf.colorReg1.a + vtf.colorReg1.a * noiseTexel.a + vtf.colorReg2.a;
|
||||
@@ -245,7 +245,7 @@ fragment float4 fmain(VertToFrag vtf [[ stage_in ]],
|
||||
texture2d<float> noiseTex [[ texture(1) ]])
|
||||
{
|
||||
float4 noiseTexel = noiseTex.read(Lookup8BPP(vtf.noiseUv, vtf.randOff));
|
||||
float2 indCoord = (vtf.indMtx * float3(noiseTexel.x - 0.5, noiseTexel.y - 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);
|
||||
float4 colorOut = vtf.colorReg0 * indScene + vtf.colorReg1 * noiseTexel + vtf.colorReg2;
|
||||
colorOut.a = vtf.colorReg1.a + vtf.colorReg1.a * noiseTexel.a + vtf.colorReg2.a;
|
||||
|
||||
@@ -46,7 +46,7 @@ void main()
|
||||
{
|
||||
float sceneSample = dot(texture(sceneTex, vtf.sceneUv), kRGBToYPrime);
|
||||
vec4 colorSample = texture(paletteTex, vec2(sceneSample / 17.0, 0.5));
|
||||
colorOut = vec4((colorSample * sceneSample).rgb, 0.0);
|
||||
colorOut = vec4(colorSample.rgb, 0.0);
|
||||
}
|
||||
|
||||
#vertex hlsl
|
||||
@@ -93,7 +93,7 @@ float4 main(in VertToFrag vtf) : SV_Target0
|
||||
{
|
||||
float sceneSample = dot(sceneTex.Sample(samp, vtf.sceneUv), kRGBToYPrime);
|
||||
float4 colorSample = paletteTex.Sample(samp, float2(sceneSample / 17.0, 0.5));
|
||||
return float4((colorSample * sceneSample).rgb, 0.0);
|
||||
return float4(colorSample.rgb, 0.0);
|
||||
}
|
||||
|
||||
#vertex metal
|
||||
@@ -140,5 +140,5 @@ fragment float4 fmain(VertToFrag vtf [[ stage_in ]],
|
||||
{
|
||||
float sceneSample = dot(sceneTex.sample(samp, vtf.sceneUv), kRGBToYPrime);
|
||||
float4 colorSample = paletteTex.sample(samp, float2(sceneSample / 17.0, 0.5));
|
||||
return float4((colorSample * sceneSample).rgb, 0.0);
|
||||
return float4(colorSample.rgb, 0.0);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user