mirror of
https://github.com/mamedev/mame.git
synced 2024-11-16 07:48:32 +01:00
No whatnsew: Really, really, really fixed the remaining pixel alignment and UV clamping issues. Tested Gradius, Pac-Man, Mr. Do, and Stompin' with no observed issues. Gradius, in particular, is a good test case as the bottom row of its "Credits" readout lies on the bottom row of pixels, and the scrolling starfield allows visual verification of the X extents as they scroll on and off.
This commit is contained in:
parent
75f1480ae9
commit
244eb4cf24
4 changed files with 19 additions and 19 deletions
|
@ -67,7 +67,7 @@ VS_OUTPUT vs_main(VS_INPUT Input)
|
||||||
Output.Position.y -= 0.5f;
|
Output.Position.y -= 0.5f;
|
||||||
Output.Position *= float4(2.0f, 2.0f, 1.0f, 1.0f);
|
Output.Position *= float4(2.0f, 2.0f, 1.0f, 1.0f);
|
||||||
Output.Color = Input.Color;
|
Output.Color = Input.Color;
|
||||||
Output.TexCoord = Input.TexCoord + 0.5f * invDims;
|
Output.TexCoord = Input.TexCoord + float2(0.5f, 0.5f) * invDims;
|
||||||
|
|
||||||
return Output;
|
return Output;
|
||||||
}
|
}
|
||||||
|
|
|
@ -128,18 +128,18 @@ float4 ps_main(PS_INPUT Input) : COLOR
|
||||||
float GrnTexel = tex2D(DiffuseSampler, lerp(TexCoord, GrnCoord, Deconverge) / RawDims + 0.5f / RawDims).g;
|
float GrnTexel = tex2D(DiffuseSampler, lerp(TexCoord, GrnCoord, Deconverge) / RawDims + 0.5f / RawDims).g;
|
||||||
float BluTexel = tex2D(DiffuseSampler, lerp(TexCoord, BluCoord, Deconverge) / RawDims + 0.5f / RawDims).b;
|
float BluTexel = tex2D(DiffuseSampler, lerp(TexCoord, BluCoord, Deconverge) / RawDims + 0.5f / RawDims).b;
|
||||||
|
|
||||||
//RedTexel *= Input.RedCoord.x < (1.0f / TargetWidth) ? 0.0f : 1.0f;
|
//RedTexel *= Input.RedCoord.x < (WidthRatio / RawWidth) ? 0.0f : 1.0f;
|
||||||
//RedTexel *= Input.RedCoord.y < (1.0f / TargetHeight) ? 0.0f : 1.0f;
|
//RedTexel *= Input.RedCoord.y < (HeightRatio / RawHeight) ? 0.0f : 1.0f;
|
||||||
//RedTexel *= Input.RedCoord.x > (1.0f / WidthRatio) ? 0.0f : 1.0f;
|
//RedTexel *= Input.RedCoord.x > (1.0f / WidthRatio + 1.0f / RawWidth) ? 0.0f : 1.0f;
|
||||||
//RedTexel *= Input.RedCoord.y > (1.0f / HeightRatio) ? 0.0f : 1.0f;
|
//RedTexel *= Input.RedCoord.y > (1.0f / HeightRatio + 1.0f / RawHeight) ? 0.0f : 1.0f;
|
||||||
//GrnTexel *= Input.GrnCoord.x < (1.0f / TargetWidth) ? 0.0f : 1.0f;
|
//GrnTexel *= Input.GrnCoord.x < (WidthRatio / RawWidth) ? 0.0f : 1.0f;
|
||||||
//GrnTexel *= Input.GrnCoord.y < (1.0f / TargetHeight) ? 0.0f : 1.0f;
|
//GrnTexel *= Input.GrnCoord.y < (HeightRatio / RawHeight) ? 0.0f : 1.0f;
|
||||||
//GrnTexel *= Input.GrnCoord.x > (1.0f / WidthRatio) ? 0.0f : 1.0f;
|
//GrnTexel *= Input.GrnCoord.x > (1.0f / WidthRatio + 1.0f / RawWidth) ? 0.0f : 1.0f;
|
||||||
//GrnTexel *= Input.GrnCoord.y > (1.0f / HeightRatio) ? 0.0f : 1.0f;
|
//GrnTexel *= Input.GrnCoord.y > (1.0f / HeightRatio + 1.0f / RawHeight) ? 0.0f : 1.0f;
|
||||||
//BluTexel *= Input.BluCoord.x < (1.0f / TargetWidth) ? 0.0f : 1.0f;
|
//BluTexel *= Input.BluCoord.x < (WidthRatio / RawWidth) ? 0.0f : 1.0f;
|
||||||
//BluTexel *= Input.BluCoord.y < (1.0f / TargetHeight) ? 0.0f : 1.0f;
|
//BluTexel *= Input.BluCoord.y < (HeightRatio / RawHeight) ? 0.0f : 1.0f;
|
||||||
//BluTexel *= Input.BluCoord.x > (1.0f / WidthRatio) ? 0.0f : 1.0f;
|
//BluTexel *= Input.BluCoord.x > (1.0f / WidthRatio + 1.0f / RawWidth) ? 0.0f : 1.0f;
|
||||||
//BluTexel *= Input.BluCoord.y > (1.0f / HeightRatio) ? 0.0f : 1.0f;
|
//BluTexel *= Input.BluCoord.y > (1.0f / HeightRatio + 1.0f / RawHeight) ? 0.0f : 1.0f;
|
||||||
|
|
||||||
return float4(RedTexel, GrnTexel, BluTexel, Alpha);
|
return float4(RedTexel, GrnTexel, BluTexel, Alpha);
|
||||||
}
|
}
|
||||||
|
|
|
@ -78,7 +78,7 @@ VS_OUTPUT vs_main(VS_INPUT Input)
|
||||||
Output.Color = Input.Color;
|
Output.Color = Input.Color;
|
||||||
|
|
||||||
float2 InvTexSize = float2(1.0f / TargetWidth, 1.0f / TargetHeight);
|
float2 InvTexSize = float2(1.0f / TargetWidth, 1.0f / TargetHeight);
|
||||||
Output.TexCoord = Input.TexCoord + 0.5f * InvTexSize;
|
Output.TexCoord = Input.TexCoord + 0.5f * InvTexSize;
|
||||||
Output.PrevCoord = Output.TexCoord + 0.5f * InvTexSize;
|
Output.PrevCoord = Output.TexCoord + 0.5f * InvTexSize;
|
||||||
|
|
||||||
return Output;
|
return Output;
|
||||||
|
|
10
hlsl/post.fx
10
hlsl/post.fx
|
@ -148,13 +148,13 @@ float4 ps_main(PS_INPUT Input) : COLOR
|
||||||
float4 BaseTexel = tex2D(DiffuseSampler, BaseCoord);
|
float4 BaseTexel = tex2D(DiffuseSampler, BaseCoord);
|
||||||
|
|
||||||
// -- Alpha Clipping (1px border in drawd3d does not work for some reason) --
|
// -- Alpha Clipping (1px border in drawd3d does not work for some reason) --
|
||||||
clip((BaseCoord.x < WidthRatio / RawWidth) ? -1 : 1);
|
clip((BaseCoord.x < 1.0f / RawWidth) ? -1 : 1);
|
||||||
clip((BaseCoord.y < HeightRatio / RawHeight) ? -1 : 1);
|
clip((BaseCoord.y < 1.0f / RawHeight) ? -1 : 1);
|
||||||
clip((BaseCoord.x > (1.0f / WidthRatio + 1.0f / RawWidth + 1.0f / TargetWidth)) ? -1 : 1);
|
clip((BaseCoord.x > (1.0f / WidthRatio + 1.0f / RawWidth)) ? -1 : 1);
|
||||||
clip((BaseCoord.y > (1.0f / HeightRatio + 1.0f / RawHeight + 1.0f / TargetHeight)) ? -1 : 1);
|
clip((BaseCoord.y > (1.0f / HeightRatio + 1.0f / RawHeight)) ? -1 : 1);
|
||||||
|
|
||||||
// -- Scanline Simulation --
|
// -- Scanline Simulation --
|
||||||
float InnerSine = BaseCoord.y * RawHeight * ScanlineScale + 0.5f;
|
float InnerSine = BaseCoord.y * RawHeight * ScanlineScale;
|
||||||
float3 ScanBrightness = lerp(1.0f, abs(sin(InnerSine * PI + ScanlineOffset * RawHeight)) * ScanlineBrightScale + 1.0f, ScanlineAmount);
|
float3 ScanBrightness = lerp(1.0f, abs(sin(InnerSine * PI + ScanlineOffset * RawHeight)) * ScanlineBrightScale + 1.0f, ScanlineAmount);
|
||||||
//float3 Scanned = BaseTexel.rgb * ScanBrightness;
|
//float3 Scanned = BaseTexel.rgb * ScanBrightness;
|
||||||
float3 Scanned = BaseTexel.rgb * ScanBrightness;
|
float3 Scanned = BaseTexel.rgb * ScanBrightness;
|
||||||
|
|
Loading…
Reference in a new issue