summaryrefslogtreecommitdiffstatshomepage
path: root/hlsl/primary.fx
diff options
context:
space:
mode:
author ImJezze <jezze@gmx.net>2016-02-20 21:58:56 +0100
committer ImJezze <jezze@gmx.net>2016-02-20 21:58:56 +0100
commite57c90084c5d1dd9f6cdb0bbbf8782dc4f369cda (patch)
tree650be9617f5dd57cce30eb78e283e15c149a0472 /hlsl/primary.fx
parentd15d53c728b4848e3ed74d66b9ab446811e1acee (diff)
Quality and Performance improvements
- HLSL now uses NPOT sized target surfaces (breaks compatibility with graphics cards based on R300/R400/NV30 and older) - HLSL target surfaces now have the size of the screen canvas - removed HLSL pre-scale factor - HLSL now uses a sharp bilinear interpolation to pre-scale textures to screen canvas size, based on [Themaister's] implementation - improved overall performance (based on the previously required pre-scale factor, you might notice a 5-50% speed-up depending on your graphics card, more if you used a higher pre-scale factor) - improved shadow mask quality (pixel-perfect) in screen-mode - fixed half source texel offset of bloom level alignment - removed ./hlsl/artwork_support folder - all shaders after pre-scale are now based on screen coordinate (workaground, till both raster and vector pass can work on texture coordinates) - disabled distortion shader for more than one screen and for artworks in full mode, does not affect artworks in copped mode (workaground, till both raster and vector pass can work on texture coordinates) - moved compute_texture_size() from texture_info to texture_manager (nw)
Diffstat (limited to 'hlsl/primary.fx')
-rw-r--r--hlsl/primary.fx23
1 files changed, 14 insertions, 9 deletions
diff --git a/hlsl/primary.fx b/hlsl/primary.fx
index f0a1c1da0e7..3f08afd3dca 100644
--- a/hlsl/primary.fx
+++ b/hlsl/primary.fx
@@ -55,8 +55,7 @@ uniform float2 ScreenDims;
uniform float2 TargetDims;
uniform bool PostPass;
-
-uniform float Brighten;
+uniform bool VectorScreen;
VS_OUTPUT vs_main(VS_INPUT Input)
{
@@ -70,12 +69,16 @@ VS_OUTPUT vs_main(VS_INPUT Input)
float2 targetDims = TargetDims + Epsilon; // bug: with exact target dimensions the font disappears
- Output.TexCoord = PostPass
- ? Input.Position.xy / ScreenDims
- : Input.TexCoord;
- Output.TexCoord += PostPass
- ? 0.5f / targetDims // half texel offset correction (DX9)
- : 0.0f;
+ if (PostPass)
+ {
+ Output.TexCoord = Input.Position.xy / ScreenDims;
+ Output.TexCoord += 0.5f / targetDims; // half texel offset correction (DX9)
+ }
+ else
+ {
+ Output.TexCoord = Input.TexCoord;
+ // Output.TexCoord += 0.5f / targetDims; // half texel offset correction (DX9)
+ }
Output.Color = Input.Color;
@@ -89,7 +92,9 @@ VS_OUTPUT vs_main(VS_INPUT Input)
float4 ps_main(PS_INPUT Input) : COLOR
{
float4 BaseTexel = tex2D(DiffuseSampler, Input.TexCoord);
- BaseTexel *= Input.Color + float4(Brighten, Brighten, Brighten, 0.0f);
+ BaseTexel *= PostPass && VectorScreen
+ ? Input.Color + float4(1.0f, 1.0f, 1.0f, 0.0f)
+ : Input.Color;
return BaseTexel;
}