summaryrefslogtreecommitdiffstatshomepage
path: root/hlsl/bloom.fx
diff options
context:
space:
mode:
author ImJezze <jezze@gmx.net>2016-02-25 20:58:49 +0100
committer ImJezze <jezze@gmx.net>2016-02-25 20:58:49 +0100
commit11395616ddde568531c640a461d70d526bb112ab (patch)
treeda10a28ca80608fb6f6f009e2d8e78facb4cb5e1 /hlsl/bloom.fx
parentd44f8f4c2bdf19fdd55a45c779b746160d90d4fa (diff)
Bloom refactoring
- calculation of bloom dimensions is now done only once, when render target is created - reduced blur width for non-vector screens - implemented shadow u/v option for source tile mode
Diffstat (limited to 'hlsl/bloom.fx')
-rw-r--r--hlsl/bloom.fx22
1 files changed, 15 insertions, 7 deletions
diff --git a/hlsl/bloom.fx b/hlsl/bloom.fx
index 1ee152adfec..47cc04c47ed 100644
--- a/hlsl/bloom.fx
+++ b/hlsl/bloom.fx
@@ -202,8 +202,9 @@ float random(float2 seed)
uniform float2 ScreenDims;
uniform float2 TargetDims;
-uniform float2 SourceRect;
+uniform float2 SourceDims;
+// level dimensions not necessary anymore?
uniform float2 Level0Size;
uniform float4 Level12Size;
uniform float4 Level34Size;
@@ -211,6 +212,8 @@ uniform float4 Level56Size;
uniform float4 Level78Size;
uniform float4 Level9ASize;
+uniform bool VectorScreen = false;
+
VS_OUTPUT vs_main(VS_INPUT Input)
{
VS_OUTPUT Output = (VS_OUTPUT)0;
@@ -226,12 +229,17 @@ VS_OUTPUT vs_main(VS_INPUT Input)
float2 TexCoord = Input.Position.xy / ScreenDims;
TexCoord += 0.5f / TargetDims; // half texel offset correction (DX9)
- Output.TexCoord0 = TexCoord;
- Output.TexCoord12 = TexCoord.xyxy + (0.5f / Level12Size);
- Output.TexCoord34 = TexCoord.xyxy + (0.5f / Level34Size);
- Output.TexCoord56 = TexCoord.xyxy + (0.5f / Level56Size);
- Output.TexCoord78 = TexCoord.xyxy + (0.5f / Level78Size);
- Output.TexCoord9A = TexCoord.xyxy + (0.5f / Level9ASize);
+ Output.TexCoord0 = TexCoord.xy; // + (0.5f / Level0Size);
+
+ TexCoord += VectorScreen
+ ? 0.5f / TargetDims.xy
+ : 0.5f / SourceDims.xy;
+
+ Output.TexCoord12 = TexCoord.xyxy; // + (0.5f / Level12Size);
+ Output.TexCoord34 = TexCoord.xyxy; // + (0.5f / Level34Size);
+ Output.TexCoord56 = TexCoord.xyxy; // + (0.5f / Level56Size);
+ Output.TexCoord78 = TexCoord.xyxy; // + (0.5f / Level78Size);
+ Output.TexCoord9A = TexCoord.xyxy; // + (0.5f / Level9ASize);
return Output;
}