mirror of
https://github.com/holub/mame
synced 2025-10-04 08:28:39 +03:00
TortoiseSVN indicates these didn't get updated, this should finally nail down the texture border pixel stretching issue, nwn
This commit is contained in:
parent
f38312b078
commit
41d1d2acdc
@ -114,9 +114,9 @@ float4 ps_main(PS_INPUT Input) : COLOR
|
||||
float Deconverge = 1.0f - MagnetDistance / MagnetCenter;
|
||||
Deconverge = clamp(Deconverge, 0.0f, 1.0f);
|
||||
float Alpha = tex2D(DiffuseSampler, Input.TexCoord).a;
|
||||
float RedTexel = tex2D(DiffuseSampler, lerp(Input.TexCoord, Input.RedCoord, Deconverge)).r;
|
||||
float GrnTexel = tex2D(DiffuseSampler, lerp(Input.TexCoord, Input.GrnCoord, Deconverge)).g;
|
||||
float BluTexel = tex2D(DiffuseSampler, lerp(Input.TexCoord, Input.BluCoord, Deconverge)).b;
|
||||
float RedTexel = tex2D(DiffuseSampler, lerp(Input.TexCoord, Input.RedCoord, Deconverge) + 0.5f / float2(RawWidth, RawHeight)).r;
|
||||
float GrnTexel = tex2D(DiffuseSampler, lerp(Input.TexCoord, Input.GrnCoord, Deconverge) + 0.5f / float2(RawWidth, RawHeight)).g;
|
||||
float BluTexel = tex2D(DiffuseSampler, lerp(Input.TexCoord, Input.BluCoord, Deconverge) + 0.5f / float2(RawWidth, RawHeight)).b;
|
||||
|
||||
return float4(RedTexel, GrnTexel, BluTexel, Alpha);
|
||||
}
|
||||
|
@ -79,8 +79,8 @@ VS_OUTPUT vs_main(VS_INPUT Input)
|
||||
Output.Color = Input.Color;
|
||||
|
||||
float2 InvTexSize = float2(1.0f / TargetWidth, 1.0f / TargetHeight);
|
||||
Output.TexCoord = Input.TexCoord;
|
||||
Output.PrevCoord = Output.TexCoord;
|
||||
Output.TexCoord = Input.TexCoord + 0.5f / float2(RawWidth, RawHeight);
|
||||
Output.PrevCoord = Output.TexCoord + 0.5f / float2(RawWidth, RawHeight);
|
||||
|
||||
return Output;
|
||||
}
|
||||
|
@ -80,7 +80,7 @@ VS_OUTPUT vs_main(VS_INPUT Input)
|
||||
Output.Position.y -= 0.5f;
|
||||
Output.Position *= float4(2.0f, 2.0f, 1.0f, 1.0f);
|
||||
Output.Color = Input.Color;
|
||||
Output.TexCoord = Input.TexCoord;
|
||||
Output.TexCoord = Input.TexCoord + 0.5f / float2(RawWidth, RawHeight);
|
||||
Output.ExtraInfo = Input.ExtraInfo;
|
||||
|
||||
//Output.TexCoord /= 16.0f;
|
||||
@ -151,8 +151,8 @@ float4 ps_main(PS_INPUT Input) : COLOR
|
||||
float4 BaseTexel = tex2D(DiffuseSampler, BaseCoord);
|
||||
|
||||
// -- Alpha Clipping (1px border in drawd3d does not work for some reason) --
|
||||
clip((ScreenClipCoord.x < 0.0f / TargetWidth) ? -1 : 1);
|
||||
clip((ScreenClipCoord.y < 0.0f / TargetHeight) ? -1 : 1);
|
||||
clip((ScreenClipCoord.x < 1.0f / TargetWidth) ? -1 : 1);
|
||||
clip((ScreenClipCoord.y < 1.0f / TargetHeight) ? -1 : 1);
|
||||
clip((ScreenClipCoord.x > 1.0f / WidthRatio) ? -1 : 1);
|
||||
clip((ScreenClipCoord.y > 1.0f / HeightRatio) ? -1 : 1);
|
||||
|
||||
|
@ -123,9 +123,9 @@ uniform float BValue;
|
||||
float4 ps_main(PS_INPUT Input) : COLOR
|
||||
{
|
||||
float2 RawDims = float2(RawWidth, RawHeight);
|
||||
float4 BaseTexel = tex2D(DiffuseSampler, Input.Coord0.xy);
|
||||
float4 OrigC = tex2D(CompositeSampler, Input.Coord0.xy);
|
||||
float4 OrigC2 = tex2D(CompositeSampler, Input.Coord4.xy);
|
||||
float4 BaseTexel = tex2D(DiffuseSampler, Input.Coord0.xy + 0.5f / RawDims);
|
||||
float4 OrigC = tex2D(CompositeSampler, Input.Coord0.xy + 0.5f / RawDims);
|
||||
float4 OrigC2 = tex2D(CompositeSampler, Input.Coord4.xy + 0.5f / RawDims);
|
||||
float4 C = OrigC;
|
||||
float4 C2 = OrigC2;
|
||||
|
||||
@ -166,10 +166,10 @@ float4 ps_main(PS_INPUT Input) : COLOR
|
||||
}
|
||||
float Yavg = Ytotal / (FscValue * 4.0f);
|
||||
|
||||
float4 I = (C - Yavg) * sin(W * Tc);
|
||||
float4 Q = (C - Yavg) * cos(W * Tc);
|
||||
float4 I2 = (C2 - Yavg) * sin(W * Tc2);
|
||||
float4 Q2 = (C2 - Yavg) * cos(W * Tc2);
|
||||
float4 I = C * sin(W * Tc);
|
||||
float4 Q = C * cos(W * Tc);
|
||||
float4 I2 = C2 * sin(W * Tc2);
|
||||
float4 Q2 = C2 * cos(W * Tc2);
|
||||
|
||||
float Itotal = 0.0f;
|
||||
float Qtotal = 0.0f;
|
||||
|
@ -71,10 +71,10 @@ VS_OUTPUT vs_main(VS_INPUT Input)
|
||||
Output.Position.y -= 0.5f;
|
||||
Output.Position *= float4(2.0f, 2.0f, 1.0f, 1.0f);
|
||||
Output.Color = Input.Color;
|
||||
Output.Coord0 = Input.TexCoord + float2(0.00f / RawWidth, 0.0f);
|
||||
Output.Coord1 = Input.TexCoord + float2(0.25f / RawWidth, 0.0f);
|
||||
Output.Coord2 = Input.TexCoord + float2(0.50f / RawWidth, 0.0f);
|
||||
Output.Coord3 = Input.TexCoord + float2(0.75f / RawWidth, 0.0f);
|
||||
Output.Coord0 = Input.TexCoord;
|
||||
Output.Coord1 = Input.TexCoord;
|
||||
Output.Coord2 = Input.TexCoord;
|
||||
Output.Coord3 = Input.TexCoord;
|
||||
|
||||
return Output;
|
||||
}
|
||||
@ -95,17 +95,17 @@ uniform float FscScale;
|
||||
|
||||
float4 ps_main(PS_INPUT Input) : COLOR
|
||||
{
|
||||
float2 InvRatios = float2(1.0f / WidthRatio, 1.0f / HeightRatio);
|
||||
float3 Texel0 = tex2D(DiffuseSampler, Input.Coord0 - float2(0.0f, 0.5f / RawHeight)).rgb;
|
||||
float3 Texel1 = tex2D(DiffuseSampler, Input.Coord1 - float2(0.0f, 0.5f / RawHeight)).rgb;
|
||||
float3 Texel2 = tex2D(DiffuseSampler, Input.Coord2 - float2(0.0f, 0.5f / RawHeight)).rgb;
|
||||
float3 Texel3 = tex2D(DiffuseSampler, Input.Coord3 - float2(0.0f, 0.5f / RawHeight)).rgb;
|
||||
|
||||
float2 Scaler = float2(RawWidth, RawHeight);
|
||||
float2 Coord0 = Input.Coord0.xy * Scaler;
|
||||
float2 Coord1 = Input.Coord1.xy * Scaler;
|
||||
float2 Coord2 = Input.Coord2.xy * Scaler;
|
||||
float2 Coord3 = Input.Coord3.xy * Scaler;
|
||||
float2 InvRatios = float2(1.0f / WidthRatio, 1.0f / HeightRatio);
|
||||
float3 Texel0 = tex2D(DiffuseSampler, Input.Coord0 + float2(FscScale * 0.00f + 0.5f, 0.5f) / Scaler).rgb;
|
||||
float3 Texel1 = tex2D(DiffuseSampler, Input.Coord1 + float2(FscScale * 0.25f + 0.5f, 0.5f) / Scaler).rgb;
|
||||
float3 Texel2 = tex2D(DiffuseSampler, Input.Coord2 + float2(FscScale * 0.50f + 0.5f, 0.5f) / Scaler).rgb;
|
||||
float3 Texel3 = tex2D(DiffuseSampler, Input.Coord3 + float2(FscScale * 0.75f + 0.5f, 0.5f) / Scaler).rgb;
|
||||
|
||||
float2 Coord0 = (Input.Coord0.xy + float2(0.00f / RawWidth, 0.0f)) * Scaler;
|
||||
float2 Coord1 = (Input.Coord1.xy + float2(0.25f / RawWidth, 0.0f)) * Scaler;
|
||||
float2 Coord2 = (Input.Coord2.xy + float2(0.50f / RawWidth, 0.0f)) * Scaler;
|
||||
float2 Coord3 = (Input.Coord3.xy + float2(0.75f / RawWidth, 0.0f)) * Scaler;
|
||||
|
||||
float W = WValue;
|
||||
float T0 = Coord0.x + AValue * Coord0.y + BValue;
|
||||
|
Loading…
Reference in New Issue
Block a user