Change all the post processing shaders to the new system.

Removes the README.txt file in favour of a new wiki page I'm going to generate.
This commit is contained in:
Ryan Houdek 2014-07-29 12:08:57 -05:00
parent cced3b4a18
commit 32fe37d834
44 changed files with 206 additions and 479 deletions

View file

@ -1,10 +1,3 @@
SAMPLER_BINDING(9) uniform sampler2D samp9;
out vec4 ocol0;
in vec2 uv0;
uniform vec4 resolution;
void main()
{
//Change this number to increase the pixel size.
@ -14,9 +7,9 @@ void main()
float green = 0.0;
float blue = 0.0;
vec2 pos = floor(uv0 * resolution.xy / pixelSize) * pixelSize * resolution.zw;
float2 pos = floor(GetCoordinates() * GetResolution() / pixelSize) * pixelSize * GetInvResolution();
vec4 c0 = texture(samp9, pos);
float4 c0 = SampleLocation(pos);
if (c0.r < 0.1)
red = 0.1;
@ -57,5 +50,5 @@ void main()
else
green = 1.0;
ocol0 = vec4(red, green, blue, c0.a);
SetOutput(float4(red, green, blue, c0.a));
}

View file

@ -1,10 +1,3 @@
SAMPLER_BINDING(9) uniform sampler2D samp9;
out vec4 ocol0;
in vec2 uv0;
uniform vec4 resolution;
void main()
{
//Change this number to increase the pixel size.
@ -14,9 +7,9 @@ void main()
float green = 0.0;
float blue = 0.0;
vec2 pos = floor(uv0 * resolution.xy / pixelSize) * pixelSize * resolution.zw;
float2 pos = floor(GetCoordinates() * GetResolution() / pixelSize) * pixelSize * GetInvResolution();
vec4 c0 = texture(samp9, pos);
float4 c0 = SampleLocation(pos);
if (c0.r < 0.06)
red = 0.06;
@ -82,5 +75,5 @@ void main()
else
green = 1.0;
ocol0 = vec4(red, green, blue, c0.a);
SetOutput(float4(red, green, blue, c0.a));
}

View file

@ -12,26 +12,20 @@
// 0. You just DO WHAT THE FUCK YOU WANT TO.
SAMPLER_BINDING(9) uniform sampler2D samp9;
out vec4 ocol0;
in vec2 uv0;
uniform vec4 resolution;
#define FXAA_REDUCE_MIN (1.0/ 128.0)
#define FXAA_REDUCE_MUL (1.0 / 8.0)
#define FXAA_SPAN_MAX 8.0
vec4 applyFXAA(vec2 fragCoord, sampler2D tex)
float4 applyFXAA(float2 fragCoord)
{
vec4 color;
vec2 inverseVP = resolution.zw;
vec3 rgbNW = texture(tex, (fragCoord + vec2(-1.0, -1.0)) * inverseVP).xyz;
vec3 rgbNE = texture(tex, (fragCoord + vec2(1.0, -1.0)) * inverseVP).xyz;
vec3 rgbSW = texture(tex, (fragCoord + vec2(-1.0, 1.0)) * inverseVP).xyz;
vec3 rgbSE = texture(tex, (fragCoord + vec2(1.0, 1.0)) * inverseVP).xyz;
vec3 rgbM = texture(tex, fragCoord * inverseVP).xyz;
vec3 luma = vec3(0.299, 0.587, 0.114);
float4 color;
float2 inverseVP = GetInvResolution();
float3 rgbNW = SampleLocation((fragCoord + float2(-1.0, -1.0)) * inverseVP).xyz;
float3 rgbNE = SampleLocation((fragCoord + float2(1.0, -1.0)) * inverseVP).xyz;
float3 rgbSW = SampleLocation((fragCoord + float2(-1.0, 1.0)) * inverseVP).xyz;
float3 rgbSE = SampleLocation((fragCoord + float2(1.0, 1.0)) * inverseVP).xyz;
float3 rgbM = SampleLocation(fragCoord * inverseVP).xyz;
float3 luma = float3(0.299, 0.587, 0.114);
float lumaNW = dot(rgbNW, luma);
float lumaNE = dot(rgbNE, luma);
float lumaSW = dot(rgbSW, luma);
@ -39,8 +33,8 @@ vec4 applyFXAA(vec2 fragCoord, sampler2D tex)
float lumaM = dot(rgbM, luma);
float lumaMin = min(lumaM, min(min(lumaNW, lumaNE), min(lumaSW, lumaSE)));
float lumaMax = max(lumaM, max(max(lumaNW, lumaNE), max(lumaSW, lumaSE)));
vec2 dir;
float2 dir;
dir.x = -((lumaNW + lumaNE) - (lumaSW + lumaSE));
dir.y = ((lumaNW + lumaSW) - (lumaNE + lumaSE));
@ -48,26 +42,26 @@ vec4 applyFXAA(vec2 fragCoord, sampler2D tex)
(0.25 * FXAA_REDUCE_MUL), FXAA_REDUCE_MIN);
float rcpDirMin = 1.0 / (min(abs(dir.x), abs(dir.y)) + dirReduce);
dir = min(vec2(FXAA_SPAN_MAX, FXAA_SPAN_MAX),
max(vec2(-FXAA_SPAN_MAX, -FXAA_SPAN_MAX),
dir = min(float2(FXAA_SPAN_MAX, FXAA_SPAN_MAX),
max(float2(-FXAA_SPAN_MAX, -FXAA_SPAN_MAX),
dir * rcpDirMin)) * inverseVP;
vec3 rgbA = 0.5 * (
texture(tex, fragCoord * inverseVP + dir * (1.0 / 3.0 - 0.5)).xyz +
texture(tex, fragCoord * inverseVP + dir * (2.0 / 3.0 - 0.5)).xyz);
vec3 rgbB = rgbA * 0.5 + 0.25 * (
texture(tex, fragCoord * inverseVP + dir * -0.5).xyz +
texture(tex, fragCoord * inverseVP + dir * 0.5).xyz);
float3 rgbA = 0.5 * (
SampleLocation(fragCoord * inverseVP + dir * (1.0 / 3.0 - 0.5)).xyz +
SampleLocation(fragCoord * inverseVP + dir * (2.0 / 3.0 - 0.5)).xyz);
float3 rgbB = rgbA * 0.5 + 0.25 * (
SampleLocation(fragCoord * inverseVP + dir * -0.5).xyz +
SampleLocation(fragCoord * inverseVP + dir * 0.5).xyz);
float lumaB = dot(rgbB, luma);
if ((lumaB < lumaMin) || (lumaB > lumaMax))
color = vec4(rgbA, 1.0);
color = float4(rgbA, 1.0);
else
color = vec4(rgbB, 1.0);
color = float4(rgbB, 1.0);
return color;
}
void main()
{
ocol0 = applyFXAA(uv0 * resolution.xy, samp9);
SetOutput(applyFXAA(GetCoordinates() * GetResolution()));
}

View file

@ -1,18 +0,0 @@
//dummy shader:
SAMPLER_BINDING(9) uniform sampler2D samp9;
out vec4 ocol0;
in vec2 uv0;
void main()
{
ocol0 = texture(samp9, uv0);
}
/*
And now that's over with, the contents of this readme file!
For best results, turn Wordwrap formatting on...
The shaders shown in the dropdown box in the video plugin configuration window are kept in the directory named User/Data/Shaders. They are linked in to the dolphin source from the repository at <http://dolphin-shaders-database.googlecode.com/svn/trunk/>. See <http://code.google.com/p/dolphin-shaders-database/wiki/Documentation> for more details on the way shaders work.
This file will hopefully hold more content in future...
*/

View file

@ -1,11 +1,6 @@
SAMPLER_BINDING(9) uniform sampler2D samp9;
out vec4 ocol0;
in vec2 uv0;
void main()
{
vec4 c0 = texture(samp9, uv0);
float4 c0 = Sample();
float red = 0.0;
float blue = 0.0;
@ -17,5 +12,5 @@ void main()
float green = max(c0.r + c0.b, c0.g);
ocol0 = vec4(red, green, blue, 1.0);
SetOutput(float4(red, green, blue, 1.0));
}

View file

@ -1,11 +1,4 @@
SAMPLER_BINDING(9) uniform sampler2D samp9;
out vec4 ocol0;
in vec2 uv0;
uniform vec4 resolution;
void main()
{
ocol0 = (texture(samp9, uv0+resolution.zw) - texture(samp9, uv0-resolution.zw)) * 8.0;
SetOutput((SampleOffset(int2(1, 1)) - SampleOffset(int2(-1, -1))) * 8.0);
}

View file

@ -1,13 +1,6 @@
SAMPLER_BINDING(9) uniform sampler2D samp9;
out vec4 ocol0;
in vec2 uv0;
uniform vec4 resolution;
void main()
{
vec4 a = texture(samp9, uv0+resolution.zw);
vec4 b = texture(samp9, uv0-resolution.zw);
ocol0 = ( a*a*1.3 - b ) * 8.0;
float4 a = SampleOffset(int2( 1, 1));
float4 b = SampleOffset(int2(-1, -1));
SetOutput(( a*a*1.3 - b ) * 8.0);
}

View file

@ -1,48 +1,39 @@
// textures
SAMPLER_BINDING(8) uniform sampler2D samp8;
SAMPLER_BINDING(9) uniform sampler2D samp9;
const int char_width = 8;
const int char_height = 13;
const int char_count = 95;
const int char_pixels = char_width*char_height;
const vec2 char_dim = vec2(char_width, char_height);
const vec2 font_scale = vec2(1.0/float(char_width)/float(char_count), 1.0/float(char_height));
out vec4 ocol0;
in vec2 uv0;
uniform vec4 resolution;
const float2 char_dim = float2(char_width, char_height);
const float2 font_scale = float2(1.0/float(char_width)/float(char_count), 1.0/float(char_height));
void main()
{
vec2 char_pos = floor(uv0*resolution.xy/char_dim);
vec2 pixel_offset = floor(uv0*resolution.xy) - char_pos*char_dim;
float2 char_pos = floor(GetCoordinates()*GetResolution()/char_dim);
float2 pixel_offset = floor(GetCoordinates()*GetResolution()) - char_pos*char_dim;
// just a big number
float mindiff = float(char_width*char_height) * 100.0;
float minc = 0.0;
vec4 mina = vec4(0.0, 0.0, 0.0, 0.0);
vec4 minb = vec4(0.0, 0.0, 0.0, 0.0);
float4 mina = float4(0.0, 0.0, 0.0, 0.0);
float4 minb = float4(0.0, 0.0, 0.0, 0.0);
for (int i=0; i<char_count; i++)
{
vec4 ff = vec4(0.0, 0.0, 0.0, 0.0);
vec4 f = vec4(0.0, 0.0, 0.0, 0.0);
vec4 ft = vec4(0.0, 0.0, 0.0, 0.0);
vec4 t = vec4(0.0, 0.0, 0.0, 0.0);
vec4 tt = vec4(0.0, 0.0, 0.0, 0.0);
float4 ff = float4(0.0, 0.0, 0.0, 0.0);
float4 f = float4(0.0, 0.0, 0.0, 0.0);
float4 ft = float4(0.0, 0.0, 0.0, 0.0);
float4 t = float4(0.0, 0.0, 0.0, 0.0);
float4 tt = float4(0.0, 0.0, 0.0, 0.0);
for (int x=0; x<char_width; x++)
{
for (int y=0; y<char_height; y++)
{
vec2 tex_pos = char_pos*char_dim + vec2(x,y) + 0.5;
vec4 tex = texture(samp9, tex_pos * resolution.zw);
float2 tex_pos = char_pos*char_dim + float2(x,y) + 0.5;
float4 tex = SampleLocation(tex_pos * GetInvResolution());
vec2 font_pos = vec2(x+i*char_width, y) + 0.5;
vec4 font = texture(samp8, font_pos * font_scale);
float2 font_pos = float2(x+i*char_width, y) + 0.5;
float4 font = SampleFontLocation(font_pos * font_scale);
// generates sum of texture and font and their squares
ff += font*font;
@ -63,7 +54,7 @@ void main()
// In the next steps, "a" is the font color, "b" is the background color, "f" is the font value at this pixel, "t" is the texture value
// So the square error of one pixel is:
// So the square error of one pixel is:
// e = ( t - a⋅f - b⋅(1-f) ) ^ 2
// In longer:
@ -78,11 +69,11 @@ void main()
// So, both equations must be zero at minimum and there is only one solution.
vec4 a = (f*ft - ff*t + f*t - ft*float(char_pixels)) / (f*f - ff*float(char_pixels));
vec4 b = (f*ft - ff*t) / (f*f - ff*float(char_pixels));
float4 a = (f*ft - ff*t + f*t - ft*float(char_pixels)) / (f*f - ff*float(char_pixels));
float4 b = (f*ft - ff*t) / (f*f - ff*float(char_pixels));
vec4 diff = a*a*ff + 2.0*a*b*f - 2.0*a*b*ff - 2.0*a*ft + b*b *(-2.0*f + ff + float(char_pixels)) + 2.0*b*ft - 2.0*b*t + tt;
float diff_f = dot(diff, vec4(1.0, 1.0, 1.0, 1.0));
float4 diff = a*a*ff + 2.0*a*b*f - 2.0*a*b*ff - 2.0*a*ft + b*b *(-2.0*f + ff + float(char_pixels)) + 2.0*b*ft - 2.0*b*t + tt;
float diff_f = dot(diff, float4(1.0, 1.0, 1.0, 1.0));
if (diff_f < mindiff)
{
@ -93,8 +84,8 @@ void main()
}
}
vec2 font_pos_res = vec2(minc * float(char_width), 0.0) + pixel_offset + 0.5;
float2 font_pos_res = float2(minc * float(char_width), 0.0) + pixel_offset + 0.5;
vec4 col = texture(samp8, font_pos_res * font_scale);
ocol0 = mina * col + minb * (vec4(1.0,1.0,1.0,1.0) - col);
float4 col = SampleFontLocation(font_pos_res * font_scale);
SetOutput(mina * col + minb * (float4(1.0,1.0,1.0,1.0) - col));
}

View file

@ -1,22 +1,15 @@
SAMPLER_BINDING(9) uniform sampler2D samp9;
out vec4 ocol0;
in vec2 uv0;
uniform vec4 resolution;
void main()
{
vec4 to_gray = vec4(0.3,0.59,0.11,0);
float4 to_gray = float4(0.3,0.59,0.11,0);
float x1 = dot(to_gray, texture(samp9, uv0+vec2(1,1)*resolution.zw));
float x0 = dot(to_gray, texture(samp9, uv0+vec2(-1,-1)*resolution.zw));
float x3 = dot(to_gray, texture(samp9, uv0+vec2(1,-1)*resolution.zw));
float x2 = dot(to_gray, texture(samp9, uv0+vec2(-1,1)*resolution.zw));
float x1 = dot(to_gray, SampleOffset(int2( 1, 1)));
float x0 = dot(to_gray, SampleOffset(int2(-1,-1)));
float x3 = dot(to_gray, SampleOffset(int2( 1,-1)));
float x2 = dot(to_gray, SampleOffset(int2(-1, 1)));
float edge = (x1 - x0) * (x1 - x0) + (x3 - x2) * (x3 - x2);
float4 color = texture(samp9, uv0).rgba;
float4 color = Sample();
ocol0 = color - vec4(edge, edge, edge, edge) * 12.0;
SetOutput(color - float4(edge, edge, edge, edge) * 12.0);
}

View file

@ -1,23 +1,15 @@
SAMPLER_BINDING(9) uniform sampler2D samp9;
out vec4 ocol0;
in vec2 uv0;
uniform vec4 resolution;
void main()
{
//Changethis to increase the number of colors.
int numColors =8;
float4 to_gray = float4(0.3,0.59,0.11,0);
float x1 = dot(to_gray, texture(samp9, uv0+vec2(1,1)*resolution.zw));
float x0 = dot(to_gray, texture(samp9, uv0+vec2(-1,-1)*resolution.zw));
float x3 = dot(to_gray, texture(samp9, uv0+vec2(1,-1)*resolution.zw));
float x2 = dot(to_gray, texture(samp9, uv0+vec2(-1,1)*resolution.zw));
float x1 = dot(to_gray, SampleOffset(int2( 1, 1)));
float x0 = dot(to_gray, SampleOffset(int2(-1,-1)));
float x3 = dot(to_gray, SampleOffset(int2( 1,-1)));
float x2 = dot(to_gray, SampleOffset(int2(-1, 1)));
float edge = (x1 - x0) * (x1 - x0) + (x3 - x2) * (x3 - x2);
float4 color = texture(samp9, uv0).rgba;
float4 color = Sample();
float4 c0 = color - float4(edge, edge, edge, edge) * 12.0;
@ -66,7 +58,7 @@ void main()
blue = 0.95;
else
blue = colorN ;
bb = true;
}
@ -92,5 +84,5 @@ void main()
break;
}
ocol0 = float4(red, green, blue, c0.a);
SetOutput(float4(red, green, blue, c0.a));
}

View file

@ -1,43 +1,36 @@
SAMPLER_BINDING(9) uniform sampler2D samp9;
out vec4 ocol0;
in vec2 uv0;
uniform vec4 resolution;
void main()
{
float4 c_center = texture(samp9, uv0);
float4 c_center = Sample();
float4 bloom_sum = float4(0.0, 0.0, 0.0, 0.0);
vec2 pos = uv0 + float2(0.3, 0.3) * resolution.zw;
float2 radius1 = 1.3 * resolution.zw;
bloom_sum += texture(samp9, pos + float2(-1.5, -1.5) * radius1);
bloom_sum += texture(samp9, pos + float2(-2.5, 0.0) * radius1);
bloom_sum += texture(samp9, pos + float2(-1.5, 1.5) * radius1);
bloom_sum += texture(samp9, pos + float2(0.0, 2.5) * radius1);
bloom_sum += texture(samp9, pos + float2(1.5, 1.5) * radius1);
bloom_sum += texture(samp9, pos + float2(2.5, 0.0) * radius1);
bloom_sum += texture(samp9, pos + float2(1.5, -1.5) * radius1);
bloom_sum += texture(samp9, pos + float2(0.0, -2.5) * radius1);
float2 pos = GetCoordinates() + float2(0.3, 0.3) * GetInvResolution();
float2 radius1 = 1.3 * GetInvResolution();
bloom_sum += SampleLocation(pos + float2(-1.5, -1.5) * radius1);
bloom_sum += SampleLocation(pos + float2(-2.5, 0.0) * radius1);
bloom_sum += SampleLocation(pos + float2(-1.5, 1.5) * radius1);
bloom_sum += SampleLocation(pos + float2(0.0, 2.5) * radius1);
bloom_sum += SampleLocation(pos + float2(1.5, 1.5) * radius1);
bloom_sum += SampleLocation(pos + float2(2.5, 0.0) * radius1);
bloom_sum += SampleLocation(pos + float2(1.5, -1.5) * radius1);
bloom_sum += SampleLocation(pos + float2(0.0, -2.5) * radius1);
float2 radius2 = 4.6 * resolution.zw;
bloom_sum += texture(samp9, pos + float2(-1.5, -1.5) * radius2);
bloom_sum += texture(samp9, pos + float2(-2.5, 0.0) * radius2);
bloom_sum += texture(samp9, pos + float2(-1.5, 1.5) * radius2);
bloom_sum += texture(samp9, pos + float2(0.0, 2.5) * radius2);
bloom_sum += texture(samp9, pos + float2(1.5, 1.5) * radius2);
bloom_sum += texture(samp9, pos + float2(2.5, 0.0) * radius2);
bloom_sum += texture(samp9, pos + float2(1.5, -1.5) * radius2);
bloom_sum += texture(samp9, pos + float2(0.0, -2.5) * radius2);
float2 radius2 = 4.6 * GetInvResolution();
bloom_sum += SampleLocation(pos + float2(-1.5, -1.5) * radius2);
bloom_sum += SampleLocation(pos + float2(-2.5, 0.0) * radius2);
bloom_sum += SampleLocation(pos + float2(-1.5, 1.5) * radius2);
bloom_sum += SampleLocation(pos + float2(0.0, 2.5) * radius2);
bloom_sum += SampleLocation(pos + float2(1.5, 1.5) * radius2);
bloom_sum += SampleLocation(pos + float2(2.5, 0.0) * radius2);
bloom_sum += SampleLocation(pos + float2(1.5, -1.5) * radius2);
bloom_sum += SampleLocation(pos + float2(0.0, -2.5) * radius2);
bloom_sum *= 0.07;
bloom_sum -= float4(0.3, 0.3, 0.3, 0.3);
bloom_sum = max(bloom_sum, float4(0.0, 0.0, 0.0, 0.0));
float2 vpos = (uv0 - float2(0.5, 0.5)) * 2.0;
float2 vpos = (GetCoordinates() - float2(0.5, 0.5)) * 2.0;
float dist = (dot(vpos, vpos));
dist = 1.0 - 0.4*dist;
ocol0 = (c_center * 0.7 + bloom_sum) * dist;
SetOutput((c_center * 0.7 + bloom_sum) * dist);
}

View file

@ -1,9 +1,4 @@
SAMPLER_BINDING(9) uniform sampler2D samp9;
out vec4 ocol0;
in vec2 uv0;
void main()
{
ocol0 = texture(samp9, uv0) * 3.0;
SetOutput(Sample()* 3.0);
}

View file

@ -1,11 +1,6 @@
SAMPLER_BINDING(9) uniform sampler2D samp9;
out vec4 ocol0;
in vec2 uv0;
void main()
{
vec4 c0 = texture(samp9, uv0);
float4 c0 = Sample();
float red = 0.0;
float green = 0.0;
@ -14,5 +9,5 @@ void main()
else
red = c0.r + 0.4;
ocol0 = vec4(red, green, 0.0, 1.0);
SetOutput(float4(red, green, 0.0, 1.0));
}

View file

@ -1,11 +1,6 @@
SAMPLER_BINDING(9) uniform sampler2D samp9;
out vec4 ocol0;
in vec2 uv0;
void main()
{
vec4 c0 = texture(samp9, uv0);
float4 c0 = Sample();
float red = 0.0;
float green = 0.0;
float blue = 0.0;
@ -21,5 +16,5 @@ void main()
green = c0.r;
}
ocol0 = vec4(red, green, blue, 1.0);
SetOutput(float4(red, green, blue, 1.0));
}

View file

@ -1,17 +1,10 @@
SAMPLER_BINDING(9) uniform sampler2D samp9;
out vec4 ocol0;
in vec2 uv0;
uniform vec4 resolution;
void main()
{
float4 c0 = texture(samp9, uv0);
float4 c1 = texture(samp9, uv0 - float2(1.0, 0.0) * resolution.zw);
float4 c2 = texture(samp9, uv0 - float2(0.0, 1.0) * resolution.zw);
float4 c3 = texture(samp9, uv0 + float2(1.0, 0.0) * resolution.zw);
float4 c4 = texture(samp9, uv0 + float2(0.0, 1.0) * resolution.zw);
float4 c0 = Sample();
float4 c1 = SampleOffset(int2(-1, 0));
float4 c2 = SampleOffset(int2( 0, -1));
float4 c3 = SampleOffset(int2( 1, 0));
float4 c4 = SampleOffset(int2( 0, 1));
float red = c0.r;
float blue = c0.b;
@ -36,5 +29,5 @@ void main()
else
blue = c0.b - c0.b / 2.0;
ocol0 = float4(red, green, blue, c0.a);
SetOutput(float4(red, green, blue, c0.a));
}

View file

@ -1,24 +1,17 @@
SAMPLER_BINDING(9) uniform sampler2D samp9;
out vec4 ocol0;
in vec2 uv0;
uniform vec4 resolution;
void main()
{
float4 c0 = texture(samp9, uv0).rgba;
float4 c1 = texture(samp9, uv0 + float2(5.0,5.0)*resolution.zw).rgba;
float y = (0.222 * c1.r) + (0.707 * c1.g) + (0.071 * c1.b);
float y2 = ((0.222 * c0.r) + (0.707 * c0.g) + (0.071 * c0.b)) / 3.0;
float red = c0.r;
float green = c0.g;
float blue = c0.b;
float alpha = c0.a;
float4 c0 = Sample();
float4 c1 = SampleOffset(int2(5, 5));
float y = (0.222 * c1.r) + (0.707 * c1.g) + (0.071 * c1.b);
float y2 = ((0.222 * c0.r) + (0.707 * c0.g) + (0.071 * c0.b)) / 3.0;
float red = c0.r;
float green = c0.g;
float blue = c0.b;
float alpha = c0.a;
red = y2 + (1.0 - y);
green = y2 + (1.0 - y);
blue = y2 + (1.0 - y);
ocol0 = float4(red, green, blue, alpha);
SetOutput(float4(red, green, blue, alpha));
}

View file

@ -1,11 +1,6 @@
SAMPLER_BINDING(9) uniform sampler2D samp9;
out vec4 ocol0;
in vec2 uv0;
void main()
{
vec4 c0 = texture(samp9, uv0);
float4 c0 = Sample();
float red = 0.0;
float green = 0.0;
float blue = 0.0;
@ -30,5 +25,5 @@ void main()
if (((c0.r + c0.g + c0.b) / 3.0) > 0.9)
green = c0.r / 3.0;
ocol0 = vec4(red, green, blue, 1.0);
SetOutput(float4(red, green, blue, 1.0));
}

View file

@ -1,11 +1,6 @@
SAMPLER_BINDING(9) uniform sampler2D samp9;
out vec4 ocol0;
in vec2 uv0;
void main()
{
vec4 c0 = texture(samp9, uv0);
float4 c0 = Sample();
float red = 0.0;
float green = 0.0;
float blue = 0.0;
@ -14,5 +9,5 @@ void main()
red = c0.r + (c0.g / 2.0) + (c0.b / 3.0);
green = c0.r / 3.0;
ocol0 = vec4(red, green, blue, 1.0);
SetOutput(float4(red, green, blue, 1.0));
}

View file

@ -1,15 +1,8 @@
SAMPLER_BINDING(9) uniform sampler2D samp9;
out vec4 ocol0;
in vec2 uv0;
uniform vec4 resolution;
void main()
{
float4 c0 = texture(samp9, uv0);
float4 c1 = texture(samp9, uv0 + float2(1,1)*resolution.zw);
float4 c2 = texture(samp9, uv0 + float2(-1,-1)*resolution.zw);
float4 c0 = Sample();
float4 c1 = SampleOffset(int2( 1, 1));
float4 c2 = SampleOffset(int2(-1, -1));
float red = c0.r;
float green = c0.g;
float blue = c0.b;
@ -18,5 +11,5 @@ void main()
red = c0.r - c1.b;
blue = c0.b - c2.r + (c0.g - c0.r);
ocol0 = float4(red, 0.0, blue, alpha);
SetOutput(float4(red, 0.0, blue, alpha));
}

View file

@ -1,11 +1,6 @@
SAMPLER_BINDING(9) uniform sampler2D samp9;
out vec4 ocol0;
in vec2 uv0;
void main()
{
vec4 c0 = texture(samp9, uv0);
float4 c0 = Sample();
float avg = (c0.r + c0.g + c0.b) / 3.0;
ocol0 = vec4(avg, avg, avg, c0.a);
SetOutput(float4(avg, avg, avg, c0.a));
}

View file

@ -1,12 +1,7 @@
SAMPLER_BINDING(9) uniform sampler2D samp9;
out vec4 ocol0;
in vec2 uv0;
void main()
{
vec4 c0 = texture(samp9, uv0);
float4 c0 = Sample();
// Info: http://www.oreillynet.com/cs/user/view/cs_msg/8691
float avg = (0.222 * c0.r) + (0.707 * c0.g) + (0.071 * c0.b);
ocol0 = vec4(avg, avg, avg, c0.a);
SetOutput(float4(avg, avg, avg, c0.a));
}

View file

@ -1,9 +1,4 @@
SAMPLER_BINDING(9) uniform sampler2D samp9;
out vec4 ocol0;
in vec2 uv0;
void main()
{
ocol0 = vec4(1.0, 1.0, 1.0, 1.0) - texture(samp9, uv0);
SetOutput(float4(1.0, 1.0, 1.0, 1.0) - Sample());
}

View file

@ -1,9 +1,4 @@
SAMPLER_BINDING(9) uniform sampler2D samp9;
out vec4 ocol0;
in vec2 uv0;
void main()
{
ocol0 = vec4(0.0, 0.0, 0.7, 1.0) - texture(samp9, uv0);
SetOutput(float4(0.0, 0.0, 0.7, 1.0) - Sample());
}

View file

@ -1,14 +1,7 @@
SAMPLER_BINDING(9) uniform sampler2D samp9;
out vec4 ocol0;
in vec2 uv0;
uniform vec4 resolution;
void main()
{
float4 c0 = texture(samp9, uv0);
float4 c1 = texture(samp9, uv0 + float2(5,5)*resolution.zw);
float4 c0 = Sample();
float4 c1 = SampleOffset(int2(5, 5));
ocol0 = c0 - c1;
SetOutput(c0 - c1);
}

View file

@ -1,26 +1,19 @@
SAMPLER_BINDING(9) uniform sampler2D samp9;
out vec4 ocol0;
in vec2 uv0;
uniform vec4 resolution;
void main()
{
float4 emboss = (texture(samp9, uv0+resolution.zw) - texture(samp9, uv0-resolution.zw))*2.0;
emboss -= (texture(samp9, uv0+float2(1,-1)*resolution.zw).rgba - texture(samp9, uv0+float2(-1,1)*resolution.zw).rgba);
float4 color = texture(samp9, uv0).rgba;
float4 emboss = (SampleLocation(GetCoordinates()+GetInvResolution()) - SampleLocation(GetCoordinates()-GetInvResolution()))*2.0;
emboss -= (SampleLocation(GetCoordinates()+float2(1,-1)*GetInvResolution()).rgba - SampleLocation(GetCoordinates()+float2(-1,1)*GetInvResolution()).rgba);
float4 color = Sample();
if (color.r > 0.8 && color.b + color.b < 0.2)
{
ocol0 = float4(1,0,0,0);
SetOutput(float4(1,0,0,0));
}
else
{
color += emboss;
if (dot(color.rgb, float3(0.3, 0.5, 0.2)) > 0.5)
ocol0 = float4(1,1,1,1);
SetOutput(float4(1,1,1,1));
else
ocol0 = float4(0,0,0,0);
SetOutput(float4(0,0,0,0));
}
}

View file

@ -1,15 +1,10 @@
SAMPLER_BINDING(9) uniform sampler2D samp9;
out vec4 ocol0;
in vec2 uv0;
void main()
{
float4 c0 = texture(samp9, uv0).rgba;
float4 c0 = Sample();
float green = c0.g;
if (c0.g < 0.50)
green = c0.r + c0.b;
ocol0 = float4(0.0, green, 0.0, 1.0);
SetOutput(float4(0.0, green, 0.0, 1.0));
}

View file

@ -1,27 +1,20 @@
SAMPLER_BINDING(9) uniform sampler2D samp9;
out vec4 ocol0;
in vec2 uv0;
uniform vec4 resolution;
void main()
{
//variables
float internalresolution = 1278.0;
float4 c0 = texture(samp9, uv0).rgba;
float4 c0 = Sample();
//blur
float4 blurtotal = float4(0.0, 0.0, 0.0, 0.0);
float blursize = 1.5;
blurtotal += texture(samp9, uv0 + float2(-blursize, -blursize) * resolution.zw);
blurtotal += texture(samp9, uv0 + float2(-blursize, blursize) * resolution.zw);
blurtotal += texture(samp9, uv0 + float2( blursize, -blursize) * resolution.zw);
blurtotal += texture(samp9, uv0 + float2( blursize, blursize) * resolution.zw);
blurtotal += texture(samp9, uv0 + float2(-blursize, 0.0) * resolution.zw);
blurtotal += texture(samp9, uv0 + float2( blursize, 0.0) * resolution.zw);
blurtotal += texture(samp9, uv0 + float2( 0.0, -blursize) * resolution.zw);
blurtotal += texture(samp9, uv0 + float2( 0.0, blursize) * resolution.zw);
blurtotal += SampleLocation(GetCoordinates() + float2(-blursize, -blursize) * GetInvResolution());
blurtotal += SampleLocation(GetCoordinates() + float2(-blursize, blursize) * GetInvResolution());
blurtotal += SampleLocation(GetCoordinates() + float2( blursize, -blursize) * GetInvResolution());
blurtotal += SampleLocation(GetCoordinates() + float2( blursize, blursize) * GetInvResolution());
blurtotal += SampleLocation(GetCoordinates() + float2(-blursize, 0.0) * GetInvResolution());
blurtotal += SampleLocation(GetCoordinates() + float2( blursize, 0.0) * GetInvResolution());
blurtotal += SampleLocation(GetCoordinates() + float2( 0.0, -blursize) * GetInvResolution());
blurtotal += SampleLocation(GetCoordinates() + float2( 0.0, blursize) * GetInvResolution());
blurtotal *= 0.125;
c0 = blurtotal;
@ -32,8 +25,8 @@ void main()
grey = grey * 0.5 + 0.7;
// darken edges
float x = uv0.x * resolution.x;
float y = uv0.y * resolution.y;
float x = GetCoordinates().x * GetResolution().x;
float y = GetCoordinates().y * GetResolution().y;
if (x > internalresolution/2.0)
x = internalresolution-x;
if (y > internalresolution/2.0)
@ -65,5 +58,5 @@ void main()
grey -= y / 200.0;
// output
ocol0 = float4(0.0, grey, 0.0, 1.0);
SetOutput(float4(0.0, grey, 0.0, 1.0));
}

View file

@ -1,27 +1,20 @@
SAMPLER_BINDING(9) uniform sampler2D samp9;
out vec4 ocol0;
in vec2 uv0;
uniform vec4 resolution;
void main()
{
//variables
float internalresolution = 1278.0;
float4 c0 = texture(samp9, uv0).rgba;
float4 c0 = Sample();
//blur
float4 blurtotal = float4(0.0, 0.0, 0.0, 0.0);
float blursize = 1.5;
blurtotal += texture(samp9, uv0 + float2(-blursize, -blursize)*resolution.zw);
blurtotal += texture(samp9, uv0 + float2(-blursize, blursize)*resolution.zw);
blurtotal += texture(samp9, uv0 + float2( blursize, -blursize)*resolution.zw);
blurtotal += texture(samp9, uv0 + float2( blursize, blursize)*resolution.zw);
blurtotal += texture(samp9, uv0 + float2(-blursize, 0.0)*resolution.zw);
blurtotal += texture(samp9, uv0 + float2( blursize, 0.0)*resolution.zw);
blurtotal += texture(samp9, uv0 + float2( 0.0, -blursize)*resolution.zw);
blurtotal += texture(samp9, uv0 + float2( 0.0, blursize)*resolution.zw);
blurtotal += SampleLocation(GetCoordinates() + float2(-blursize, -blursize)*GetInvResolution());
blurtotal += SampleLocation(GetCoordinates() + float2(-blursize, blursize)*GetInvResolution());
blurtotal += SampleLocation(GetCoordinates() + float2( blursize, -blursize)*GetInvResolution());
blurtotal += SampleLocation(GetCoordinates() + float2( blursize, blursize)*GetInvResolution());
blurtotal += SampleLocation(GetCoordinates() + float2(-blursize, 0.0)*GetInvResolution());
blurtotal += SampleLocation(GetCoordinates() + float2( blursize, 0.0)*GetInvResolution());
blurtotal += SampleLocation(GetCoordinates() + float2( 0.0, -blursize)*GetInvResolution());
blurtotal += SampleLocation(GetCoordinates() + float2( 0.0, blursize)*GetInvResolution());
blurtotal *= 0.125;
c0 = blurtotal;
@ -31,14 +24,14 @@ void main()
// brighten and apply horizontal scanlines
// This would have been much simpler if I could get the stupid modulo (%) to work
// If anyone who is more well versed in Cg knows how to do this it'd be slightly more efficient
// float lineIntensity = ((uv0[1] % 9) - 4) / 40;
float vPos = uv0.y*resolution.y / 9.0;
// float lineIntensity = ((GetCoordinates()[1] % 9) - 4) / 40;
float vPos = GetCoordinates().y*GetResolution().y / 9.0;
float lineIntensity = (((vPos - floor(vPos)) * 9.0) - 4.0) / 40.0;
grey = grey * 0.5 + 0.7 + lineIntensity;
// darken edges
float x = uv0.x * resolution.x;
float y = uv0.y * resolution.y;
float x = GetCoordinates().x * GetResolution().x;
float y = GetCoordinates().y * GetResolution().y;
if (x > internalresolution/2.0)
x = internalresolution-x;
@ -74,5 +67,5 @@ void main()
grey -= y / 200.0;
// output
ocol0 = float4(0.0, grey, 0.0, 1.0);
SetOutput(float4(0.0, grey, 0.0, 1.0));
}

View file

@ -1,11 +1,6 @@
SAMPLER_BINDING(9) uniform sampler2D samp9;
out vec4 ocol0;
in vec2 uv0;
void main()
{
float4 c0 = texture(samp9, uv0).rgba;
float4 c0 = Sample();
float red = 0.0;
float green = 0.0;
float blue = 0.0;
@ -19,5 +14,5 @@ void main()
if (c0.b > 0.25)
blue = c0.b;
ocol0 = float4(red, green, blue, 1.0);
SetOutput(float4(red, green, blue, 1.0));
}

View file

@ -1,8 +1,3 @@
SAMPLER_BINDING(9) uniform sampler2D samp9;
out vec4 ocol0;
in vec2 uv0;
float bound(float color)
{
if (color < 0.35)
@ -18,6 +13,6 @@ float bound(float color)
void main()
{
float4 c0 = texture(samp9, uv0);
ocol0 = float4(bound(c0.r), bound(c0.g), bound(c0.b), c0.a);
float4 c0 = Sample();
SetOutput(float4(bound(c0.r), bound(c0.g), bound(c0.b), c0.a));
}

View file

@ -1,11 +1,6 @@
SAMPLER_BINDING(9) uniform sampler2D samp9;
out vec4 ocol0;
in vec2 uv0;
void main()
{
vec4 c0 = texture(samp9, uv0);
float4 c0 = Sample();
float red = c0.r;
float blue = c0.b;
float green = c0.g;
@ -78,5 +73,5 @@ void main()
green = 0.05;
}
}
ocol0 = vec4(red, green, blue, c0.a);
SetOutput(float4(red, green, blue, c0.a));
}

View file

@ -1,11 +1,6 @@
SAMPLER_BINDING(9) uniform sampler2D samp9;
out vec4 ocol0;
in vec2 uv0;
void main()
{
vec4 c0 = texture(samp9, uv0);
float4 c0 = Sample();
// Same coefficients as grayscale2 at this point
float avg = (0.222 * c0.r) + (0.707 * c0.g) + (0.071 * c0.b);
@ -14,5 +9,5 @@ void main()
// Not sure about these coefficients, they just seem to produce the proper yellow
float green=avg*.75;
float blue=avg*.5;
ocol0 = vec4(red, green, blue, c0.a);
SetOutput(float4(red, green, blue, c0.a));
}

View file

@ -1,24 +1,17 @@
SAMPLER_BINDING(9) uniform sampler2D samp9;
out vec4 ocol0;
in vec2 uv0;
uniform vec4 resolution;
void main()
{
float4 c0 = texture(samp9, uv0).rgba;
float4 c0 = Sample();
float4 tmp = float4(0.0, 0.0, 0.0, 0.0);
tmp += c0 - texture(samp9, uv0 + float2(2.0, 2.0)*resolution.zw).rgba;
tmp += c0 - texture(samp9, uv0 - float2(2.0, 2.0)*resolution.zw).rgba;
tmp += c0 - texture(samp9, uv0 + float2(2.0, -2.0)*resolution.zw).rgba;
tmp += c0 - texture(samp9, uv0 - float2(2.0, -2.0)*resolution.zw).rgba;
tmp += c0 - SampleOffset(int2( 2, 2));
tmp += c0 - SampleOffset(int2(-2, -2));
tmp += c0 - SampleOffset(int2( 2, -2));
tmp += c0 - SampleOffset(int2(-2, 2));
float grey = ((0.222 * tmp.r) + (0.707 * tmp.g) + (0.071 * tmp.b));
// get rid of the bottom line, as it is incorrect.
if (uv0.y*resolution.y < 163.0)
if (GetCoordinates().y*GetResolution().y < 163.0)
tmp = float4(1.0, 1.0, 1.0, 1.0);
c0 = c0 + 1.0 - grey * 7.0;
ocol0 = float4(c0.r, c0.g, c0.b, 1.0);
SetOutput(float4(c0.r, c0.g, c0.b, 1.0));
}

View file

@ -1,11 +1,6 @@
SAMPLER_BINDING(9) uniform sampler2D samp9;
out vec4 ocol0;
in vec2 uv0;
void main()
{
vec4 c0 = texture(samp9, uv0);
float4 c0 = Sample();
float red = 0.0;
float blue = 0.0;
@ -19,5 +14,5 @@ void main()
blue = c0.r + c0.b;
}
ocol0 = vec4(red, 0.0, blue, 1.0);
SetOutput(float4(red, 0.0, blue, 1.0));
}

View file

@ -1,11 +1,6 @@
SAMPLER_BINDING(9) uniform sampler2D samp9;
out vec4 ocol0;
in vec2 uv0;
void main()
{
vec4 c0 = texture(samp9, uv0);
float4 c0 = Sample();
float red = 0.0;
float green = 0.0;
float blue = 0.0;
@ -21,5 +16,5 @@ void main()
green = c0.r + c0.b;
}
ocol0 = vec4(red, green, blue, 1.0);
SetOutput(float4(red, green, blue, 1.0));
}

View file

@ -1,31 +1,24 @@
// Omega's 3D Stereoscopic filtering
// TODO: Need depth info!
SAMPLER_BINDING(9) uniform sampler2D samp9;
out vec4 ocol0;
in vec2 uv0;
uniform vec4 resolution;
void main()
{
// Source Color
float4 c0 = texture(samp9, uv0).rgba;
float sep = 5.0;
float red = c0.r;
float green = c0.g;
float blue = c0.b;
float4 c0 = Sample();
const int sep = 5;
float red = c0.r;
float green = c0.g;
float blue = c0.b;
// Left Eye (Red)
float4 c1 = texture(samp9, uv0 + float2(sep,0.0)*resolution.zw).rgba;
float4 c1 = SampleOffset(int2(sep, 0));
red = max(c0.r, c1.r);
// Right Eye (Cyan)
float4 c2 = texture(samp9, uv0 + float2(-sep,0.0)*resolution.zw).rgba;
float4 c2 = SampleOffset(int2(-sep, 0));
float cyan = (c2.g + c2.b) / 2.0;
green = max(c0.g, cyan);
blue = max(c0.b, cyan);
ocol0 = float4(red, green, blue, c0.a);
SetOutput(float4(red, green, blue, c0.a));
}

View file

@ -1,31 +1,24 @@
// Omega's 3D Stereoscopic filtering (Amber/Blue)
// TODO: Need depth info!
SAMPLER_BINDING(9) uniform sampler2D samp9;
out vec4 ocol0;
in vec2 uv0;
uniform vec4 resolution;
void main()
{
// Source Color
float4 c0 = texture(samp9, uv0).rgba;
float4 c0 = Sample();
float sep = 5.0;
float red = c0.r;
float green = c0.g;
float blue = c0.b;
// Left Eye (Amber)
float4 c2 = texture(samp9, uv0 + float2(sep,0.0)*resolution.zw).rgba;
float4 c2 = SampleLocation(GetCoordinates() + float2(sep,0.0)*GetInvResolution()).rgba;
float amber = (c2.r + c2.g) / 2.0;
red = max(c0.r, amber);
green = max(c0.g, amber);
// Right Eye (Blue)
float4 c1 = texture(samp9, uv0 + float2(-sep,0.0)*resolution.zw).rgba;
float4 c1 = SampleLocation(GetCoordinates() + float2(-sep,0.0)*GetInvResolution()).rgba;
blue = max(c0.b, c1.b);
ocol0 = float4(red, green, blue, c0.a);
SetOutput(float4(red, green, blue, c0.a));
}

View file

@ -1,10 +1,5 @@
SAMPLER_BINDING(9) uniform sampler2D samp9;
out vec4 ocol0;
in vec2 uv0;
void main()
{
vec4 c0 = texture(samp9, uv0);
ocol0 = vec4(c0.r * 1.5, c0.g, c0.b * 0.5, c0.a);
float4 c0 = Sample();
SetOutput(float4(c0.r * 1.5, c0.g, c0.b * 0.5, c0.a));
}

View file

@ -1,9 +1,4 @@
SAMPLER_BINDING(9) uniform sampler2D samp9;
out vec4 ocol0;
in vec2 uv0;
void main()
{
ocol0 = texture(samp9, uv0).bgra;
SetOutput(Sample().bgra);
}

View file

@ -1,9 +1,4 @@
SAMPLER_BINDING(9) uniform sampler2D samp9;
out vec4 ocol0;
in vec2 uv0;
void main()
{
ocol0 = texture(samp9, uv0).brga;
SetOutput(Sample().brga);
}

View file

@ -1,9 +1,4 @@
SAMPLER_BINDING(9) uniform sampler2D samp9;
out vec4 ocol0;
in vec2 uv0;
void main()
{
ocol0 = texture(samp9, uv0).gbra;
SetOutput(Sample());
}

View file

@ -1,9 +1,4 @@
SAMPLER_BINDING(9) uniform sampler2D samp9;
out vec4 ocol0;
in vec2 uv0;
void main()
{
ocol0 = texture(samp9, uv0).grba;
SetOutput(Sample());
}

View file

@ -1,9 +1,4 @@
SAMPLER_BINDING(9) uniform sampler2D samp9;
out vec4 ocol0;
in vec2 uv0;
void main()
{
ocol0 = texture(samp9, uv0).rbga;
SetOutput(Sample().rbga);
}

View file

@ -1,11 +1,6 @@
SAMPLER_BINDING(9) uniform sampler2D samp9;
out vec4 ocol0;
in vec2 uv0;
void main()
{
vec4 c0 = texture(samp9, uv0);
float4 c0 = Sample();
float red = 0.0;
float green = 0.0;
float blue = 0.0;
@ -21,5 +16,5 @@ void main()
green = c0.r + c0.b;
}
ocol0 = vec4(red, green, blue, 1.0);
SetOutput(float4(red, green, blue, 1.0));
}