From 8721dae6e10a9bb74b557ef93d418a1ef09dd3c5 Mon Sep 17 00:00:00 2001 From: omegadox Date: Sun, 14 Jun 2009 08:56:13 +0000 Subject: [PATCH] More Shaders :), Fire2, Stereoscopic, toxic, christmas, and more... git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@3438 8ced0084-cf51-0410-be5f-012b33b47a6e --- Data/User/Shaders/acidmetal.txt | 5 +---- Data/User/Shaders/chrismas.txt | 19 +++++++++++++++++++ Data/User/Shaders/color_swap_1.txt | 10 +--------- Data/User/Shaders/cool1.txt | 22 ++++++++++++++++++++++ Data/User/Shaders/fire.txt | 18 ++++++++++++++++++ Data/User/Shaders/fire2.txt | 15 +++++++++++++++ Data/User/Shaders/nightvision.txt | 8 ++------ Data/User/Shaders/posterize.txt | 6 +++--- Data/User/Shaders/spookey1.txt | 20 ++++++++++++++++++++ Data/User/Shaders/spookey2.txt | 22 ++++++++++++++++++++++ Data/User/Shaders/stereoscopic.txt | 26 ++++++++++++++++++++++++++ Data/User/Shaders/toxic.txt | 22 ++++++++++++++++++++++ 12 files changed, 171 insertions(+), 22 deletions(-) create mode 100644 Data/User/Shaders/chrismas.txt create mode 100644 Data/User/Shaders/cool1.txt create mode 100644 Data/User/Shaders/fire2.txt create mode 100644 Data/User/Shaders/spookey1.txt create mode 100644 Data/User/Shaders/spookey2.txt create mode 100644 Data/User/Shaders/stereoscopic.txt create mode 100644 Data/User/Shaders/toxic.txt diff --git a/Data/User/Shaders/acidmetal.txt b/Data/User/Shaders/acidmetal.txt index 30e6a25ec5..7f479ca274 100644 --- a/Data/User/Shaders/acidmetal.txt +++ b/Data/User/Shaders/acidmetal.txt @@ -4,16 +4,13 @@ void main(out float4 ocol0 : COLOR0, in float2 uv0 : TEXCOORD0) { float4 c0 = texRECT(samp0, uv0).rgba; float red = 0.0; - float green = 0.0; float blue = 0.0; - green = c0.g; - if (c0.r > 0.25 && c0.b > 0.25) { blue = c0.b; red = c0.r; } - ocol0 = float4(red, green, blue, 1.0); + ocol0 = float4(red, c0.g, blue, 1.0); } \ No newline at end of file diff --git a/Data/User/Shaders/chrismas.txt b/Data/User/Shaders/chrismas.txt new file mode 100644 index 0000000000..6de668b2db --- /dev/null +++ b/Data/User/Shaders/chrismas.txt @@ -0,0 +1,19 @@ +uniform samplerRECT samp0 : register(s0); + +void main(out float4 ocol0 : COLOR0, in float2 uv0 : TEXCOORD0) +{ + float4 c0 = texRECT(samp0, uv0).rgba; + float red = 0.0; + float green = 0.0; + + if (c0.r < 0.50 || c0.b > 0.5) + { + green = c0.g + (c0.b / 2); + } + else + { + red = c0.r + (c0.b / 2); + } + + ocol0 = float4(red, green, 0.0, 1.0); +} \ No newline at end of file diff --git a/Data/User/Shaders/color_swap_1.txt b/Data/User/Shaders/color_swap_1.txt index 91e67d0361..68debd6837 100644 --- a/Data/User/Shaders/color_swap_1.txt +++ b/Data/User/Shaders/color_swap_1.txt @@ -3,13 +3,5 @@ uniform samplerRECT samp0 : register(s0); void main(out float4 ocol0 : COLOR0, in float2 uv0 : TEXCOORD0) { float4 c0 = texRECT(samp0, uv0).rgba; - float red = 0.0; - float green = 0.0; - float blue = 0.0; - - red = c0.g; - green = c0.b; - blue = c0.r; - - ocol0 = float4(red, green, blue, 1.0); + ocol0 = float4(c0.g, c0.b,c0.r, 1.0); } \ No newline at end of file diff --git a/Data/User/Shaders/cool1.txt b/Data/User/Shaders/cool1.txt new file mode 100644 index 0000000000..66de9c4d38 --- /dev/null +++ b/Data/User/Shaders/cool1.txt @@ -0,0 +1,22 @@ +uniform samplerRECT samp0 : register(s0); + +void main(out float4 ocol0 : COLOR0, in float2 uv0 : TEXCOORD0) +{ + float4 c0 = texRECT(samp0, uv0).rgba; + float red = 0.0; + float green = 0.0; + float blue = 0.0; + + if (c0.r < 0.50 || c0.b > 0.5) + { + blue = c0.r + (c0.b / 2); + red = c0.g + (c0.b / 2); + } + else + { + blue = c0.r + (c0.b / 2); + green = c0.r + (c0.b / 2); + } + + ocol0 = float4(red, green, blue, 1.0); +} \ No newline at end of file diff --git a/Data/User/Shaders/fire.txt b/Data/User/Shaders/fire.txt index fc6c897c92..6094307f40 100644 --- a/Data/User/Shaders/fire.txt +++ b/Data/User/Shaders/fire.txt @@ -8,6 +8,7 @@ void main(out float4 ocol0 : COLOR0, in float2 uv0 : TEXCOORD0) float blue = 0.0; red = c0.r; + if (c0.r > 0.0) { @@ -17,5 +18,22 @@ void main(out float4 ocol0 : COLOR0, in float2 uv0 : TEXCOORD0) } } + if (c0.b > 0.0 && c0.r < 0.25) + { + red = c0.b; + green = c0.b / 3; + } + + if (c0.g > 0.0 && c0.r < 0.25) + { + red = c0.g; + green = c0.g / 3; + } + + if (((c0.r + c0.g + c0.b) / 3) > 0.9) + { + green = c0.r / 3; + } + ocol0 = float4(red, green, blue, 1.0); } \ No newline at end of file diff --git a/Data/User/Shaders/fire2.txt b/Data/User/Shaders/fire2.txt new file mode 100644 index 0000000000..3f7c09e3db --- /dev/null +++ b/Data/User/Shaders/fire2.txt @@ -0,0 +1,15 @@ +uniform samplerRECT samp0 : register(s0); + +void main(out float4 ocol0 : COLOR0, in float2 uv0 : TEXCOORD0) +{ + float4 c0 = texRECT(samp0, uv0).rgba; + float red = 0.0; + float green = 0.0; + float blue = 0.0; + float avg = (c0.r + c0.g + c0.b) / 3; + + red = c0.r + (c0.g / 2) + (c0.b / 3); + green = c0.r / 3; + + ocol0 = float4(red, green, blue, 1.0); +} \ No newline at end of file diff --git a/Data/User/Shaders/nightvision.txt b/Data/User/Shaders/nightvision.txt index 5252a51ddb..db354d0b81 100644 --- a/Data/User/Shaders/nightvision.txt +++ b/Data/User/Shaders/nightvision.txt @@ -3,16 +3,12 @@ uniform samplerRECT samp0 : register(s0); void main(out float4 ocol0 : COLOR0, in float2 uv0 : TEXCOORD0) { float4 c0 = texRECT(samp0, uv0).rgba; - float red = 0.0; - float green = 0.0; - float blue = 0.0; - - green = c0.g; + float green = c0.g; if (c0.g < 0.50) { green = c0.r + c0.b; } - ocol0 = float4(red, green, blue, 1.0); + ocol0 = float4(0.0, green, 0.0, 1.0); } \ No newline at end of file diff --git a/Data/User/Shaders/posterize.txt b/Data/User/Shaders/posterize.txt index 54dca33034..fca009b145 100644 --- a/Data/User/Shaders/posterize.txt +++ b/Data/User/Shaders/posterize.txt @@ -3,9 +3,9 @@ uniform samplerRECT samp0 : register(s0); void main(out float4 ocol0 : COLOR0, in float2 uv0 : TEXCOORD0) { float4 c0 = texRECT(samp0, uv0).rgba; - float red; - float green; - float blue; + float red = 0.0; + float green = 0.0; + float blue = 0.0; if (c0.r > 0.25) { diff --git a/Data/User/Shaders/spookey1.txt b/Data/User/Shaders/spookey1.txt new file mode 100644 index 0000000000..f0cde83b55 --- /dev/null +++ b/Data/User/Shaders/spookey1.txt @@ -0,0 +1,20 @@ +uniform samplerRECT samp0 : register(s0); + +void main(out float4 ocol0 : COLOR0, in float2 uv0 : TEXCOORD0) +{ + float4 c0 = texRECT(samp0, uv0).rgba; + float red = 0.0; + float blue = 0.0; + + if (c0.r < 0.50 || c0.b > 0.5) + { + red = c0.g + (c0.b / 2); + } + else + { + red = c0.g + (c0.b / 2); + blue = c0.r + (c0.b / 2); + } + + ocol0 = float4(red, 0.0, blue, 1.0); +} \ No newline at end of file diff --git a/Data/User/Shaders/spookey2.txt b/Data/User/Shaders/spookey2.txt new file mode 100644 index 0000000000..747d236427 --- /dev/null +++ b/Data/User/Shaders/spookey2.txt @@ -0,0 +1,22 @@ +uniform samplerRECT samp0 : register(s0); + +void main(out float4 ocol0 : COLOR0, in float2 uv0 : TEXCOORD0) +{ + float4 c0 = texRECT(samp0, uv0).rgba; + float red = 0.0; + float green = 0.0; + float blue = 0.0; + + if (c0.r < 0.50 || c0.b > 0.5) + { + red = c0.g + (c0.b / 2); + } + else + { + red = c0.g + (c0.b / 2); + blue = c0.r + (c0.b / 2); + green = c0.r + (c0.b / 2); + } + + ocol0 = float4(red, green, blue, 1.0); +} \ No newline at end of file diff --git a/Data/User/Shaders/stereoscopic.txt b/Data/User/Shaders/stereoscopic.txt new file mode 100644 index 0000000000..81d6b79557 --- /dev/null +++ b/Data/User/Shaders/stereoscopic.txt @@ -0,0 +1,26 @@ +// Omega's 3D Stereoscopic filtering +// TODO: Need depth info! + +uniform samplerRECT samp0 : register(s0); + +void main(out float4 ocol0 : COLOR0, in float2 uv0 : TEXCOORD0) +{ + float sep = 5; + float4 c0 = texRECT(samp0, uv0).rgba; // Source Color + float red = c0.r; + float green = c0.g; + float blue = c0.b; + + // Red Eye (Red) + float4 c1 = texRECT(samp0, uv0 + float2(sep,0)).rgba; + red = max(c0.r, c1.r); + + // Right Eye (Cyan) + float4 c2 = texRECT(samp0, uv0 + float2(-sep,0)).rgba; + float cyan = (c2.r + c2.g + c2.b) / 3; + green = max(c0.g, cyan); + blue = max(c0.b, cyan); + + + ocol0 = float4(red, green, blue, c0.a); +} \ No newline at end of file diff --git a/Data/User/Shaders/toxic.txt b/Data/User/Shaders/toxic.txt new file mode 100644 index 0000000000..81205ed0f8 --- /dev/null +++ b/Data/User/Shaders/toxic.txt @@ -0,0 +1,22 @@ +uniform samplerRECT samp0 : register(s0); + +void main(out float4 ocol0 : COLOR0, in float2 uv0 : TEXCOORD0) +{ + float4 c0 = texRECT(samp0, uv0).rgba; + float red = 0.0; + float green = 0.0; + float blue = 0.0; + + if (c0.r < 0.50 || c0.b > 0.5) + { + blue = c0.r + (c0.b / 2); + red = c0.g + (c0.b / 2); + } + else + { + red = c0.g + (c0.b / 2); + green = c0.r + (c0.b / 2); + } + + ocol0 = float4(red, green, blue, 1.0); +} \ No newline at end of file