Fixing a duplicated-texel issue in the HLSL shaders, nw

This commit is contained in:
Ryan Holtz 2011-05-20 22:18:39 +00:00
parent f2a42ffe4d
commit a0e44c0b00
2 changed files with 5 additions and 9 deletions

View File

@ -109,7 +109,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 + 0.5f / float2(RawWidth, RawHeight));
float3 OutRGB = BaseTexel.rgb;

View File

@ -80,11 +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;
//float2 InvTexSize = float2(1.0f / TargetWidth, 1.0f / TargetHeight);
//float2 TexCoord = (Input.Position.xy * InvTexSize) / float2(WidthRatio, HeightRatio);
float2 Ratios = float2(WidthRatio, HeightRatio);
float2 Offset = float2(0.5f / RawWidth, 0.5f / RawHeight);
Output.TexCoord = Input.TexCoord;//(Input.TexCoord - float2(0.5f, 0.5f)) / 8.0f + float2(0.25f, 0.25f);
Output.TexCoord = Input.TexCoord;
Output.ExtraInfo = Input.ExtraInfo;
return Output;
@ -150,11 +146,11 @@ float4 ps_main(PS_INPUT Input) : COLOR
float3 PincushionCurveX = PinUnitCoord.x * PincushionAmount * PincushionR2;
float3 PincushionCurveY = PinUnitCoord.y * PincushionAmount * PincushionR2;
float4 BaseTexel = tex2D(DiffuseSampler, Input.TexCoord);
float4 BaseTexel = tex2D(DiffuseSampler, BaseCoord);
// -- Alpha Clipping (1px border in drawd3d does not work for some reason) --
clip((ScreenClipCoord.x < 1.0f / TargetWidth) ? -1 : 1);
clip((ScreenClipCoord.y < 3.0f / TargetHeight) ? -1 : 1);
clip((ScreenClipCoord.x < 0.0f / TargetWidth) ? -1 : 1);
clip((ScreenClipCoord.y < 0.0f / TargetHeight) ? -1 : 1);
clip((ScreenClipCoord.x > 1.0f / WidthRatio) ? -1 : 1);
clip((ScreenClipCoord.y > 1.0f / HeightRatio) ? -1 : 1);