summaryrefslogtreecommitdiffstatshomepage
path: root/hlsl/yiq_encode.fx
diff options
context:
space:
mode:
authorGravatarGravatar Ryan Holtz <rholtz@batcountryentertainment.com>2011-05-22 03:48:13 +0000
committerGravatarGravatar Ryan Holtz <rholtz@batcountryentertainment.com>2011-05-22 03:48:13 +0000
commit41d1d2acdc5d22ad14a9090239976554c4b860b9 (patch)
tree401ae2a62e634b4e15eb424963b3e850cda5acd3 /hlsl/yiq_encode.fx
parentf38312b078f435955e8d2bc3db1bb508b95ad922 (diff)
TortoiseSVN indicates these didn't get updated, this should finally nail down the texture border pixel stretching issue, nwn
Diffstat (limited to 'hlsl/yiq_encode.fx')
-rw-r--r--hlsl/yiq_encode.fx26
1 files changed, 13 insertions, 13 deletions
diff --git a/hlsl/yiq_encode.fx b/hlsl/yiq_encode.fx
index e15e7ccb7d7..b4188e8b1fc 100644
--- a/hlsl/yiq_encode.fx
+++ b/hlsl/yiq_encode.fx
@@ -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 Scaler = float2(RawWidth, RawHeight);
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;
+ 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 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 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;