summaryrefslogtreecommitdiffstatshomepage
path: root/hlsl/downsample.fx
diff options
context:
space:
mode:
author ImJezze <jezze@gmx.net>2016-01-03 16:20:27 +0100
committer ImJezze <jezze@gmx.net>2016-01-03 16:20:27 +0100
commit1cacb7d040936147c47f849211f53f57b773eaf5 (patch)
tree31aa8ef4e9dda60c7244d2a901c8eb8db8ab97b6 /hlsl/downsample.fx
parenta2c7b61daa5d66e0e9d7b1d1f683cf2f6d9f5973 (diff)
Refactoring (nw)
- restructured bloom level size and weight uniforms
Diffstat (limited to 'hlsl/downsample.fx')
-rw-r--r--hlsl/downsample.fx17
1 files changed, 9 insertions, 8 deletions
diff --git a/hlsl/downsample.fx b/hlsl/downsample.fx
index 9ac584b56f1..122172350f9 100644
--- a/hlsl/downsample.fx
+++ b/hlsl/downsample.fx
@@ -35,7 +35,7 @@ struct VS_OUTPUT
struct VS_INPUT
{
- float3 Position : POSITION;
+ float4 Position : POSITION;
float4 Color : COLOR0;
float2 TexCoord : TEXCOORD0;
};
@@ -53,6 +53,7 @@ struct PS_INPUT
uniform float2 ScreenDims;
uniform float2 TargetDims;
+uniform float2 SourceRect;
uniform bool PrepareVector;
@@ -72,7 +73,7 @@ VS_OUTPUT vs_main(VS_INPUT Input)
float2 TexCoord = Input.Position.xy / ScreenDims;
TexCoord += PrepareVector
- ? 0.5f / TargetDims // half texel offset correction (DX9)
+ ? 0.5f / TargetDims // half texel offset correction (DX9) - only for vector grpahics
: 0.0f;
Output.TexCoord01.xy = TexCoord + float2(-0.5f, -0.5f) * TargetTexelDims;
@@ -89,14 +90,14 @@ VS_OUTPUT vs_main(VS_INPUT Input)
float4 ps_main(PS_INPUT Input) : COLOR
{
- float4 texel0 = tex2D(DiffuseSampler, Input.TexCoord01.xy);
- float4 texel1 = tex2D(DiffuseSampler, Input.TexCoord01.zw);
- float4 texel2 = tex2D(DiffuseSampler, Input.TexCoord23.xy);
- float4 texel3 = tex2D(DiffuseSampler, Input.TexCoord23.zw);
+ float3 texel0 = tex2D(DiffuseSampler, Input.TexCoord01.xy).rgb;
+ float3 texel1 = tex2D(DiffuseSampler, Input.TexCoord01.zw).rgb;
+ float3 texel2 = tex2D(DiffuseSampler, Input.TexCoord23.xy).rgb;
+ float3 texel3 = tex2D(DiffuseSampler, Input.TexCoord23.zw).rgb;
- float4 outTexel = (texel0 + texel1 + texel2 + texel3) / 4.0;
+ float3 outTexel = (texel0 + texel1 + texel2 + texel3) / 4.0;
- return float4(outTexel.rgb, 1.0f);
+ return float4(outTexel, 1.0f);
}
//-----------------------------------------------------------------------------