diff options
author | 2016-02-20 21:58:56 +0100 | |
---|---|---|
committer | 2016-02-20 21:58:56 +0100 | |
commit | e57c90084c5d1dd9f6cdb0bbbf8782dc4f369cda (patch) | |
tree | 650be9617f5dd57cce30eb78e283e15c149a0472 /hlsl/artwork_support/distortion.fx | |
parent | d15d53c728b4848e3ed74d66b9ab446811e1acee (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/artwork_support/distortion.fx')
-rw-r--r-- | hlsl/artwork_support/distortion.fx | 101 |
1 files changed, 0 insertions, 101 deletions
diff --git a/hlsl/artwork_support/distortion.fx b/hlsl/artwork_support/distortion.fx deleted file mode 100644 index 333363afeb8..00000000000 --- a/hlsl/artwork_support/distortion.fx +++ /dev/null @@ -1,101 +0,0 @@ -// license:BSD-3-Clause -// copyright-holders:ImJezze -//----------------------------------------------------------------------------- -// Distortion Effect -//----------------------------------------------------------------------------- - -//----------------------------------------------------------------------------- -// Sampler Definitions -//----------------------------------------------------------------------------- - -texture DiffuseTexture; - -sampler DiffuseSampler = sampler_state -{ - Texture = <DiffuseTexture>; - MipFilter = LINEAR; - MinFilter = LINEAR; - MagFilter = LINEAR; - AddressU = CLAMP; - AddressV = CLAMP; - AddressW = CLAMP; -}; - -//----------------------------------------------------------------------------- -// Vertex Definitions -//----------------------------------------------------------------------------- - -struct VS_INPUT -{ - float4 Position : POSITION; - float4 Color : COLOR0; - float2 TexCoord : TEXCOORD0; -}; - -struct VS_OUTPUT -{ - float4 Position : POSITION; - float4 Color : COLOR0; - float2 TexCoord : TEXCOORD0; -}; - -struct PS_INPUT -{ - float4 Color : COLOR0; - float2 TexCoord : TEXCOORD0; -}; - -//----------------------------------------------------------------------------- -// Distortion Vertex Shader -//----------------------------------------------------------------------------- - -uniform float2 ScreenDims; // size of the window or fullscreen -uniform float2 TargetDims; - -VS_OUTPUT vs_main(VS_INPUT Input) -{ - VS_OUTPUT Output = (VS_OUTPUT)0; - - Output.Position = float4(Input.Position.xyz, 1.0f); - Output.Position.xy /= ScreenDims; - Output.Position.y = 1.0f - Output.Position.y; // flip y - Output.Position.xy -= 0.5f; // center - Output.Position.xy *= 2.0f; // zoom - - Output.Color = Input.Color; - - Output.TexCoord = Input.Position.xy / ScreenDims; - Output.TexCoord += 0.5f / TargetDims; // half texel offset correction (DX9) - - return Output; -} - -//----------------------------------------------------------------------------- -// Post-Processing Pixel Shader -//----------------------------------------------------------------------------- - -float4 ps_main(PS_INPUT Input) : COLOR -{ - float2 BaseCoord = Input.TexCoord; - - // Color - float4 BaseColor = tex2D(DiffuseSampler, BaseCoord); - BaseColor.a = 1.0f; - - return BaseColor; -} - -//----------------------------------------------------------------------------- -// Distortion Effect -//----------------------------------------------------------------------------- - -technique DefaultTechnique -{ - pass Pass0 - { - Lighting = FALSE; - - VertexShader = compile vs_3_0 vs_main(); - PixelShader = compile ps_3_0 ps_main(); - } -}
\ No newline at end of file |