MAMETesters bugs fixed:

- 04361: all: When using HLSL screen size not correct 

nwn: Frickin' finally...
This commit is contained in:
Ryan Holtz 2011-05-28 00:49:22 +00:00
parent 3e437e09f0
commit 59d38593e8
3 changed files with 21 additions and 20 deletions

View file

@ -58,6 +58,7 @@ VS_OUTPUT vs_main(VS_INPUT Input)
{
VS_OUTPUT Output = (VS_OUTPUT)0;
float2 invDims = float2(1.0f / RawWidth, 1.0f / RawHeight);
Output.Position = float4(Input.Position.xyz, 1.0f);
Output.Position.x /= TargetWidth;
Output.Position.y /= TargetHeight;
@ -66,7 +67,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 * invDims;
return Output;
}
@ -105,7 +106,7 @@ uniform float BluPower = 2.2f;
float4 ps_main(PS_INPUT Input) : COLOR
{
float4 BaseTexel = tex2D(DiffuseSampler, Input.TexCoord + 0.5f / float2(-RawWidth, -RawHeight));
float4 BaseTexel = tex2D(DiffuseSampler, Input.TexCoord);
float3 OutRGB = BaseTexel.rgb;

View file

@ -124,22 +124,22 @@ float4 ps_main(PS_INPUT Input) : COLOR
GrnCoord.y = GrnCoord.y - frac(GrnCoord.y);
BluCoord.y = BluCoord.y - frac(BluCoord.y);
float RedTexel = tex2D(DiffuseSampler, lerp(TexCoord, RedCoord, Deconverge) / RawDims + 0.5f / float2(RawWidth, RawHeight)).r;
float GrnTexel = tex2D(DiffuseSampler, lerp(TexCoord, GrnCoord, Deconverge) / RawDims + 0.5f / float2(RawWidth, RawHeight)).g;
float BluTexel = tex2D(DiffuseSampler, lerp(TexCoord, BluCoord, Deconverge) / RawDims + 0.5f / float2(RawWidth, RawHeight)).b;
float RedTexel = tex2D(DiffuseSampler, lerp(TexCoord, RedCoord, Deconverge) / RawDims + 0.5f / RawDims).r;
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;
RedTexel *= Input.RedCoord.x < (1.0f / TargetWidth) ? 0.0f : 1.0f;
RedTexel *= Input.RedCoord.y < (1.0f / TargetHeight) ? 0.0f : 1.0f;
RedTexel *= Input.RedCoord.x > (1.0f / WidthRatio) ? 0.0f : 1.0f;
RedTexel *= Input.RedCoord.y > (1.0f / HeightRatio) ? 0.0f : 1.0f;
GrnTexel *= Input.GrnCoord.x < (1.0f / TargetWidth) ? 0.0f : 1.0f;
GrnTexel *= Input.GrnCoord.y < (1.0f / TargetHeight) ? 0.0f : 1.0f;
GrnTexel *= Input.GrnCoord.x > (1.0f / WidthRatio) ? 0.0f : 1.0f;
GrnTexel *= Input.GrnCoord.y > (1.0f / HeightRatio) ? 0.0f : 1.0f;
BluTexel *= Input.BluCoord.x < (1.0f / TargetWidth) ? 0.0f : 1.0f;
BluTexel *= Input.BluCoord.y < (1.0f / TargetHeight) ? 0.0f : 1.0f;
BluTexel *= Input.BluCoord.x > (1.0f / WidthRatio) ? 0.0f : 1.0f;
BluTexel *= Input.BluCoord.y > (1.0f / HeightRatio) ? 0.0f : 1.0f;
//RedTexel *= Input.RedCoord.x < (1.0f / TargetWidth) ? 0.0f : 1.0f;
//RedTexel *= Input.RedCoord.y < (1.0f / TargetHeight) ? 0.0f : 1.0f;
//RedTexel *= Input.RedCoord.x > (1.0f / WidthRatio) ? 0.0f : 1.0f;
//RedTexel *= Input.RedCoord.y > (1.0f / HeightRatio) ? 0.0f : 1.0f;
//GrnTexel *= Input.GrnCoord.x < (1.0f / TargetWidth) ? 0.0f : 1.0f;
//GrnTexel *= Input.GrnCoord.y < (1.0f / TargetHeight) ? 0.0f : 1.0f;
//GrnTexel *= Input.GrnCoord.x > (1.0f / WidthRatio) ? 0.0f : 1.0f;
//GrnTexel *= Input.GrnCoord.y > (1.0f / HeightRatio) ? 0.0f : 1.0f;
//BluTexel *= Input.BluCoord.x < (1.0f / TargetWidth) ? 0.0f : 1.0f;
//BluTexel *= Input.BluCoord.y < (1.0f / TargetHeight) ? 0.0f : 1.0f;
//BluTexel *= Input.BluCoord.x > (1.0f / WidthRatio) ? 0.0f : 1.0f;
//BluTexel *= Input.BluCoord.y > (1.0f / HeightRatio) ? 0.0f : 1.0f;
return float4(RedTexel, GrnTexel, BluTexel, Alpha);
}

View file

@ -77,7 +77,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 + 0.5f / float2(RawWidth, RawHeight);
Output.TexCoord = Input.TexCoord + 0.5f / float2(TargetWidth, TargetHeight);
//float Zoom = 32.0f;
//Output.TexCoord /= Zoom;
@ -150,8 +150,8 @@ float4 ps_main(PS_INPUT Input) : COLOR
// -- Alpha Clipping (1px border in drawd3d does not work for some reason) --
clip((BaseCoord.x < WidthRatio / RawWidth) ? -1 : 1);
clip((BaseCoord.y < HeightRatio / RawHeight) ? -1 : 1);
clip((BaseCoord.x > (1.0f / WidthRatio + 1.0f / RawWidth)) ? -1 : 1);
clip((BaseCoord.y > (1.0f / HeightRatio + 1.0f / RawHeight)) ? -1 : 1);
//clip((BaseCoord.x > 1.0f / WidthRatio) ? -1 : 1);
//clip((BaseCoord.y > 1.0f / HeightRatio) ? -1 : 1);
// -- Scanline Simulation --
float InnerSine = BaseCoord.y * RawHeight * ScanlineScale + 0.5f;