2015-05-24 05:53:26 -07:00
|
|
|
|
// license:BSD-3-Clause
|
2015-05-12 00:18:09 -07:00
|
|
|
|
// copyright-holders:Ryan Holtz,ImJezze
|
Initial shader import (nw)
Focus: 8-sample blur that averages 7 samples around a center sample.
Phosphor: Not currently used, treated as a pass-through by drawd3d.c, but could be used to implement additional convolutions in a second pass.
Pincushion: Used (when commented in in drawd3d.c) to pincushion an entire full-screen texture but not otherwise apply any convolutions.
Post: The meat and potatoes. It does scanlines, it does aperture masking, it does dot crawl, it does chroma subsampling, it does YIQ colorspace convolution, it does RGB colorspace convolution, it does pincushioning, it walks, it talks, it does the dishes, it'll screw your wife for you, and if you don't have a wife it will find one for you, get you married to her, and screw her for you, IT IS THAT GOOD, LADIES AND GENTLEMEN.
Primary: Simple passthrough for UI and artwork.
2011-05-16 09:55:34 -07:00
|
|
|
|
//-----------------------------------------------------------------------------
|
2011-05-17 17:35:16 -07:00
|
|
|
|
// Scanline & Shadowmask Effect
|
Initial shader import (nw)
Focus: 8-sample blur that averages 7 samples around a center sample.
Phosphor: Not currently used, treated as a pass-through by drawd3d.c, but could be used to implement additional convolutions in a second pass.
Pincushion: Used (when commented in in drawd3d.c) to pincushion an entire full-screen texture but not otherwise apply any convolutions.
Post: The meat and potatoes. It does scanlines, it does aperture masking, it does dot crawl, it does chroma subsampling, it does YIQ colorspace convolution, it does RGB colorspace convolution, it does pincushioning, it walks, it talks, it does the dishes, it'll screw your wife for you, and if you don't have a wife it will find one for you, get you married to her, and screw her for you, IT IS THAT GOOD, LADIES AND GENTLEMEN.
Primary: Simple passthrough for UI and artwork.
2011-05-16 09:55:34 -07:00
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
|
|
2013-08-29 18:05:13 -07:00
|
|
|
|
texture DiffuseTexture;
|
Initial shader import (nw)
Focus: 8-sample blur that averages 7 samples around a center sample.
Phosphor: Not currently used, treated as a pass-through by drawd3d.c, but could be used to implement additional convolutions in a second pass.
Pincushion: Used (when commented in in drawd3d.c) to pincushion an entire full-screen texture but not otherwise apply any convolutions.
Post: The meat and potatoes. It does scanlines, it does aperture masking, it does dot crawl, it does chroma subsampling, it does YIQ colorspace convolution, it does RGB colorspace convolution, it does pincushioning, it walks, it talks, it does the dishes, it'll screw your wife for you, and if you don't have a wife it will find one for you, get you married to her, and screw her for you, IT IS THAT GOOD, LADIES AND GENTLEMEN.
Primary: Simple passthrough for UI and artwork.
2011-05-16 09:55:34 -07:00
|
|
|
|
|
|
|
|
|
sampler DiffuseSampler = sampler_state
|
|
|
|
|
{
|
2015-05-03 05:41:05 -07:00
|
|
|
|
Texture = <DiffuseTexture>;
|
2014-01-23 16:30:29 -08:00
|
|
|
|
MipFilter = LINEAR;
|
|
|
|
|
MinFilter = LINEAR;
|
|
|
|
|
MagFilter = LINEAR;
|
|
|
|
|
AddressU = CLAMP;
|
|
|
|
|
AddressV = CLAMP;
|
|
|
|
|
AddressW = CLAMP;
|
Initial shader import (nw)
Focus: 8-sample blur that averages 7 samples around a center sample.
Phosphor: Not currently used, treated as a pass-through by drawd3d.c, but could be used to implement additional convolutions in a second pass.
Pincushion: Used (when commented in in drawd3d.c) to pincushion an entire full-screen texture but not otherwise apply any convolutions.
Post: The meat and potatoes. It does scanlines, it does aperture masking, it does dot crawl, it does chroma subsampling, it does YIQ colorspace convolution, it does RGB colorspace convolution, it does pincushioning, it walks, it talks, it does the dishes, it'll screw your wife for you, and if you don't have a wife it will find one for you, get you married to her, and screw her for you, IT IS THAT GOOD, LADIES AND GENTLEMEN.
Primary: Simple passthrough for UI and artwork.
2011-05-16 09:55:34 -07:00
|
|
|
|
};
|
|
|
|
|
|
2013-08-29 18:05:13 -07:00
|
|
|
|
texture ShadowTexture;
|
Initial shader import (nw)
Focus: 8-sample blur that averages 7 samples around a center sample.
Phosphor: Not currently used, treated as a pass-through by drawd3d.c, but could be used to implement additional convolutions in a second pass.
Pincushion: Used (when commented in in drawd3d.c) to pincushion an entire full-screen texture but not otherwise apply any convolutions.
Post: The meat and potatoes. It does scanlines, it does aperture masking, it does dot crawl, it does chroma subsampling, it does YIQ colorspace convolution, it does RGB colorspace convolution, it does pincushioning, it walks, it talks, it does the dishes, it'll screw your wife for you, and if you don't have a wife it will find one for you, get you married to her, and screw her for you, IT IS THAT GOOD, LADIES AND GENTLEMEN.
Primary: Simple passthrough for UI and artwork.
2011-05-16 09:55:34 -07:00
|
|
|
|
|
|
|
|
|
sampler ShadowSampler = sampler_state
|
|
|
|
|
{
|
2015-05-03 05:41:05 -07:00
|
|
|
|
Texture = <ShadowTexture>;
|
2014-01-23 16:30:29 -08:00
|
|
|
|
MipFilter = LINEAR;
|
|
|
|
|
MinFilter = LINEAR;
|
|
|
|
|
MagFilter = LINEAR;
|
|
|
|
|
AddressU = WRAP;
|
|
|
|
|
AddressV = WRAP;
|
|
|
|
|
AddressW = WRAP;
|
Initial shader import (nw)
Focus: 8-sample blur that averages 7 samples around a center sample.
Phosphor: Not currently used, treated as a pass-through by drawd3d.c, but could be used to implement additional convolutions in a second pass.
Pincushion: Used (when commented in in drawd3d.c) to pincushion an entire full-screen texture but not otherwise apply any convolutions.
Post: The meat and potatoes. It does scanlines, it does aperture masking, it does dot crawl, it does chroma subsampling, it does YIQ colorspace convolution, it does RGB colorspace convolution, it does pincushioning, it walks, it talks, it does the dishes, it'll screw your wife for you, and if you don't have a wife it will find one for you, get you married to her, and screw her for you, IT IS THAT GOOD, LADIES AND GENTLEMEN.
Primary: Simple passthrough for UI and artwork.
2011-05-16 09:55:34 -07:00
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
|
// Vertex Definitions
|
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
|
|
2015-05-03 05:41:05 -07:00
|
|
|
|
struct VS_INPUT
|
Initial shader import (nw)
Focus: 8-sample blur that averages 7 samples around a center sample.
Phosphor: Not currently used, treated as a pass-through by drawd3d.c, but could be used to implement additional convolutions in a second pass.
Pincushion: Used (when commented in in drawd3d.c) to pincushion an entire full-screen texture but not otherwise apply any convolutions.
Post: The meat and potatoes. It does scanlines, it does aperture masking, it does dot crawl, it does chroma subsampling, it does YIQ colorspace convolution, it does RGB colorspace convolution, it does pincushioning, it walks, it talks, it does the dishes, it'll screw your wife for you, and if you don't have a wife it will find one for you, get you married to her, and screw her for you, IT IS THAT GOOD, LADIES AND GENTLEMEN.
Primary: Simple passthrough for UI and artwork.
2011-05-16 09:55:34 -07:00
|
|
|
|
{
|
2014-01-23 16:30:29 -08:00
|
|
|
|
float4 Position : POSITION;
|
|
|
|
|
float4 Color : COLOR0;
|
|
|
|
|
float2 TexCoord : TEXCOORD0;
|
Initial shader import (nw)
Focus: 8-sample blur that averages 7 samples around a center sample.
Phosphor: Not currently used, treated as a pass-through by drawd3d.c, but could be used to implement additional convolutions in a second pass.
Pincushion: Used (when commented in in drawd3d.c) to pincushion an entire full-screen texture but not otherwise apply any convolutions.
Post: The meat and potatoes. It does scanlines, it does aperture masking, it does dot crawl, it does chroma subsampling, it does YIQ colorspace convolution, it does RGB colorspace convolution, it does pincushioning, it walks, it talks, it does the dishes, it'll screw your wife for you, and if you don't have a wife it will find one for you, get you married to her, and screw her for you, IT IS THAT GOOD, LADIES AND GENTLEMEN.
Primary: Simple passthrough for UI and artwork.
2011-05-16 09:55:34 -07:00
|
|
|
|
};
|
|
|
|
|
|
2015-05-03 05:41:05 -07:00
|
|
|
|
struct VS_OUTPUT
|
Initial shader import (nw)
Focus: 8-sample blur that averages 7 samples around a center sample.
Phosphor: Not currently used, treated as a pass-through by drawd3d.c, but could be used to implement additional convolutions in a second pass.
Pincushion: Used (when commented in in drawd3d.c) to pincushion an entire full-screen texture but not otherwise apply any convolutions.
Post: The meat and potatoes. It does scanlines, it does aperture masking, it does dot crawl, it does chroma subsampling, it does YIQ colorspace convolution, it does RGB colorspace convolution, it does pincushioning, it walks, it talks, it does the dishes, it'll screw your wife for you, and if you don't have a wife it will find one for you, get you married to her, and screw her for you, IT IS THAT GOOD, LADIES AND GENTLEMEN.
Primary: Simple passthrough for UI and artwork.
2011-05-16 09:55:34 -07:00
|
|
|
|
{
|
2014-01-23 16:30:29 -08:00
|
|
|
|
float4 Position : POSITION;
|
|
|
|
|
float4 Color : COLOR0;
|
|
|
|
|
float2 TexCoord : TEXCOORD0;
|
2015-05-03 05:41:05 -07:00
|
|
|
|
float2 ScreenCoord : TEXCOORD1;
|
Initial shader import (nw)
Focus: 8-sample blur that averages 7 samples around a center sample.
Phosphor: Not currently used, treated as a pass-through by drawd3d.c, but could be used to implement additional convolutions in a second pass.
Pincushion: Used (when commented in in drawd3d.c) to pincushion an entire full-screen texture but not otherwise apply any convolutions.
Post: The meat and potatoes. It does scanlines, it does aperture masking, it does dot crawl, it does chroma subsampling, it does YIQ colorspace convolution, it does RGB colorspace convolution, it does pincushioning, it walks, it talks, it does the dishes, it'll screw your wife for you, and if you don't have a wife it will find one for you, get you married to her, and screw her for you, IT IS THAT GOOD, LADIES AND GENTLEMEN.
Primary: Simple passthrough for UI and artwork.
2011-05-16 09:55:34 -07:00
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
struct PS_INPUT
|
|
|
|
|
{
|
2014-01-23 16:30:29 -08:00
|
|
|
|
float4 Color : COLOR0;
|
|
|
|
|
float2 TexCoord : TEXCOORD0;
|
2015-05-03 05:41:05 -07:00
|
|
|
|
float2 ScreenCoord : TEXCOORD1;
|
Initial shader import (nw)
Focus: 8-sample blur that averages 7 samples around a center sample.
Phosphor: Not currently used, treated as a pass-through by drawd3d.c, but could be used to implement additional convolutions in a second pass.
Pincushion: Used (when commented in in drawd3d.c) to pincushion an entire full-screen texture but not otherwise apply any convolutions.
Post: The meat and potatoes. It does scanlines, it does aperture masking, it does dot crawl, it does chroma subsampling, it does YIQ colorspace convolution, it does RGB colorspace convolution, it does pincushioning, it walks, it talks, it does the dishes, it'll screw your wife for you, and if you don't have a wife it will find one for you, get you married to her, and screw her for you, IT IS THAT GOOD, LADIES AND GENTLEMEN.
Primary: Simple passthrough for UI and artwork.
2011-05-16 09:55:34 -07:00
|
|
|
|
};
|
|
|
|
|
|
2015-05-09 02:40:23 -07:00
|
|
|
|
bool xor(bool a, bool b)
|
|
|
|
|
{
|
|
|
|
|
return (a || b) && !(a && b);
|
|
|
|
|
}
|
|
|
|
|
|
Initial shader import (nw)
Focus: 8-sample blur that averages 7 samples around a center sample.
Phosphor: Not currently used, treated as a pass-through by drawd3d.c, but could be used to implement additional convolutions in a second pass.
Pincushion: Used (when commented in in drawd3d.c) to pincushion an entire full-screen texture but not otherwise apply any convolutions.
Post: The meat and potatoes. It does scanlines, it does aperture masking, it does dot crawl, it does chroma subsampling, it does YIQ colorspace convolution, it does RGB colorspace convolution, it does pincushioning, it walks, it talks, it does the dishes, it'll screw your wife for you, and if you don't have a wife it will find one for you, get you married to her, and screw her for you, IT IS THAT GOOD, LADIES AND GENTLEMEN.
Primary: Simple passthrough for UI and artwork.
2011-05-16 09:55:34 -07:00
|
|
|
|
//-----------------------------------------------------------------------------
|
2011-05-17 17:35:16 -07:00
|
|
|
|
// Scanline & Shadowmask Vertex Shader
|
Initial shader import (nw)
Focus: 8-sample blur that averages 7 samples around a center sample.
Phosphor: Not currently used, treated as a pass-through by drawd3d.c, but could be used to implement additional convolutions in a second pass.
Pincushion: Used (when commented in in drawd3d.c) to pincushion an entire full-screen texture but not otherwise apply any convolutions.
Post: The meat and potatoes. It does scanlines, it does aperture masking, it does dot crawl, it does chroma subsampling, it does YIQ colorspace convolution, it does RGB colorspace convolution, it does pincushioning, it walks, it talks, it does the dishes, it'll screw your wife for you, and if you don't have a wife it will find one for you, get you married to her, and screw her for you, IT IS THAT GOOD, LADIES AND GENTLEMEN.
Primary: Simple passthrough for UI and artwork.
2011-05-16 09:55:34 -07:00
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
|
|
2015-05-03 05:41:05 -07:00
|
|
|
|
uniform float2 ScreenDims; // size of the window or fullscreen
|
|
|
|
|
uniform float2 ScreenRatio = float2(1.0f, 3.0f / 4.0f);
|
|
|
|
|
|
|
|
|
|
uniform float2 SourceDims; // size of the texture in power-of-two size
|
|
|
|
|
uniform float2 SourceRect; // size of the uv rectangle
|
|
|
|
|
|
|
|
|
|
uniform float2 ShadowDims = float2(32.0f, 32.0f); // size of the shadow texture (extended to power-of-two size)
|
|
|
|
|
uniform float2 ShadowUVOffset = float2(0.0f, 0.0f);
|
|
|
|
|
|
|
|
|
|
uniform float2 Prescale = float2(8.0f, 8.0f);
|
|
|
|
|
|
2015-05-09 02:40:23 -07:00
|
|
|
|
uniform bool OrientationSwapXY = false; // false landscape, true portrait for default screen orientation
|
2015-05-09 02:51:06 -07:00
|
|
|
|
uniform bool RotationSwapXY = false; // swapped default screen orientation due to screen rotation
|
2015-07-12 14:28:38 -07:00
|
|
|
|
|
2015-05-03 05:41:05 -07:00
|
|
|
|
uniform bool PrepareBloom = false; // disables some effects for rendering bloom textures
|
2015-07-12 14:28:38 -07:00
|
|
|
|
uniform bool PrepareVector = false;
|
Initial shader import (nw)
Focus: 8-sample blur that averages 7 samples around a center sample.
Phosphor: Not currently used, treated as a pass-through by drawd3d.c, but could be used to implement additional convolutions in a second pass.
Pincushion: Used (when commented in in drawd3d.c) to pincushion an entire full-screen texture but not otherwise apply any convolutions.
Post: The meat and potatoes. It does scanlines, it does aperture masking, it does dot crawl, it does chroma subsampling, it does YIQ colorspace convolution, it does RGB colorspace convolution, it does pincushioning, it walks, it talks, it does the dishes, it'll screw your wife for you, and if you don't have a wife it will find one for you, get you married to her, and screw her for you, IT IS THAT GOOD, LADIES AND GENTLEMEN.
Primary: Simple passthrough for UI and artwork.
2011-05-16 09:55:34 -07:00
|
|
|
|
|
|
|
|
|
VS_OUTPUT vs_main(VS_INPUT Input)
|
|
|
|
|
{
|
2014-01-23 16:30:29 -08:00
|
|
|
|
VS_OUTPUT Output = (VS_OUTPUT)0;
|
2015-05-03 05:41:05 -07:00
|
|
|
|
|
2015-05-15 10:54:52 -07:00
|
|
|
|
float4 Position = Input.Position;
|
|
|
|
|
Position.xy *= (ScreenDims + 1.0f) / ScreenDims;
|
|
|
|
|
Position.xy -= 0.5f / ScreenDims;
|
|
|
|
|
|
2015-05-09 02:40:23 -07:00
|
|
|
|
float2 shadowUVOffset = ShadowUVOffset;
|
|
|
|
|
shadowUVOffset = xor(OrientationSwapXY, RotationSwapXY)
|
|
|
|
|
? shadowUVOffset.yx
|
|
|
|
|
: shadowUVOffset.xy;
|
2015-05-03 05:41:05 -07:00
|
|
|
|
|
|
|
|
|
// todo: calculate offset
|
|
|
|
|
float2 ScreenCoordPrescaleOffset = 0.0f;
|
2015-05-09 02:40:23 -07:00
|
|
|
|
ScreenCoordPrescaleOffset += shadowUVOffset;
|
2015-05-03 05:41:05 -07:00
|
|
|
|
|
2015-05-15 10:54:52 -07:00
|
|
|
|
Output.ScreenCoord = Position.xy;
|
2015-05-03 05:41:05 -07:00
|
|
|
|
Output.ScreenCoord += ScreenCoordPrescaleOffset;
|
|
|
|
|
|
2015-05-15 10:54:52 -07:00
|
|
|
|
Output.Position = float4(Position.xyz, 1.0f);
|
2014-01-23 16:30:29 -08:00
|
|
|
|
Output.Position.xy /= ScreenDims;
|
2015-05-03 05:41:05 -07:00
|
|
|
|
Output.Position.y = 1.0f - Output.Position.y; // flip y
|
|
|
|
|
Output.Position.xy -= 0.5f; // center
|
|
|
|
|
Output.Position.xy *= 2.0f; // zoom
|
|
|
|
|
|
2015-07-12 14:28:38 -07:00
|
|
|
|
Output.TexCoord = PrepareVector ? (Input.Position.xy / ScreenDims) : Input.TexCoord;
|
2015-05-03 05:41:05 -07:00
|
|
|
|
|
2014-01-23 16:30:29 -08:00
|
|
|
|
Output.Color = Input.Color;
|
|
|
|
|
|
|
|
|
|
return Output;
|
Initial shader import (nw)
Focus: 8-sample blur that averages 7 samples around a center sample.
Phosphor: Not currently used, treated as a pass-through by drawd3d.c, but could be used to implement additional convolutions in a second pass.
Pincushion: Used (when commented in in drawd3d.c) to pincushion an entire full-screen texture but not otherwise apply any convolutions.
Post: The meat and potatoes. It does scanlines, it does aperture masking, it does dot crawl, it does chroma subsampling, it does YIQ colorspace convolution, it does RGB colorspace convolution, it does pincushioning, it walks, it talks, it does the dishes, it'll screw your wife for you, and if you don't have a wife it will find one for you, get you married to her, and screw her for you, IT IS THAT GOOD, LADIES AND GENTLEMEN.
Primary: Simple passthrough for UI and artwork.
2011-05-16 09:55:34 -07:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
|
// Post-Processing Pixel Shader
|
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
|
|
2013-08-29 18:05:13 -07:00
|
|
|
|
uniform float ScanlineAlpha = 1.0f;
|
Initial shader import (nw)
Focus: 8-sample blur that averages 7 samples around a center sample.
Phosphor: Not currently used, treated as a pass-through by drawd3d.c, but could be used to implement additional convolutions in a second pass.
Pincushion: Used (when commented in in drawd3d.c) to pincushion an entire full-screen texture but not otherwise apply any convolutions.
Post: The meat and potatoes. It does scanlines, it does aperture masking, it does dot crawl, it does chroma subsampling, it does YIQ colorspace convolution, it does RGB colorspace convolution, it does pincushioning, it walks, it talks, it does the dishes, it'll screw your wife for you, and if you don't have a wife it will find one for you, get you married to her, and screw her for you, IT IS THAT GOOD, LADIES AND GENTLEMEN.
Primary: Simple passthrough for UI and artwork.
2011-05-16 09:55:34 -07:00
|
|
|
|
uniform float ScanlineScale = 1.0f;
|
|
|
|
|
uniform float ScanlineBrightScale = 1.0f;
|
|
|
|
|
uniform float ScanlineBrightOffset = 1.0f;
|
|
|
|
|
uniform float ScanlineOffset = 1.0f;
|
2015-05-03 05:41:05 -07:00
|
|
|
|
uniform float ScanlineHeight = 1.0f;
|
|
|
|
|
|
|
|
|
|
uniform float CurvatureAmount = 0.0f;
|
|
|
|
|
uniform float RoundCornerAmount = 0.0f;
|
|
|
|
|
uniform float VignettingAmount = 0.0f;
|
|
|
|
|
uniform float ReflectionAmount = 0.0f;
|
Initial shader import (nw)
Focus: 8-sample blur that averages 7 samples around a center sample.
Phosphor: Not currently used, treated as a pass-through by drawd3d.c, but could be used to implement additional convolutions in a second pass.
Pincushion: Used (when commented in in drawd3d.c) to pincushion an entire full-screen texture but not otherwise apply any convolutions.
Post: The meat and potatoes. It does scanlines, it does aperture masking, it does dot crawl, it does chroma subsampling, it does YIQ colorspace convolution, it does RGB colorspace convolution, it does pincushioning, it walks, it talks, it does the dishes, it'll screw your wife for you, and if you don't have a wife it will find one for you, get you married to her, and screw her for you, IT IS THAT GOOD, LADIES AND GENTLEMEN.
Primary: Simple passthrough for UI and artwork.
2011-05-16 09:55:34 -07:00
|
|
|
|
|
2013-08-29 18:05:13 -07:00
|
|
|
|
uniform float ShadowAlpha = 0.0f;
|
2015-05-03 05:41:05 -07:00
|
|
|
|
uniform float2 ShadowCount = float2(6.0f, 6.0f);
|
|
|
|
|
uniform float2 ShadowUV = float2(0.25f, 0.25f);
|
Initial shader import (nw)
Focus: 8-sample blur that averages 7 samples around a center sample.
Phosphor: Not currently used, treated as a pass-through by drawd3d.c, but could be used to implement additional convolutions in a second pass.
Pincushion: Used (when commented in in drawd3d.c) to pincushion an entire full-screen texture but not otherwise apply any convolutions.
Post: The meat and potatoes. It does scanlines, it does aperture masking, it does dot crawl, it does chroma subsampling, it does YIQ colorspace convolution, it does RGB colorspace convolution, it does pincushioning, it walks, it talks, it does the dishes, it'll screw your wife for you, and if you don't have a wife it will find one for you, get you married to her, and screw her for you, IT IS THAT GOOD, LADIES AND GENTLEMEN.
Primary: Simple passthrough for UI and artwork.
2011-05-16 09:55:34 -07:00
|
|
|
|
|
2011-06-11 16:46:24 -07:00
|
|
|
|
uniform float3 Power = float3(1.0f, 1.0f, 1.0f);
|
|
|
|
|
uniform float3 Floor = float3(0.0f, 0.0f, 0.0f);
|
2011-06-06 14:25:38 -07:00
|
|
|
|
|
2015-05-03 05:41:05 -07:00
|
|
|
|
static const float Epsilon = 1.0e-7f;
|
|
|
|
|
static const float PI = 3.1415927f;
|
|
|
|
|
static const float E = 2.7182817f;
|
|
|
|
|
static const float Gelfond = 23.140692f; // e^pi (Gelfond constant)
|
2015-05-15 10:54:52 -07:00
|
|
|
|
static const float GelfondSchneider = 2.6651442f; // 2^sqrt(2) (Gelfond–Schneider constant)
|
2015-05-03 05:41:05 -07:00
|
|
|
|
|
|
|
|
|
float nextPowerOfTwo(float n)
|
|
|
|
|
{
|
|
|
|
|
return pow(2, floor(log2(n) / log2(2)) + 1);
|
|
|
|
|
}
|
|
|
|
|
|
2015-05-10 06:05:19 -07:00
|
|
|
|
// www.stackoverflow.com/questions/5149544/can-i-generate-a-random-number-inside-a-pixel-shader/
|
2015-05-03 05:41:05 -07:00
|
|
|
|
float random(float2 seed)
|
|
|
|
|
{
|
|
|
|
|
// irrationals for pseudo randomness
|
|
|
|
|
float2 i = float2(Gelfond, GelfondSchneider);
|
|
|
|
|
|
|
|
|
|
return frac(cos(dot(seed, i)) * 123456.0f);
|
|
|
|
|
}
|
|
|
|
|
|
2015-05-10 06:05:19 -07:00
|
|
|
|
// www.dinodini.wordpress.com/2010/04/05/normalized-tunable-sigmoid-functions/
|
2015-05-03 05:41:05 -07:00
|
|
|
|
float normalizedSigmoid(float n, float k)
|
|
|
|
|
{
|
|
|
|
|
// valid for n and k in range of -1.0 and 1.0
|
|
|
|
|
return (n - n * k) / (k - abs(n) * 2.0f * k + 1);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
float GetNoiseFactor(float n, float random)
|
|
|
|
|
{
|
|
|
|
|
// smaller n become more noisy
|
|
|
|
|
return 1.0f + random * max(0.0f, 0.25f * pow(E, -4 * n));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
float GetVignetteFactor(float2 coord, float amount)
|
|
|
|
|
{
|
|
|
|
|
float2 VignetteCoord = coord;
|
|
|
|
|
|
2015-05-22 09:56:30 -07:00
|
|
|
|
float VignetteLength = length(VignetteCoord);
|
|
|
|
|
float VignetteBlur = (amount * 0.75f) + 0.25;
|
2015-05-03 05:41:05 -07:00
|
|
|
|
|
|
|
|
|
// 0.5 full screen fitting circle
|
2015-05-22 09:56:30 -07:00
|
|
|
|
float VignetteRadius = 1.0f - (amount * 0.25f);
|
|
|
|
|
float Vignette = smoothstep(VignetteRadius, VignetteRadius - VignetteBlur, VignetteLength);
|
2015-05-03 05:41:05 -07:00
|
|
|
|
|
|
|
|
|
return saturate(Vignette);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
float GetSpotAddend(float2 coord, float amount)
|
|
|
|
|
{
|
|
|
|
|
float2 SpotCoord = coord;
|
|
|
|
|
SpotCoord += OrientationSwapXY
|
|
|
|
|
? float2(-0.25f, -0.25f) * ScreenRatio // upper right quadrant
|
|
|
|
|
: float2(-0.25f, 0.25f) * ScreenRatio; // upper right quadrant
|
|
|
|
|
|
|
|
|
|
float SpotBlur = amount;
|
|
|
|
|
|
|
|
|
|
// 0.5 full screen fitting circle
|
|
|
|
|
float SpotRadius = amount * 0.75f;
|
|
|
|
|
float Spot = smoothstep(SpotRadius, SpotRadius - SpotBlur, length(SpotCoord));
|
|
|
|
|
|
|
|
|
|
float SigmoidSpot = normalizedSigmoid(Spot, 0.75) * amount;
|
|
|
|
|
|
|
|
|
|
// increase strength by 100%
|
|
|
|
|
SigmoidSpot = SigmoidSpot * 2.0f;
|
|
|
|
|
|
|
|
|
|
return saturate(SigmoidSpot);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// www.iquilezles.org/www/articles/distfunctions/distfunctions.htm
|
|
|
|
|
float RoundBox(float2 p, float2 b, float r)
|
|
|
|
|
{
|
|
|
|
|
return length(max(abs(p) - b + r, 0.0f)) - r;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
float GetRoundCornerFactor(float2 coord, float amount)
|
|
|
|
|
{
|
2015-05-24 08:23:38 -07:00
|
|
|
|
float2 SourceArea = 1.0f / SourceRect;
|
|
|
|
|
float2 SourceRes = SourceDims * SourceRect;
|
|
|
|
|
float2 SourceRatio = float2(1.0f, SourceRes.y / SourceRes.x);
|
2015-05-03 05:41:05 -07:00
|
|
|
|
float2 SourceTexelDims = 1.0f / SourceDims;
|
2015-05-24 08:23:38 -07:00
|
|
|
|
|
|
|
|
|
// base on the default ratio of 4:3
|
2015-05-24 08:46:34 -07:00
|
|
|
|
float2 RoundCoordScale = (SourceDims / SourceArea / SourceRatio) * ScreenRatio;
|
2015-05-03 05:41:05 -07:00
|
|
|
|
|
2015-05-15 10:54:52 -07:00
|
|
|
|
float2 RoundCoord = coord;
|
2015-05-24 08:23:38 -07:00
|
|
|
|
// hint: alignment correction
|
|
|
|
|
RoundCoord -= SourceTexelDims * SourceArea;
|
|
|
|
|
RoundCoord *= SourceTexelDims * SourceArea + 1.0f;
|
|
|
|
|
// hint: roundness correction
|
2015-05-24 08:46:34 -07:00
|
|
|
|
RoundCoord *= RoundCoordScale;
|
2015-05-03 05:41:05 -07:00
|
|
|
|
|
|
|
|
|
float radius = amount * 50.0f;
|
|
|
|
|
|
2015-05-24 08:23:38 -07:00
|
|
|
|
// compute box (base on the default ratio of 4:3)
|
2015-05-24 08:46:34 -07:00
|
|
|
|
float box = RoundBox(RoundCoord.xy, (RoundCoordScale * 0.5f), radius);
|
2015-05-03 05:41:05 -07:00
|
|
|
|
|
2015-05-24 08:23:38 -07:00
|
|
|
|
// // apply blur
|
|
|
|
|
// float blurAmount = 1.0f / max(1.0f, amount * 25.0f);
|
|
|
|
|
// float blueOffset = 1.0f - pow(blurAmount * 0.5f, 0.5f);
|
|
|
|
|
// box *= blurAmount;
|
|
|
|
|
// box += blueOffset;
|
2015-05-03 05:41:05 -07:00
|
|
|
|
|
2015-05-24 08:23:38 -07:00
|
|
|
|
float border = smoothstep(1.0f, 0.5f, box);
|
2015-05-03 05:41:05 -07:00
|
|
|
|
|
|
|
|
|
return saturate(border);
|
|
|
|
|
}
|
|
|
|
|
|
Initial shader import (nw)
Focus: 8-sample blur that averages 7 samples around a center sample.
Phosphor: Not currently used, treated as a pass-through by drawd3d.c, but could be used to implement additional convolutions in a second pass.
Pincushion: Used (when commented in in drawd3d.c) to pincushion an entire full-screen texture but not otherwise apply any convolutions.
Post: The meat and potatoes. It does scanlines, it does aperture masking, it does dot crawl, it does chroma subsampling, it does YIQ colorspace convolution, it does RGB colorspace convolution, it does pincushioning, it walks, it talks, it does the dishes, it'll screw your wife for you, and if you don't have a wife it will find one for you, get you married to her, and screw her for you, IT IS THAT GOOD, LADIES AND GENTLEMEN.
Primary: Simple passthrough for UI and artwork.
2011-05-16 09:55:34 -07:00
|
|
|
|
float4 ps_main(PS_INPUT Input) : COLOR
|
|
|
|
|
{
|
2015-05-03 05:41:05 -07:00
|
|
|
|
float2 ScreenTexelDims = 1.0f / ScreenDims;
|
2015-05-15 10:54:52 -07:00
|
|
|
|
float2 SourceTexelDims = 1.0f / SourceDims;
|
2015-05-09 02:40:23 -07:00
|
|
|
|
|
2015-05-24 08:23:38 -07:00
|
|
|
|
float2 SourceArea = 1.0f / SourceRect;
|
|
|
|
|
float2 HalfSourceRect = SourceRect * 0.5f;
|
2015-05-03 05:41:05 -07:00
|
|
|
|
|
|
|
|
|
// Screen Curvature
|
2015-05-10 06:05:19 -07:00
|
|
|
|
float2 CurvatureUnitCoord =
|
|
|
|
|
Input.TexCoord
|
2015-05-24 08:23:38 -07:00
|
|
|
|
* SourceArea * 2.0f -
|
2015-05-10 06:05:19 -07:00
|
|
|
|
1.0f;
|
2015-05-03 05:41:05 -07:00
|
|
|
|
float2 CurvatureCurve =
|
2015-05-09 02:40:23 -07:00
|
|
|
|
CurvatureUnitCoord
|
2015-05-10 06:05:19 -07:00
|
|
|
|
* pow(length(CurvatureUnitCoord), 2.0f)
|
2015-05-24 08:23:38 -07:00
|
|
|
|
/ pow(length(SourceArea), 2.0f)
|
2015-05-10 06:05:19 -07:00
|
|
|
|
* CurvatureAmount * 0.25f; // reduced curvature
|
|
|
|
|
float2 CurvatureZoom =
|
|
|
|
|
1.0f -
|
2015-05-24 08:23:38 -07:00
|
|
|
|
SourceArea * 2.0f
|
|
|
|
|
/ pow(length(SourceArea), 2.0f)
|
2015-05-10 06:05:19 -07:00
|
|
|
|
* CurvatureAmount * 0.25f; // reduced curvature
|
2015-05-03 05:41:05 -07:00
|
|
|
|
|
|
|
|
|
float2 ScreenCoord = Input.ScreenCoord / ScreenDims;
|
2015-05-24 08:23:38 -07:00
|
|
|
|
ScreenCoord -= HalfSourceRect;
|
2015-05-03 05:41:05 -07:00
|
|
|
|
ScreenCoord *= CurvatureZoom; // zoom
|
2015-05-24 08:23:38 -07:00
|
|
|
|
ScreenCoord += HalfSourceRect;
|
2015-05-03 05:41:05 -07:00
|
|
|
|
ScreenCoord += CurvatureCurve; // distortion
|
|
|
|
|
|
2014-01-23 16:30:29 -08:00
|
|
|
|
float2 BaseCoord = Input.TexCoord;
|
2015-05-24 08:23:38 -07:00
|
|
|
|
BaseCoord -= HalfSourceRect;
|
2015-05-03 05:41:05 -07:00
|
|
|
|
BaseCoord *= CurvatureZoom; // zoom
|
2015-05-24 08:23:38 -07:00
|
|
|
|
BaseCoord += HalfSourceRect;
|
2015-05-03 05:41:05 -07:00
|
|
|
|
BaseCoord += CurvatureCurve; // distortion
|
|
|
|
|
|
|
|
|
|
float2 BaseCoordCentered = Input.TexCoord;
|
2015-05-24 08:23:38 -07:00
|
|
|
|
BaseCoordCentered -= HalfSourceRect;
|
2015-05-03 05:41:05 -07:00
|
|
|
|
BaseCoordCentered *= CurvatureZoom; // zoom
|
|
|
|
|
BaseCoordCentered += CurvatureCurve; // distortion
|
|
|
|
|
|
2015-05-22 09:56:30 -07:00
|
|
|
|
float2 BaseAreaCoord = BaseCoord;
|
2015-05-24 08:23:38 -07:00
|
|
|
|
BaseAreaCoord *= SourceArea;
|
2015-05-03 05:41:05 -07:00
|
|
|
|
|
|
|
|
|
float2 BaseAreaCoordCentered = BaseCoordCentered;
|
2015-05-24 08:23:38 -07:00
|
|
|
|
BaseAreaCoordCentered *= SourceArea;
|
2015-05-03 05:41:05 -07:00
|
|
|
|
|
2015-05-22 09:56:30 -07:00
|
|
|
|
float2 BaseAreaRatioCoord = BaseAreaCoord;
|
|
|
|
|
BaseAreaRatioCoord *= ScreenRatio;
|
2015-05-03 05:41:05 -07:00
|
|
|
|
|
2015-05-22 09:56:30 -07:00
|
|
|
|
float2 BaseAreaRatioCoordCentered = BaseAreaCoordCentered;
|
|
|
|
|
BaseAreaRatioCoordCentered *= ScreenRatio;
|
2015-05-03 05:41:05 -07:00
|
|
|
|
|
2015-05-15 10:54:52 -07:00
|
|
|
|
// // Alpha Clipping (round corners applies smoother clipping when screen is curved)
|
|
|
|
|
// clip((BaseCoord < SourceTexelDims) ? -1 : 1);
|
|
|
|
|
// clip((BaseCoord > SourceRect + SourceTexelDims) ? -1 : 1);
|
2015-05-03 05:41:05 -07:00
|
|
|
|
|
|
|
|
|
float4 BaseColor = tex2D(DiffuseSampler, BaseCoord);
|
|
|
|
|
BaseColor.a = 1.0f;
|
|
|
|
|
|
|
|
|
|
// Vignetting Simulation (may affect bloom)
|
2015-05-22 09:56:30 -07:00
|
|
|
|
float2 VignetteCoord = BaseAreaCoordCentered;
|
2015-05-03 05:41:05 -07:00
|
|
|
|
|
|
|
|
|
float VignetteFactor = GetVignetteFactor(VignetteCoord, VignettingAmount);
|
|
|
|
|
BaseColor.rgb *= VignetteFactor;
|
|
|
|
|
|
|
|
|
|
// Mask Simulation (may not affect bloom)
|
|
|
|
|
if (!PrepareBloom)
|
|
|
|
|
{
|
2015-05-15 10:54:52 -07:00
|
|
|
|
float2 shadowDims = ShadowDims;
|
|
|
|
|
shadowDims = xor(OrientationSwapXY, RotationSwapXY)
|
|
|
|
|
? shadowDims.yx
|
|
|
|
|
: shadowDims.xy;
|
2015-05-09 02:40:23 -07:00
|
|
|
|
|
2015-05-03 05:41:05 -07:00
|
|
|
|
float2 shadowUV = ShadowUV;
|
2015-05-09 02:40:23 -07:00
|
|
|
|
// shadowUV = xor(OrientationSwapXY, RotationSwapXY)
|
|
|
|
|
// ? shadowUV.yx
|
|
|
|
|
// : shadowUV.xy;
|
|
|
|
|
|
2015-05-03 05:41:05 -07:00
|
|
|
|
float2 screenCoord = ScreenCoord;
|
2015-05-09 02:40:23 -07:00
|
|
|
|
screenCoord = xor(OrientationSwapXY, RotationSwapXY)
|
2015-05-03 05:41:05 -07:00
|
|
|
|
? screenCoord.yx
|
|
|
|
|
: screenCoord.xy;
|
2015-05-09 02:40:23 -07:00
|
|
|
|
|
|
|
|
|
float2 shadowCount = ShadowCount;
|
|
|
|
|
shadowCount = xor(OrientationSwapXY, RotationSwapXY)
|
|
|
|
|
? shadowCount.yx
|
|
|
|
|
: shadowCount.xy;
|
|
|
|
|
|
|
|
|
|
float2 shadowTile = (ScreenTexelDims * shadowCount);
|
|
|
|
|
shadowTile = xor(OrientationSwapXY, RotationSwapXY)
|
2015-05-03 05:41:05 -07:00
|
|
|
|
? shadowTile.yx
|
|
|
|
|
: shadowTile.xy;
|
|
|
|
|
|
|
|
|
|
float2 ShadowFrac = frac(screenCoord / shadowTile);
|
|
|
|
|
float2 ShadowCoord = (ShadowFrac * shadowUV);
|
2015-05-15 10:54:52 -07:00
|
|
|
|
ShadowCoord += 0.5f / shadowDims; // half texel offset
|
2015-05-09 02:40:23 -07:00
|
|
|
|
// ShadowCoord = xor(OrientationSwapXY, RotationSwapXY)
|
|
|
|
|
// ? ShadowCoord.yx
|
|
|
|
|
// : ShadowCoord.xy;
|
|
|
|
|
|
2015-05-03 05:41:05 -07:00
|
|
|
|
float3 ShadowColor = tex2D(ShadowSampler, ShadowCoord).rgb;
|
|
|
|
|
ShadowColor = lerp(1.0f, ShadowColor, ShadowAlpha);
|
|
|
|
|
|
|
|
|
|
BaseColor.rgb *= ShadowColor;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Color Compression (may not affect bloom)
|
|
|
|
|
if (!PrepareBloom)
|
|
|
|
|
{
|
|
|
|
|
// increasing the floor of the signal without affecting the ceiling
|
|
|
|
|
BaseColor.rgb = Floor + (1.0f - Floor) * BaseColor.rgb;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Color Power (may affect bloom)
|
|
|
|
|
BaseColor.r = pow(BaseColor.r, Power.r);
|
|
|
|
|
BaseColor.g = pow(BaseColor.g, Power.g);
|
|
|
|
|
BaseColor.b = pow(BaseColor.b, Power.b);
|
|
|
|
|
|
|
|
|
|
// Scanline Simulation (may not affect bloom)
|
|
|
|
|
if (!PrepareBloom)
|
|
|
|
|
{
|
|
|
|
|
// todo: there is an offset which can be noticed at lower prescale in high-resolution
|
|
|
|
|
float2 ScanlinePrescaleOffset = 0.0f;
|
2015-05-09 02:40:23 -07:00
|
|
|
|
|
2015-05-30 06:38:19 -07:00
|
|
|
|
float InnerSine = BaseCoord.y * ScanlineScale * SourceDims.y;
|
2015-05-03 05:41:05 -07:00
|
|
|
|
float ScanJitter = ScanlineOffset * SourceDims.y;
|
|
|
|
|
float ScanBrightMod = sin(InnerSine * PI + ScanJitter + ScanlinePrescaleOffset);
|
|
|
|
|
float3 ScanColor = lerp(1.0f, (pow(ScanBrightMod * ScanBrightMod, ScanlineHeight) * ScanlineBrightScale + 1.0f + ScanlineBrightOffset) * 0.5f, ScanlineAlpha);
|
|
|
|
|
|
|
|
|
|
BaseColor.rgb *= ScanColor;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Output
|
2015-07-12 14:28:38 -07:00
|
|
|
|
float4 Output = PrepareVector
|
|
|
|
|
? BaseColor * (Input.Color + float4(1.0f, 1.0f, 1.0f, 0.0f))
|
|
|
|
|
: BaseColor * Input.Color;
|
2014-01-23 16:30:29 -08:00
|
|
|
|
Output.a = 1.0f;
|
|
|
|
|
|
2015-05-03 05:41:05 -07:00
|
|
|
|
// Light Reflection Simulation (may not affect bloom)
|
|
|
|
|
if (!PrepareBloom)
|
|
|
|
|
{
|
|
|
|
|
float3 LightColor = float3(1.0f, 0.90f, 0.80f);
|
|
|
|
|
|
|
|
|
|
float2 SpotCoord = BaseAreaRatioCoordCentered;
|
|
|
|
|
float2 NoiseCoord = BaseAreaRatioCoordCentered;
|
|
|
|
|
|
|
|
|
|
float SpotAddend = GetSpotAddend(SpotCoord, ReflectionAmount);
|
|
|
|
|
float NoiseFactor = GetNoiseFactor(SpotAddend, random(NoiseCoord));
|
|
|
|
|
Output.rgb += SpotAddend * NoiseFactor * LightColor;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Round Corners Simulation (may affect bloom)
|
|
|
|
|
float2 RoundCornerCoord = BaseAreaCoordCentered;
|
|
|
|
|
|
|
|
|
|
float roundCornerFactor = GetRoundCornerFactor(RoundCornerCoord, RoundCornerAmount);
|
|
|
|
|
Output.rgb *= roundCornerFactor;
|
|
|
|
|
|
2014-01-23 16:30:29 -08:00
|
|
|
|
return Output;
|
Initial shader import (nw)
Focus: 8-sample blur that averages 7 samples around a center sample.
Phosphor: Not currently used, treated as a pass-through by drawd3d.c, but could be used to implement additional convolutions in a second pass.
Pincushion: Used (when commented in in drawd3d.c) to pincushion an entire full-screen texture but not otherwise apply any convolutions.
Post: The meat and potatoes. It does scanlines, it does aperture masking, it does dot crawl, it does chroma subsampling, it does YIQ colorspace convolution, it does RGB colorspace convolution, it does pincushioning, it walks, it talks, it does the dishes, it'll screw your wife for you, and if you don't have a wife it will find one for you, get you married to her, and screw her for you, IT IS THAT GOOD, LADIES AND GENTLEMEN.
Primary: Simple passthrough for UI and artwork.
2011-05-16 09:55:34 -07:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//-----------------------------------------------------------------------------
|
2011-05-17 17:35:16 -07:00
|
|
|
|
// Scanline & Shadowmask Effect
|
Initial shader import (nw)
Focus: 8-sample blur that averages 7 samples around a center sample.
Phosphor: Not currently used, treated as a pass-through by drawd3d.c, but could be used to implement additional convolutions in a second pass.
Pincushion: Used (when commented in in drawd3d.c) to pincushion an entire full-screen texture but not otherwise apply any convolutions.
Post: The meat and potatoes. It does scanlines, it does aperture masking, it does dot crawl, it does chroma subsampling, it does YIQ colorspace convolution, it does RGB colorspace convolution, it does pincushioning, it walks, it talks, it does the dishes, it'll screw your wife for you, and if you don't have a wife it will find one for you, get you married to her, and screw her for you, IT IS THAT GOOD, LADIES AND GENTLEMEN.
Primary: Simple passthrough for UI and artwork.
2011-05-16 09:55:34 -07:00
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
|
|
2011-05-17 17:35:16 -07:00
|
|
|
|
technique ScanMaskTechnique
|
Initial shader import (nw)
Focus: 8-sample blur that averages 7 samples around a center sample.
Phosphor: Not currently used, treated as a pass-through by drawd3d.c, but could be used to implement additional convolutions in a second pass.
Pincushion: Used (when commented in in drawd3d.c) to pincushion an entire full-screen texture but not otherwise apply any convolutions.
Post: The meat and potatoes. It does scanlines, it does aperture masking, it does dot crawl, it does chroma subsampling, it does YIQ colorspace convolution, it does RGB colorspace convolution, it does pincushioning, it walks, it talks, it does the dishes, it'll screw your wife for you, and if you don't have a wife it will find one for you, get you married to her, and screw her for you, IT IS THAT GOOD, LADIES AND GENTLEMEN.
Primary: Simple passthrough for UI and artwork.
2011-05-16 09:55:34 -07:00
|
|
|
|
{
|
2014-01-23 16:30:29 -08:00
|
|
|
|
pass Pass0
|
|
|
|
|
{
|
|
|
|
|
Lighting = FALSE;
|
Initial shader import (nw)
Focus: 8-sample blur that averages 7 samples around a center sample.
Phosphor: Not currently used, treated as a pass-through by drawd3d.c, but could be used to implement additional convolutions in a second pass.
Pincushion: Used (when commented in in drawd3d.c) to pincushion an entire full-screen texture but not otherwise apply any convolutions.
Post: The meat and potatoes. It does scanlines, it does aperture masking, it does dot crawl, it does chroma subsampling, it does YIQ colorspace convolution, it does RGB colorspace convolution, it does pincushioning, it walks, it talks, it does the dishes, it'll screw your wife for you, and if you don't have a wife it will find one for you, get you married to her, and screw her for you, IT IS THAT GOOD, LADIES AND GENTLEMEN.
Primary: Simple passthrough for UI and artwork.
2011-05-16 09:55:34 -07:00
|
|
|
|
|
2014-01-23 16:30:29 -08:00
|
|
|
|
//Sampler[0] = <DiffuseSampler>;
|
Initial shader import (nw)
Focus: 8-sample blur that averages 7 samples around a center sample.
Phosphor: Not currently used, treated as a pass-through by drawd3d.c, but could be used to implement additional convolutions in a second pass.
Pincushion: Used (when commented in in drawd3d.c) to pincushion an entire full-screen texture but not otherwise apply any convolutions.
Post: The meat and potatoes. It does scanlines, it does aperture masking, it does dot crawl, it does chroma subsampling, it does YIQ colorspace convolution, it does RGB colorspace convolution, it does pincushioning, it walks, it talks, it does the dishes, it'll screw your wife for you, and if you don't have a wife it will find one for you, get you married to her, and screw her for you, IT IS THAT GOOD, LADIES AND GENTLEMEN.
Primary: Simple passthrough for UI and artwork.
2011-05-16 09:55:34 -07:00
|
|
|
|
|
2014-01-23 16:30:29 -08:00
|
|
|
|
VertexShader = compile vs_3_0 vs_main();
|
2015-05-03 05:41:05 -07:00
|
|
|
|
PixelShader = compile ps_3_0 ps_main();
|
2014-01-23 16:30:29 -08:00
|
|
|
|
}
|
2015-05-03 05:41:05 -07:00
|
|
|
|
}
|