From bc109e1b589b63b9f73a9c4b90dd60ac5620ec3a Mon Sep 17 00:00:00 2001 From: myownfriend Date: Tue, 20 May 2014 23:25:09 -0400 Subject: [PATCH 01/44] Update 16bit.glsl Changed spaces to tabs --- Data/Sys/Shaders/16bit.glsl | 95 +++++++++++++++++++------------------ 1 file changed, 48 insertions(+), 47 deletions(-) diff --git a/Data/Sys/Shaders/16bit.glsl b/Data/Sys/Shaders/16bit.glsl index ca7fb0bbfa..24ba10aa45 100644 --- a/Data/Sys/Shaders/16bit.glsl +++ b/Data/Sys/Shaders/16bit.glsl @@ -1,4 +1,5 @@ uniform sampler2D samp9; +uniform sampler2D samp9; out vec4 ocol0; in vec2 uv0; @@ -7,55 +8,55 @@ uniform vec4 resolution; void main() { - //Change this number to increase the pixel size. - float pixelSize = 3.0; + //Change this number to increase the pixel size. + float pixelSize = 3.0; - float red = 0.0; - float green = 0.0; - float blue = 0.0; - - vec2 pos = floor(uv0 * resolution.xy / pixelSize) * pixelSize * resolution.zw; - - vec4 c0 = texture(samp9, pos); + float red = 0.0; + float green = 0.0; + float blue = 0.0; - if (c0.r < 0.1) - red = 0.1; - else if (c0.r < 0.20) - red = 0.20; - else if (c0.r < 0.40) - red = 0.40; - else if (c0.r < 0.60) - red = 0.60; - else if (c0.r < 0.80) - red = 0.80; - else - red = 1.0; + vec2 pos = floor(uv0 * resolution.xy / pixelSize) * pixelSize * resolution.zw; - if (c0.b < 0.1) - blue = 0.1; - else if (c0.b < 0.20) - blue = 0.20; - else if (c0.b < 0.40) - blue = 0.40; - else if (c0.b < 0.60) - blue = 0.60; - else if (c0.b < 0.80) - blue = 0.80; - else - blue = 1.0; + vec4 c0 = texture(samp9, pos); - if (c0.g < 0.1) - green = 0.1; - else if (c0.g < 0.20) - green = 0.20; - else if (c0.g < 0.40) - green = 0.40; - else if (c0.g < 0.60) - green = 0.60; - else if (c0.g < 0.80) - green = 0.80; - else - green = 1.0; - - ocol0 = vec4(red, green, blue, c0.a); + if (c0.r < 0.1) + red = 0.1; + else if (c0.r < 0.20) + red = 0.20; + else if (c0.r < 0.40) + red = 0.40; + else if (c0.r < 0.60) + red = 0.60; + else if (c0.r < 0.80) + red = 0.80; + else + red = 1.0; + + if (c0.b < 0.1) + blue = 0.1; + else if (c0.b < 0.20) + blue = 0.20; + else if (c0.b < 0.40) + blue = 0.40; + else if (c0.b < 0.60) + blue = 0.60; + else if (c0.b < 0.80) + blue = 0.80; + else + blue = 1.0; + + if (c0.g < 0.1) + green = 0.1; + else if (c0.g < 0.20) + green = 0.20; + else if (c0.g < 0.40) + green = 0.40; + else if (c0.g < 0.60) + green = 0.60; + else if (c0.g < 0.80) + green = 0.80; + else + green = 1.0; + + ocol0 = vec4(red, green, blue, c0.a); } From 2629d6dfa909a01a41c5a3009ea41bbcc6b61e4f Mon Sep 17 00:00:00 2001 From: myownfriend Date: Tue, 20 May 2014 23:26:47 -0400 Subject: [PATCH 02/44] Update 32bit.glsl Formatted it to be consistent with Dolphin's coding style. --- Data/Sys/Shaders/32bit.glsl | 142 ++++++++++++++++++------------------ 1 file changed, 71 insertions(+), 71 deletions(-) diff --git a/Data/Sys/Shaders/32bit.glsl b/Data/Sys/Shaders/32bit.glsl index 1b27bef9be..fddb386b74 100644 --- a/Data/Sys/Shaders/32bit.glsl +++ b/Data/Sys/Shaders/32bit.glsl @@ -7,80 +7,80 @@ uniform vec4 resolution; void main() { - //Change this number to increase the pixel size. - float pixelSize = 2.0; + //Change this number to increase the pixel size. + float pixelSize = 2.0; - float red = 0.0; - float green = 0.0; - float blue = 0.0; - - vec2 pos = floor(uv0 * resolution.xy / pixelSize) * pixelSize * resolution.zw; - - vec4 c0 = texture(samp9, pos); - - if (c0.r < 0.06) - red = 0.06; - else if (c0.r < 0.13) - red = 0.13; - else if (c0.r < 0.26) - red = 0.26; - else if (c0.r < 0.33) - red = 0.33; - else if (c0.r < 0.46) - red = 0.46; - else if (c0.r < 0.60) - red = 0.60; - else if (c0.r < 0.73) - red = 0.73; - else if (c0.r < 0.80) - red = 0.80; - else if (c0.r < 0.93) - red = 0.93; - else - red = 1.0; + float red = 0.0; + float green = 0.0; + float blue = 0.0; - if (c0.b < 0.06) - blue = 0.06; - else if (c0.b < 0.13) - blue = 0.13; - else if (c0.b < 0.26) - blue = 0.26; - else if (c0.b < 0.33) - blue = 0.33; - else if (c0.b < 0.46) - blue = 0.46; - else if (c0.b < 0.60) - blue = 0.60; - else if (c0.b < 0.73) - blue = 0.73; - else if (c0.b < 0.80) - blue = 0.80; - else if( c0.b < 0.93) - blue = 0.93; - else - blue = 1.0; + vec2 pos = floor(uv0 * resolution.xy / pixelSize) * pixelSize * resolution.zw; + + vec4 c0 = texture(samp9, pos); + + if (c0.r < 0.06) + red = 0.06; + else if (c0.r < 0.13) + red = 0.13; + else if (c0.r < 0.26) + red = 0.26; + else if (c0.r < 0.33) + red = 0.33; + else if (c0.r < 0.46) + red = 0.46; + else if (c0.r < 0.60) + red = 0.60; + else if (c0.r < 0.73) + red = 0.73; + else if (c0.r < 0.80) + red = 0.80; + else if (c0.r < 0.93) + red = 0.93; + else + red = 1.0; + + if (c0.b < 0.06) + blue = 0.06; + else if (c0.b < 0.13) + blue = 0.13; + else if (c0.b < 0.26) + blue = 0.26; + else if (c0.b < 0.33) + blue = 0.33; + else if (c0.b < 0.46) + blue = 0.46; + else if (c0.b < 0.60) + blue = 0.60; + else if (c0.b < 0.73) + blue = 0.73; + else if (c0.b < 0.80) + blue = 0.80; + else if( c0.b < 0.93) + blue = 0.93; + else + blue = 1.0; - if (c0.g < 0.06) - green = 0.06; - else if (c0.g < 0.13) - green = 0.13; - else if (c0.g < 0.26) - green = 0.26; - else if (c0.g < 0.33) - green = 0.33; - else if (c0.g < 0.46) - green = 0.46; - else if (c0.g < 0.60) - green = 0.60; - else if (c0.g < 0.73) - green = 0.73; - else if (c0.g < 0.80) - green = 0.80; - else if( c0.g < 0.93) - green = 0.93; - else - green = 1.0; + if (c0.g < 0.06) + green = 0.06; + else if (c0.g < 0.13) + green = 0.13; + else if (c0.g < 0.26) + green = 0.26; + else if (c0.g < 0.33) + green = 0.33; + else if (c0.g < 0.46) + green = 0.46; + else if (c0.g < 0.60) + green = 0.60; + else if (c0.g < 0.73) + green = 0.73; + else if (c0.g < 0.80) + green = 0.80; + else if( c0.g < 0.93) + green = 0.93; + else + green = 1.0; - ocol0 = vec4(red, green, blue, c0.a); + ocol0 = vec4(red, green, blue, c0.a); } From ad7f63669dd3290696f69ab6276535dfefcac410 Mon Sep 17 00:00:00 2001 From: myownfriend Date: Tue, 20 May 2014 23:32:29 -0400 Subject: [PATCH 03/44] Update FXAA.glsl --- Data/Sys/Shaders/FXAA.glsl | 106 ++++++++++++++++++------------------- 1 file changed, 52 insertions(+), 54 deletions(-) diff --git a/Data/Sys/Shaders/FXAA.glsl b/Data/Sys/Shaders/FXAA.glsl index 99caff7d03..afcbe5e47d 100644 --- a/Data/Sys/Shaders/FXAA.glsl +++ b/Data/Sys/Shaders/FXAA.glsl @@ -1,18 +1,16 @@ -/* - DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE - Version 2, December 2004 +// DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE +// Version 2, December 2004 -Copyright (C) 2013 mudlord +// Copyright (C) 2013 mudlord -Everyone is permitted to copy and distribute verbatim or modified -copies of this license document, and changing it is allowed as long -as the name is changed. +// Everyone is permitted to copy and distribute verbatim or modified +// copies of this license document, and changing it is allowed as long +// as the name is changed. - DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE - TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION +// DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE +// TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION - 0. You just DO WHAT THE FUCK YOU WANT TO. -*/ +// 0. You just DO WHAT THE FUCK YOU WANT TO. uniform sampler2D samp9; @@ -20,53 +18,53 @@ 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 +#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) { - 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); - float lumaNW = dot(rgbNW, luma); - float lumaNE = dot(rgbNE, luma); - float lumaSW = dot(rgbSW, luma); - float lumaSE = dot(rgbSE, luma); - 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; - dir.x = -((lumaNW + lumaNE) - (lumaSW + lumaSE)); - dir.y = ((lumaNW + lumaSW) - (lumaNE + lumaSE)); - - float dirReduce = max((lumaNW + lumaNE + lumaSW + lumaSE) * - (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 * 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); + 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); + float lumaNW = dot(rgbNW, luma); + float lumaNE = dot(rgbNE, luma); + float lumaSW = dot(rgbSW, luma); + float lumaSE = dot(rgbSE, luma); + 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))); - float lumaB = dot(rgbB, luma); - if ((lumaB < lumaMin) || (lumaB > lumaMax)) - color = vec4(rgbA, 1.0); - else - color = vec4(rgbB, 1.0); - return color; + vec2 dir; + dir.x = -((lumaNW + lumaNE) - (lumaSW + lumaSE)); + dir.y = ((lumaNW + lumaSW) - (lumaNE + lumaSE)); + + float dirReduce = max((lumaNW + lumaNE + lumaSW + lumaSE) * + (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 * 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); + + float lumaB = dot(rgbB, luma); + if ((lumaB < lumaMin) || (lumaB > lumaMax)) + color = vec4(rgbA, 1.0); + else + color = vec4(rgbB, 1.0); + return color; } void main() From b36609e991bacd834d89cb83630644018b3db669 Mon Sep 17 00:00:00 2001 From: myownfriend Date: Tue, 20 May 2014 23:34:32 -0400 Subject: [PATCH 04/44] Update acidtrip.glsl --- Data/Sys/Shaders/acidtrip.glsl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Data/Sys/Shaders/acidtrip.glsl b/Data/Sys/Shaders/acidtrip.glsl index d7580ca50a..ff40955626 100644 --- a/Data/Sys/Shaders/acidtrip.glsl +++ b/Data/Sys/Shaders/acidtrip.glsl @@ -7,5 +7,5 @@ uniform vec4 resolution; void main() { - ocol0 = (texture(samp9, uv0+resolution.zw) - texture(samp9, uv0-resolution.zw)) * 8.0; + ocol0 = (texture(samp9, uv0+resolution.zw) - texture(samp9, uv0-resolution.zw)) * 8.0; } From 38669a1d161aa848c3cf5f1d09b049ece64bca63 Mon Sep 17 00:00:00 2001 From: myownfriend Date: Tue, 20 May 2014 23:34:56 -0400 Subject: [PATCH 05/44] Update acidtrip2.glsl --- Data/Sys/Shaders/acidtrip2.glsl | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Data/Sys/Shaders/acidtrip2.glsl b/Data/Sys/Shaders/acidtrip2.glsl index b67f4ecfaa..0fbc3d5135 100644 --- a/Data/Sys/Shaders/acidtrip2.glsl +++ b/Data/Sys/Shaders/acidtrip2.glsl @@ -7,7 +7,7 @@ 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; + vec4 a = texture(samp9, uv0+resolution.zw); + vec4 b = texture(samp9, uv0-resolution.zw); + ocol0 = ( a*a*1.3 - b ) * 8.0; } From a26673163f2e08c9876886efdaf82fb501ce4fba Mon Sep 17 00:00:00 2001 From: myownfriend Date: Tue, 20 May 2014 23:39:48 -0400 Subject: [PATCH 06/44] Update asciiart.glsl --- Data/Sys/Shaders/asciiart.glsl | 157 +++++++++++++++++---------------- 1 file changed, 81 insertions(+), 76 deletions(-) diff --git a/Data/Sys/Shaders/asciiart.glsl b/Data/Sys/Shaders/asciiart.glsl index d8cfbb4c0d..3a04cf0e1d 100644 --- a/Data/Sys/Shaders/asciiart.glsl +++ b/Data/Sys/Shaders/asciiart.glsl @@ -1,4 +1,5 @@ -uniform sampler2D samp8; // textures +// textures +uniform sampler2D samp8; uniform sampler2D samp9; const int char_width = 8; @@ -15,81 +16,85 @@ uniform vec4 resolution; void main() { - vec2 char_pos = floor(uv0*resolution.xy/char_dim); - vec2 pixel_offset = floor(uv0*resolution.xy) - char_pos*char_dim; + vec2 char_pos = floor(uv0*resolution.xy/char_dim); + vec2 pixel_offset = floor(uv0*resolution.xy) - char_pos*char_dim; - float mindiff = float(char_width*char_height) * 100.0; // just a big number - 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); - - for(int i=0; i Date: Tue, 20 May 2014 23:40:18 -0400 Subject: [PATCH 07/44] Update auto_toon.glsl --- Data/Sys/Shaders/auto_toon.glsl | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/Data/Sys/Shaders/auto_toon.glsl b/Data/Sys/Shaders/auto_toon.glsl index a3c46730cc..a4efa8433a 100644 --- a/Data/Sys/Shaders/auto_toon.glsl +++ b/Data/Sys/Shaders/auto_toon.glsl @@ -7,16 +7,16 @@ uniform vec4 resolution; void main() { - vec4 to_gray = vec4(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 edge = (x1 - x0) * (x1 - x0) + (x3 - x2) * (x3 - x2); - - float4 color = texture(samp9, uv0).rgba; + vec4 to_gray = vec4(0.3,0.59,0.11,0); - ocol0 = color - vec4(edge, edge, edge, edge) * 12.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 edge = (x1 - x0) * (x1 - x0) + (x3 - x2) * (x3 - x2); + + float4 color = texture(samp9, uv0).rgba; + + ocol0 = color - vec4(edge, edge, edge, edge) * 12.0; } From 4a0150033fae7abab1af1a5a5a7a43e6f112f491 Mon Sep 17 00:00:00 2001 From: myownfriend Date: Tue, 20 May 2014 23:43:56 -0400 Subject: [PATCH 08/44] Update auto_toon2.glsl --- Data/Sys/Shaders/auto_toon2.glsl | 86 +++++++++++++++++--------------- 1 file changed, 45 insertions(+), 41 deletions(-) diff --git a/Data/Sys/Shaders/auto_toon2.glsl b/Data/Sys/Shaders/auto_toon2.glsl index 954bf631a5..d70de99a34 100644 --- a/Data/Sys/Shaders/auto_toon2.glsl +++ b/Data/Sys/Shaders/auto_toon2.glsl @@ -7,39 +7,40 @@ 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 edge = (x1 - x0) * (x1 - x0) + (x3 - x2) * (x3 - x2); - float4 color = texture(samp9, uv0).rgba; + //Changethis to increase the number of colors. + int numColors =8; - float4 c0 = color - float4(edge, edge, edge, edge) * 12.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 edge = (x1 - x0) * (x1 - x0) + (x3 - x2) * (x3 - x2); + float4 color = texture(samp9, uv0).rgba; - + float4 c0 = color - float4(edge, edge, edge, edge) * 12.0; - float red = 0.0; - float green = 0.0; - float blue = 0.0; - bool rr = false; - bool bb = false; - bool gg = false; - int count = 1; - - float colorN = 0.0; - float colorB = 0.0; + float red = 0.0; + float green = 0.0; + float blue = 0.0; + bool rr = false; + bool bb = false; + bool gg = false; + int count = 1; - - for(count = 1; count <= numColors ; count++){ - colorN = float(count / numColors); - - if ( c0.r <= colorN && c0.r >= colorB && rr == false ){ - if (count == 1){ - if(colorN >= 0.1) + float colorN = 0.0; + float colorB = 0.0; + + for (count = 1; count <= numColors; count++) + { + colorN = float(count / numColors); + + if ( c0.r <= colorN && c0.r >= colorB && rr == false ) + { + if (count == 1) + { + if (colorN >= 0.1) red = 0.01; else red = colorN; @@ -47,13 +48,15 @@ void main() else if (count == numColors) red = 0.95; else - red = colorN ; - + red = colorN; + rr = true; } - if (c0.b <= colorN && c0.b >= colorB && bb == false){ - if (count == 1){ + if (c0.b <= colorN && c0.b >= colorB && bb == false) + { + if (count == 1) + { if(colorN >= 0.1) blue = 0.01; else @@ -67,26 +70,27 @@ void main() bb = true; } - if (c0.g <= colorN && c0.g >= colorB && gg == false){ - if (count == 1){ + if (c0.g <= colorN && c0.g >= colorB && gg == false) + { + if (count == 1) + { if(colorN >= 0.1) green = 0.01; else green = colorN; } else if (count == numColors) - green = 0.95 ; + green = 0.95; else - green = colorN ; - gg = true; + green = colorN; + gg = true; } - + colorB = float(count / numColors); + if(rr == true && bb == true && gg == true) break; } - - - ocol0 = float4(red, green, blue, c0.a); + ocol0 = float4(red, green, blue, c0.a); } From 32caf7af1996a8eb27f52884a8c727e910940227 Mon Sep 17 00:00:00 2001 From: myownfriend Date: Tue, 20 May 2014 23:44:49 -0400 Subject: [PATCH 09/44] Update bad_bloom.glsl --- Data/Sys/Shaders/bad_bloom.glsl | 56 ++++++++++++++++----------------- 1 file changed, 28 insertions(+), 28 deletions(-) diff --git a/Data/Sys/Shaders/bad_bloom.glsl b/Data/Sys/Shaders/bad_bloom.glsl index 5ccfee4da6..4e0c96afa6 100644 --- a/Data/Sys/Shaders/bad_bloom.glsl +++ b/Data/Sys/Shaders/bad_bloom.glsl @@ -7,37 +7,37 @@ uniform vec4 resolution; void main() { - float4 c_center = texture(samp9, uv0); + float4 c_center = texture(samp9, uv0); - 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); + 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 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 * 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); - 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)); + 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; - float dist = (dot(vpos, vpos)); - dist = 1.0 - 0.4*dist; + float2 vpos = (uv0 - 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; + ocol0 = (c_center * 0.7 + bloom_sum) * dist; } From 7c3bfaaff6d495f97b7b061256db9571bc43297a Mon Sep 17 00:00:00 2001 From: myownfriend Date: Tue, 20 May 2014 23:45:33 -0400 Subject: [PATCH 10/44] Update chrismas.glsl --- Data/Sys/Shaders/chrismas.glsl | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Data/Sys/Shaders/chrismas.glsl b/Data/Sys/Shaders/chrismas.glsl index 4e3038c1ac..c1caa4ba28 100644 --- a/Data/Sys/Shaders/chrismas.glsl +++ b/Data/Sys/Shaders/chrismas.glsl @@ -6,12 +6,13 @@ in vec2 uv0; void main() { vec4 c0 = texture(samp9, uv0); - float red = 0.0; + float red = 0.0; float green = 0.0; if (c0.r < 0.35 || c0.b > 0.35) green = c0.g + (c0.b / 2.0); else red = c0.r + 0.4; + ocol0 = vec4(red, green, 0.0, 1.0); } From 9218fe97646521a147f95953353d1c89b7529dc6 Mon Sep 17 00:00:00 2001 From: myownfriend Date: Tue, 20 May 2014 23:46:31 -0400 Subject: [PATCH 11/44] Update cool1.glsl --- Data/Sys/Shaders/cool1.glsl | 1 + 1 file changed, 1 insertion(+) diff --git a/Data/Sys/Shaders/cool1.glsl b/Data/Sys/Shaders/cool1.glsl index 22086fe13c..04e1b5b1a2 100644 --- a/Data/Sys/Shaders/cool1.glsl +++ b/Data/Sys/Shaders/cool1.glsl @@ -20,5 +20,6 @@ void main() blue = c0.r; green = c0.r; } + ocol0 = vec4(red, green, blue, 1.0); } From 2c3f3d63fb02240a1625206b519bdffc9a5ced28 Mon Sep 17 00:00:00 2001 From: myownfriend Date: Tue, 20 May 2014 23:47:05 -0400 Subject: [PATCH 12/44] Update darkerbrighter.glsl --- Data/Sys/Shaders/darkerbrighter.glsl | 45 ++++++++++++++-------------- 1 file changed, 22 insertions(+), 23 deletions(-) diff --git a/Data/Sys/Shaders/darkerbrighter.glsl b/Data/Sys/Shaders/darkerbrighter.glsl index 00442afe2d..291ede4d3e 100644 --- a/Data/Sys/Shaders/darkerbrighter.glsl +++ b/Data/Sys/Shaders/darkerbrighter.glsl @@ -7,35 +7,34 @@ 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 = 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); - float red = c0.r; - float blue = c0.b; - float green = c0.g; + float red = c0.r; + float blue = c0.b; + float green = c0.g; - float red2 = (c1.r + c2.r + c3.r + c4.r) / 4.0; - float blue2 = (c1.b + c2.b + c3.b + c4.b) / 4.0; - float green2 = (c1.g + c2.g + c3.g + c4.g) / 4.0; + float red2 = (c1.r + c2.r + c3.r + c4.r) / 4.0; + float blue2 = (c1.b + c2.b + c3.b + c4.b) / 4.0; + float green2 = (c1.g + c2.g + c3.g + c4.g) / 4.0; - if(red2 > 0.3) - red = c0.r + c0.r / 2.0; - else - red = c0.r - c0.r / 2.0; + if (red2 > 0.3) + red = c0.r + c0.r / 2.0; + else + red = c0.r - c0.r / 2.0; - if(green2 > 0.3) + if (green2 > 0.3) green = c0.g+ c0.g / 2.0; - else + else green = c0.g - c0.g / 2.0; - - - if(blue2 > 0.3) + + if (blue2 > 0.3) blue = c0.b+ c0.b / 2.0; - else + else blue = c0.b - c0.b / 2.0; - - ocol0 = float4(red, green, blue, c0.a); + + ocol0 = float4(red, green, blue, c0.a); } From 00a09d60c158a6c577ce6e11028b25bd5f808f90 Mon Sep 17 00:00:00 2001 From: myownfriend Date: Tue, 20 May 2014 23:47:26 -0400 Subject: [PATCH 13/44] Update emboss.glsl --- Data/Sys/Shaders/emboss.glsl | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/Data/Sys/Shaders/emboss.glsl b/Data/Sys/Shaders/emboss.glsl index f3f3d7d0a0..9c75390853 100644 --- a/Data/Sys/Shaders/emboss.glsl +++ b/Data/Sys/Shaders/emboss.glsl @@ -7,18 +7,18 @@ 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; - - red = y2 + (1.0 - y); - green = y2 + (1.0 - y); - blue = y2 + (1.0 - y); + 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; - ocol0 = float4(red, green, blue, alpha); + red = y2 + (1.0 - y); + green = y2 + (1.0 - y); + blue = y2 + (1.0 - y); + + ocol0 = float4(red, green, blue, alpha); } From a926a7c1135d693573661c719e91fe07b4b5eff0 Mon Sep 17 00:00:00 2001 From: myownfriend Date: Tue, 20 May 2014 23:48:16 -0400 Subject: [PATCH 14/44] Update fire.glsl --- Data/Sys/Shaders/fire.glsl | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/Data/Sys/Shaders/fire.glsl b/Data/Sys/Shaders/fire.glsl index 22a9ec4a17..106a4ef521 100644 --- a/Data/Sys/Shaders/fire.glsl +++ b/Data/Sys/Shaders/fire.glsl @@ -6,15 +6,13 @@ in vec2 uv0; void main() { vec4 c0 = texture(samp9, uv0); - float red = 0.0; - float green = 0.0; - float blue = 0.0; + float red = 0.0; + float green = 0.0; + float blue = 0.0; red = c0.r; - - if (c0.r > 0.0) - if (c0.g > c0.r) + if (c0.r > 0.0 && c0.g > c0.r) green = (c0.g - (c0.g - c0.r)) / 3.0; if (c0.b > 0.0 && c0.r < 0.25) From dc59012d5aecc5d513c3326edd1dc8ee9b651437 Mon Sep 17 00:00:00 2001 From: myownfriend Date: Tue, 20 May 2014 23:49:49 -0400 Subject: [PATCH 15/44] Update firewater.glsl --- Data/Sys/Shaders/firewater.glsl | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/Data/Sys/Shaders/firewater.glsl b/Data/Sys/Shaders/firewater.glsl index add2d54e72..390f7aad66 100644 --- a/Data/Sys/Shaders/firewater.glsl +++ b/Data/Sys/Shaders/firewater.glsl @@ -7,16 +7,16 @@ 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); - float red = c0.r; - float green = c0.g; - float blue = c0.b; - float alpha = c0.a; - - red = c0.r - c1.b; - blue = c0.b - c2.r + (c0.g - c0.r); + 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); + float red = c0.r; + float green = c0.g; + float blue = c0.b; + float alpha = c0.a; - ocol0 = float4(red, 0.0, blue, alpha); -} \ No newline at end of file + red = c0.r - c1.b; + blue = c0.b - c2.r + (c0.g - c0.r); + + ocol0 = float4(red, 0.0, blue, alpha); +} From 51b0645963a01064fb3c3b02fe4c114ac7408d8f Mon Sep 17 00:00:00 2001 From: myownfriend Date: Tue, 20 May 2014 23:51:34 -0400 Subject: [PATCH 16/44] Update invertedoutline.glsl --- Data/Sys/Shaders/invertedoutline.glsl | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Data/Sys/Shaders/invertedoutline.glsl b/Data/Sys/Shaders/invertedoutline.glsl index 66d24fb5ca..70363ddbbd 100644 --- a/Data/Sys/Shaders/invertedoutline.glsl +++ b/Data/Sys/Shaders/invertedoutline.glsl @@ -7,8 +7,8 @@ uniform vec4 resolution; void main() { - float4 c0 = texture(samp9, uv0); - float4 c1 = texture(samp9, uv0 + float2(5,5)*resolution.zw); + float4 c0 = texture(samp9, uv0); + float4 c1 = texture(samp9, uv0 + float2(5,5)*resolution.zw); - ocol0 = c0 - c1; -} \ No newline at end of file + ocol0 = c0 - c1; +} From 134fdd0ef71fbea84037e5815314508faf5f64d5 Mon Sep 17 00:00:00 2001 From: myownfriend Date: Tue, 20 May 2014 23:52:32 -0400 Subject: [PATCH 17/44] Update mad_world.glsl --- Data/Sys/Shaders/mad_world.glsl | 30 +++++++++++++++++------------- 1 file changed, 17 insertions(+), 13 deletions(-) diff --git a/Data/Sys/Shaders/mad_world.glsl b/Data/Sys/Shaders/mad_world.glsl index 2e627abb57..63e46ecc39 100644 --- a/Data/Sys/Shaders/mad_world.glsl +++ b/Data/Sys/Shaders/mad_world.glsl @@ -7,16 +7,20 @@ 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; - if (color.r > 0.8 && color.b + color.b < 0.2) - ocol0 = 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); - else - ocol0 = float4(0,0,0,0); - } -} \ No newline at end of file + 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; + + if (color.r > 0.8 && color.b + color.b < 0.2) + { + ocol0 = 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); + else + ocol0 = float4(0,0,0,0); + } +} From d5fea64953bc57f9da30698e90cda0b55b8f55a6 Mon Sep 17 00:00:00 2001 From: myownfriend Date: Tue, 20 May 2014 23:53:13 -0400 Subject: [PATCH 18/44] Update nightvision.glsl --- Data/Sys/Shaders/nightvision.glsl | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/Data/Sys/Shaders/nightvision.glsl b/Data/Sys/Shaders/nightvision.glsl index ff98cb03b9..42f0fe441e 100644 --- a/Data/Sys/Shaders/nightvision.glsl +++ b/Data/Sys/Shaders/nightvision.glsl @@ -5,13 +5,11 @@ in vec2 uv0; void main() { - float4 c0 = texture(samp9, uv0).rgba; - float green = c0.g; + float4 c0 = texture(samp9, uv0).rgba; + float green = c0.g; - if (c0.g < 0.50) - { - green = c0.r + c0.b; - } + if (c0.g < 0.50) + green = c0.r + c0.b; - ocol0 = float4(0.0, green, 0.0, 1.0); -} \ No newline at end of file + ocol0 = float4(0.0, green, 0.0, 1.0); +} From 548d872843c7c9a8da67ab8e2217117be2287e50 Mon Sep 17 00:00:00 2001 From: myownfriend Date: Tue, 20 May 2014 23:53:37 -0400 Subject: [PATCH 19/44] Update nightvision2.glsl --- Data/Sys/Shaders/nightvision2.glsl | 102 ++++++++++++++++------------- 1 file changed, 56 insertions(+), 46 deletions(-) diff --git a/Data/Sys/Shaders/nightvision2.glsl b/Data/Sys/Shaders/nightvision2.glsl index 37a962c650..82bb72ffde 100644 --- a/Data/Sys/Shaders/nightvision2.glsl +++ b/Data/Sys/Shaders/nightvision2.glsl @@ -7,50 +7,60 @@ uniform vec4 resolution; void main() { - //variables - float internalresolution = 1278.0; - float4 c0 = texture(samp9, uv0).rgba; - //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 *= 0.125; - c0 = blurtotal; - //greyscale - float grey = ((0.3 * c0.r) + (0.4 * c0.g) + (0.3 * c0.b)); - // brighten - grey = grey * 0.5 + 0.7; - // darken edges - float x = uv0.x * resolution.x; - float y = uv0.y * resolution.y; - if (x > internalresolution/2.0) x = internalresolution-x; - if (y > internalresolution/2.0) y = internalresolution-y; - if (x > internalresolution/2.0*0.95) x = internalresolution/2.0*0.95; - if (y > internalresolution/2.0*0.95) y = internalresolution/2.0*0.95; - x = -x+641.0; - y = -y+641.0; - /*****inline square root routines*****/ - // bit of a performance bottleneck. - // neccessary to make the darkened area rounded - // instead of rhombus-shaped. - float sqrt = x / 10.0; - while((sqrt*sqrt) < x) sqrt+=0.1; - x = sqrt; - sqrt = y / 10.0; - while((sqrt*sqrt) < y) sqrt+=0.1; - y = sqrt; - /*****end of inline square root routines*****/ - x *= 2.0; - y *= 2.0; - grey -= x / 200.0; - grey -= y / 200.0; - // output - ocol0 = float4(0.0, grey, 0.0, 1.0); + //variables + float internalresolution = 1278.0; + float4 c0 = texture(samp9, uv0).rgba; + + //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 *= 0.125; + c0 = blurtotal; + + //greyscale + float grey = ((0.3 * c0.r) + (0.4 * c0.g) + (0.3 * c0.b)); + + // brighten + grey = grey * 0.5 + 0.7; + + // darken edges + float x = uv0.x * resolution.x; + float y = uv0.y * resolution.y; + if (x > internalresolution/2.0) + x = internalresolution-x; + if (y > internalresolution/2.0) + y = internalresolution-y; + if (x > internalresolution/2.0*0.95) + x = internalresolution/2.0*0.95; + if (y > internalresolution/2.0*0.95) + y = internalresolution/2.0*0.95; + x = -x+641.0; + y = -y+641.0; + + /*****inline square root routines*****/ + // bit of a performance bottleneck. + // neccessary to make the darkened area rounded + // instead of rhombus-shaped. + float sqrt = x / 10.0; + while((sqrt*sqrt) < x) sqrt+=0.1; + x = sqrt; + sqrt = y / 10.0; + while((sqrt*sqrt) < y) sqrt+=0.1; + y = sqrt; + + x *= 2.0; + y *= 2.0; + grey -= x / 200.0; + grey -= y / 200.0; + + // output + ocol0 = float4(0.0, grey, 0.0, 1.0); } From 4c1ef9ba807cde2d55573b58ce99b140d7d23f6c Mon Sep 17 00:00:00 2001 From: myownfriend Date: Tue, 20 May 2014 23:54:11 -0400 Subject: [PATCH 20/44] Update nightvision2scanlines.glsl --- Data/Sys/Shaders/nightvision2scanlines.glsl | 117 +++++++++++--------- 1 file changed, 66 insertions(+), 51 deletions(-) diff --git a/Data/Sys/Shaders/nightvision2scanlines.glsl b/Data/Sys/Shaders/nightvision2scanlines.glsl index 8904e5f20f..1cfcd20693 100644 --- a/Data/Sys/Shaders/nightvision2scanlines.glsl +++ b/Data/Sys/Shaders/nightvision2scanlines.glsl @@ -7,55 +7,70 @@ uniform vec4 resolution; void main() { - //variables - float internalresolution = 1278.0; - float4 c0 = texture(samp9, uv0).rgba; - //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 *= 0.125; - c0 = blurtotal; - //greyscale - float grey = ((0.3 * c0.r) + (0.4 * c0.g) + (0.3 * c0.b)); - // 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 = (((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; - if (x > internalresolution/2.0) x = internalresolution-x; - if (y > internalresolution/2.0) y = internalresolution-y; - if (x > internalresolution/2.0*0.95) x = internalresolution/2.0*0.95; - if (y > internalresolution/2.0*0.95) y = internalresolution/2.0*0.95; - x = -x + 641.0; - y = -y + 641.0; - /*****inline square root routines*****/ - // bit of a performance bottleneck. - // neccessary to make the darkened area rounded - // instead of rhombus-shaped. - float sqrt = x / 10.0; - while((sqrt*sqrt) < x) sqrt+=0.1; - x = sqrt; - sqrt = y / 10.0; - while((sqrt*sqrt) < y) sqrt+=0.1; - y = sqrt; - /*****end of inline square root routines*****/ - x *= 2.0; - y *= 2.0; - grey -= x / 200.0; - grey -= y / 200.0; - // output - ocol0 = float4(0.0, grey, 0.0, 1.0); + //variables + float internalresolution = 1278.0; + float4 c0 = texture(samp9, uv0).rgba; + + //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 *= 0.125; + c0 = blurtotal; + + //greyscale + float grey = ((0.3 * c0.r) + (0.4 * c0.g) + (0.3 * c0.b)); + + // 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 = (((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; + + if (x > internalresolution/2.0) + x = internalresolution-x; + + if (y > internalresolution/2.0) + y = internalresolution-y; + + if (x > internalresolution/2.0*0.95) + x = internalresolution/2.0*0.95; + + if (y > internalresolution/2.0*0.95) + y = internalresolution/2.0*0.95; + + x = -x + 641.0; + y = -y + 641.0; + + //****inline square root routines*****/ + // bit of a performance bottleneck. + // neccessary to make the darkened area rounded + // instead of rhombus-shaped. + float sqrt = x / 10.0; + while((sqrt*sqrt) < x) sqrt+=0.1; + x = sqrt; + sqrt = y / 10.0; + while((sqrt*sqrt) < y) sqrt+=0.1; + y = sqrt; + + x *= 2.0; + y *= 2.0; + grey -= x / 200.0; + grey -= y / 200.0; + + // output + ocol0 = float4(0.0, grey, 0.0, 1.0); } From 8ddad21abc14937dfd69e5cddf85a6048120409f Mon Sep 17 00:00:00 2001 From: myownfriend Date: Tue, 20 May 2014 23:54:52 -0400 Subject: [PATCH 21/44] Update posterize.glsl --- Data/Sys/Shaders/posterize.glsl | 30 ++++++++++++------------------ 1 file changed, 12 insertions(+), 18 deletions(-) diff --git a/Data/Sys/Shaders/posterize.glsl b/Data/Sys/Shaders/posterize.glsl index 602a412929..c04d4f7a68 100644 --- a/Data/Sys/Shaders/posterize.glsl +++ b/Data/Sys/Shaders/posterize.glsl @@ -5,25 +5,19 @@ in vec2 uv0; void main() { - float4 c0 = texture(samp9, uv0).rgba; - float red = 0.0; - float green = 0.0; - float blue = 0.0; + float4 c0 = texture(samp9, uv0).rgba; + float red = 0.0; + float green = 0.0; + float blue = 0.0; - if (c0.r > 0.25) - { - red = c0.r; - } + if (c0.r > 0.25) + red = c0.r; - if (c0.g > 0.25) - { - green = c0.g; - } + if (c0.g > 0.25) + green = c0.g; - if (c0.b > 0.25) - { - blue = c0.b; - } + if (c0.b > 0.25) + blue = c0.b; - ocol0 = float4(red, green, blue, 1.0); -} \ No newline at end of file + ocol0 = float4(red, green, blue, 1.0); +} From 0ef3a7f233b3b131f65738b4527f2f612e33c61c Mon Sep 17 00:00:00 2001 From: myownfriend Date: Tue, 20 May 2014 23:55:59 -0400 Subject: [PATCH 22/44] Update posterize2.glsl --- Data/Sys/Shaders/posterize2.glsl | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/Data/Sys/Shaders/posterize2.glsl b/Data/Sys/Shaders/posterize2.glsl index fc6c2ef5c9..b2c47533a1 100644 --- a/Data/Sys/Shaders/posterize2.glsl +++ b/Data/Sys/Shaders/posterize2.glsl @@ -5,20 +5,19 @@ in vec2 uv0; float bound(float color) { - if (color < 0.35) - { - if (color < 0.25) + if (color < 0.35) { - return color; + if (color < 0.25) + return color; + + return 0.5; } - return 0.5; - } -return 1.0; + + return 1.0; } void main() { - float4 c0 = texture(samp9, uv0); - ocol0 = float4(bound(c0.r), bound(c0.g), bound(c0.b), c0.a); + float4 c0 = texture(samp9, uv0); + ocol0 = float4(bound(c0.r), bound(c0.g), bound(c0.b), c0.a); } - From 980b5f8fbb0016e996d75edbde72d52e3cadcc5e Mon Sep 17 00:00:00 2001 From: myownfriend Date: Tue, 20 May 2014 23:57:31 -0400 Subject: [PATCH 23/44] Update primarycolors.glsl --- Data/Sys/Shaders/primarycolors.glsl | 31 +++++++++++++++++++---------- 1 file changed, 20 insertions(+), 11 deletions(-) diff --git a/Data/Sys/Shaders/primarycolors.glsl b/Data/Sys/Shaders/primarycolors.glsl index 390492a33e..658b04b6ea 100644 --- a/Data/Sys/Shaders/primarycolors.glsl +++ b/Data/Sys/Shaders/primarycolors.glsl @@ -13,49 +13,58 @@ void main() float max = 0.8; float min = 0.3; - if(c0.r > c0.g && c0.b > c0.g){ - if(c0.r < c0.b + 0.05 && c0.b < c0.r + 0.05){ + if (c0.r > c0.g && c0.b > c0.g) + { + if (c0.r < c0.b + 0.05 && c0.b < c0.r + 0.05) + { red = 0.7; blue = 0.7; green = 0.05; } - else if(c0.r > c0.b + 0.05){ + else if (c0.r > c0.b + 0.05) + { red = 0.7; blue = 0.05; green = 0.05; } - else if (c0.b > c0.r + 0.05){ + else if (c0.b > c0.r + 0.05) + { red = 0.05; blue = 0.7; green = 0.05; } } - if(c0.r > c0.b && c0.g > c0.b){ - if(c0.r < c0.g + 0.05 && c0.g < c0.r + 0.05){ + if (c0.r > c0.b && c0.g > c0.b){ + if (c0.r < c0.g + 0.05 && c0.g < c0.r + 0.05) + { red = 0.7; blue = 0.05; green = 0.7; } - else if(c0.r > c0.g + 0.05){ + else if (c0.r > c0.g + 0.05) + { red = 0.7; blue = 0.05; green = 0.05; } - else if (c0.g > c0.r + 0.05){ + else if (c0.g > c0.r + 0.05) + { red = 0.05; blue = 0.05; green = 0.7; } } - if(c0.g > c0.r && c0.b > c0.r){ - if(c0.g < c0.b + 0.05 && c0.b < c0.g + 0.05){ + if (c0.g > c0.r && c0.b > c0.r) + { + if (c0.g < c0.b + 0.05 && c0.b < c0.g + 0.05) + { red = 0.05; blue = 0.7; green = 0.7; } - else if(c0.g > c0.b + 0.05){ + else if (c0.g > c0.b + 0.05){ red = 0.05; blue = 0.05; green = 0.7; From 92d0af2d18c484c4409ae480e889b902fff0f7d7 Mon Sep 17 00:00:00 2001 From: myownfriend Date: Tue, 20 May 2014 23:58:02 -0400 Subject: [PATCH 24/44] Update sepia.glsl --- Data/Sys/Shaders/sepia.glsl | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Data/Sys/Shaders/sepia.glsl b/Data/Sys/Shaders/sepia.glsl index 88f5c15de7..83ac0b1e37 100644 --- a/Data/Sys/Shaders/sepia.glsl +++ b/Data/Sys/Shaders/sepia.glsl @@ -6,9 +6,11 @@ in vec2 uv0; void main() { vec4 c0 = texture(samp9, uv0); + // Same coefficients as grayscale2 at this point float avg = (0.222 * c0.r) + (0.707 * c0.g) + (0.071 * c0.b); float red=avg; + // Not sure about these coefficients, they just seem to produce the proper yellow float green=avg*.75; float blue=avg*.5; From 349a7b59ea3765667cb30e3cb53f5575545dfd2f Mon Sep 17 00:00:00 2001 From: myownfriend Date: Tue, 20 May 2014 23:58:33 -0400 Subject: [PATCH 25/44] Update sketchy.glsl --- Data/Sys/Shaders/sketchy.glsl | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/Data/Sys/Shaders/sketchy.glsl b/Data/Sys/Shaders/sketchy.glsl index 525b0ebc9c..a91e404108 100644 --- a/Data/Sys/Shaders/sketchy.glsl +++ b/Data/Sys/Shaders/sketchy.glsl @@ -7,16 +7,18 @@ uniform vec4 resolution; void main() { - float4 c0 = texture(samp9, uv0).rgba; - 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; - 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) - 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); + float4 c0 = texture(samp9, uv0).rgba; + 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; + 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) + 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); } From e43df47cd11acbdc566b22f1b78c45c1fd247a23 Mon Sep 17 00:00:00 2001 From: myownfriend Date: Wed, 21 May 2014 00:00:18 -0400 Subject: [PATCH 26/44] Update stereoscopic.glsl --- Data/Sys/Shaders/stereoscopic.glsl | 33 +++++++++++++++--------------- 1 file changed, 16 insertions(+), 17 deletions(-) diff --git a/Data/Sys/Shaders/stereoscopic.glsl b/Data/Sys/Shaders/stereoscopic.glsl index 41463fcd28..f37a246e55 100644 --- a/Data/Sys/Shaders/stereoscopic.glsl +++ b/Data/Sys/Shaders/stereoscopic.glsl @@ -10,23 +10,22 @@ uniform vec4 resolution; void main() { - float4 c0 = texture(samp9, uv0).rgba; // Source Color - float sep = 5.0; - 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; - red = max(c0.r, c1.r); + // Source Color + float4 c0 = texture(samp9, uv0).rgba; + float sep = 5.0; + float red = c0.r; + float green = c0.g; + float blue = c0.b; - // Right Eye (Cyan) - float4 c2 = texture(samp9, uv0 + float2(-sep,0.0)*resolution.zw).rgba; - float cyan = (c2.g + c2.b) / 2.0; - green = max(c0.g, cyan); - blue = max(c0.b, cyan); + // Left Eye (Red) + float4 c1 = texture(samp9, uv0 + float2(sep,0.0)*resolution.zw).rgba; + red = max(c0.r, c1.r); - - ocol0 = float4(red, green, blue, c0.a); + // Right Eye (Cyan) + float4 c2 = texture(samp9, uv0 + float2(-sep,0.0)*resolution.zw).rgba; + 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); } From d13e9c5aa8d889e8c6d24fc1c63bdcf1a5019596 Mon Sep 17 00:00:00 2001 From: myownfriend Date: Wed, 21 May 2014 00:00:50 -0400 Subject: [PATCH 27/44] Update stereoscopic2.glsl --- Data/Sys/Shaders/stereoscopic2.glsl | 31 ++++++++++++++--------------- 1 file changed, 15 insertions(+), 16 deletions(-) diff --git a/Data/Sys/Shaders/stereoscopic2.glsl b/Data/Sys/Shaders/stereoscopic2.glsl index ed72341745..f7370c7d5f 100644 --- a/Data/Sys/Shaders/stereoscopic2.glsl +++ b/Data/Sys/Shaders/stereoscopic2.glsl @@ -10,23 +10,22 @@ uniform vec4 resolution; void main() { - float4 c0 = texture(samp9, uv0).rgba; // Source Color - float sep = 5.0; - float red = c0.r; - float green = c0.g; - float blue = c0.b; + // Source Color + float4 c0 = texture(samp9, uv0).rgba; + 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; - float amber = (c2.r + c2.g) / 2.0; - red = max(c0.r, amber); - green = max(c0.g, amber); + // Left Eye (Amber) + float4 c2 = texture(samp9, uv0 + float2(sep,0.0)*resolution.zw).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; - blue = max(c0.b, c1.b); + // Right Eye (Blue) + float4 c1 = texture(samp9, uv0 + float2(-sep,0.0)*resolution.zw).rgba; + blue = max(c0.b, c1.b); - - ocol0 = float4(red, green, blue, c0.a); + ocol0 = float4(red, green, blue, c0.a); } From f59c7f25dabc31db0258c6005c7b46f0e51b2d9d Mon Sep 17 00:00:00 2001 From: myownfriend Date: Wed, 21 May 2014 00:05:13 -0400 Subject: [PATCH 28/44] Update asciiart.glsl --- Data/Sys/Shaders/asciiart.glsl | 43 +++++++++++++++++----------------- 1 file changed, 21 insertions(+), 22 deletions(-) diff --git a/Data/Sys/Shaders/asciiart.glsl b/Data/Sys/Shaders/asciiart.glsl index 3a04cf0e1d..b4133a592a 100644 --- a/Data/Sys/Shaders/asciiart.glsl +++ b/Data/Sys/Shaders/asciiart.glsl @@ -26,7 +26,7 @@ void main() vec4 mina = vec4(0.0, 0.0, 0.0, 0.0); vec4 minb = vec4(0.0, 0.0, 0.0, 0.0); - for(int i=0; i Date: Wed, 21 May 2014 00:06:38 -0400 Subject: [PATCH 29/44] Update auto_toon2.glsl --- Data/Sys/Shaders/auto_toon2.glsl | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Data/Sys/Shaders/auto_toon2.glsl b/Data/Sys/Shaders/auto_toon2.glsl index d70de99a34..b2abceb9ad 100644 --- a/Data/Sys/Shaders/auto_toon2.glsl +++ b/Data/Sys/Shaders/auto_toon2.glsl @@ -57,7 +57,7 @@ void main() { if (count == 1) { - if(colorN >= 0.1) + if (colorN >= 0.1) blue = 0.01; else blue = colorN; @@ -67,14 +67,14 @@ void main() else blue = colorN ; - bb = true; + bb = true; } if (c0.g <= colorN && c0.g >= colorB && gg == false) { if (count == 1) { - if(colorN >= 0.1) + if (colorN >= 0.1) green = 0.01; else green = colorN; @@ -88,7 +88,7 @@ void main() colorB = float(count / numColors); - if(rr == true && bb == true && gg == true) + if (rr == true && bb == true && gg == true) break; } From 1fe8d1ae1678c5bd5ce39712c6efe62768c92ea9 Mon Sep 17 00:00:00 2001 From: myownfriend Date: Wed, 21 May 2014 00:10:07 -0400 Subject: [PATCH 30/44] Update nightvision2.glsl --- Data/Sys/Shaders/nightvision2.glsl | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/Data/Sys/Shaders/nightvision2.glsl b/Data/Sys/Shaders/nightvision2.glsl index 82bb72ffde..3f5910c46b 100644 --- a/Data/Sys/Shaders/nightvision2.glsl +++ b/Data/Sys/Shaders/nightvision2.glsl @@ -50,10 +50,13 @@ void main() // neccessary to make the darkened area rounded // instead of rhombus-shaped. float sqrt = x / 10.0; - while((sqrt*sqrt) < x) sqrt+=0.1; + + while ((sqrt*sqrt) < x) + sqrt+=0.1; x = sqrt; sqrt = y / 10.0; - while((sqrt*sqrt) < y) sqrt+=0.1; + while ((sqrt*sqrt) < y) + sqrt+=0.1; y = sqrt; x *= 2.0; From d8fe09e9b1bd751a0984317f85bdb8986e4eb389 Mon Sep 17 00:00:00 2001 From: myownfriend Date: Wed, 21 May 2014 00:11:11 -0400 Subject: [PATCH 31/44] Update nightvision2scanlines.glsl --- Data/Sys/Shaders/nightvision2scanlines.glsl | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Data/Sys/Shaders/nightvision2scanlines.glsl b/Data/Sys/Shaders/nightvision2scanlines.glsl index 1cfcd20693..f0b63687ad 100644 --- a/Data/Sys/Shaders/nightvision2scanlines.glsl +++ b/Data/Sys/Shaders/nightvision2scanlines.glsl @@ -60,10 +60,12 @@ void main() // neccessary to make the darkened area rounded // instead of rhombus-shaped. float sqrt = x / 10.0; - while((sqrt*sqrt) < x) sqrt+=0.1; + while ((sqrt*sqrt) < x) + sqrt+=0.1; x = sqrt; sqrt = y / 10.0; - while((sqrt*sqrt) < y) sqrt+=0.1; + while ((sqrt*sqrt) < y) + sqrt+=0.1; y = sqrt; x *= 2.0; From fd1d0e6e1e2bbf8b7d4173fad9fd5c6ab1fab69d Mon Sep 17 00:00:00 2001 From: myownfriend Date: Wed, 21 May 2014 14:51:25 -0400 Subject: [PATCH 32/44] Update posterize.glsl --- Data/Sys/Shaders/posterize.glsl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Data/Sys/Shaders/posterize.glsl b/Data/Sys/Shaders/posterize.glsl index c04d4f7a68..f09563014a 100644 --- a/Data/Sys/Shaders/posterize.glsl +++ b/Data/Sys/Shaders/posterize.glsl @@ -7,8 +7,8 @@ void main() { float4 c0 = texture(samp9, uv0).rgba; float red = 0.0; - float green = 0.0; - float blue = 0.0; + float green = 0.0; + float blue = 0.0; if (c0.r > 0.25) red = c0.r; From d2a74bf2942f90d6072162876313e67c02aa2174 Mon Sep 17 00:00:00 2001 From: myownfriend Date: Wed, 21 May 2014 14:52:46 -0400 Subject: [PATCH 33/44] Update chrismas.glsl --- Data/Sys/Shaders/chrismas.glsl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Data/Sys/Shaders/chrismas.glsl b/Data/Sys/Shaders/chrismas.glsl index c1caa4ba28..c01536a332 100644 --- a/Data/Sys/Shaders/chrismas.glsl +++ b/Data/Sys/Shaders/chrismas.glsl @@ -7,7 +7,7 @@ void main() { vec4 c0 = texture(samp9, uv0); float red = 0.0; - float green = 0.0; + float green = 0.0; if (c0.r < 0.35 || c0.b > 0.35) green = c0.g + (c0.b / 2.0); From dd91d8609558362774e8279c6f22d3b8168261ce Mon Sep 17 00:00:00 2001 From: myownfriend Date: Wed, 21 May 2014 14:53:48 -0400 Subject: [PATCH 34/44] Update 16bit.glsl --- Data/Sys/Shaders/16bit.glsl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Data/Sys/Shaders/16bit.glsl b/Data/Sys/Shaders/16bit.glsl index 24ba10aa45..ebc755ec47 100644 --- a/Data/Sys/Shaders/16bit.glsl +++ b/Data/Sys/Shaders/16bit.glsl @@ -12,8 +12,8 @@ void main() float pixelSize = 3.0; float red = 0.0; - float green = 0.0; - float blue = 0.0; + float green = 0.0; + float blue = 0.0; vec2 pos = floor(uv0 * resolution.xy / pixelSize) * pixelSize * resolution.zw; From 9b022e023b62ec20a6b1946b9f79311f91ab777f Mon Sep 17 00:00:00 2001 From: myownfriend Date: Wed, 21 May 2014 14:55:45 -0400 Subject: [PATCH 35/44] Update firewater.glsl --- Data/Sys/Shaders/firewater.glsl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Data/Sys/Shaders/firewater.glsl b/Data/Sys/Shaders/firewater.glsl index 390f7aad66..b21e9db87d 100644 --- a/Data/Sys/Shaders/firewater.glsl +++ b/Data/Sys/Shaders/firewater.glsl @@ -11,9 +11,9 @@ void main() float4 c1 = texture(samp9, uv0 + float2(1,1)*resolution.zw); float4 c2 = texture(samp9, uv0 + float2(-1,-1)*resolution.zw); float red = c0.r; - float green = c0.g; + float green = c0.g; float blue = c0.b; - float alpha = c0.a; + float alpha = c0.a; red = c0.r - c1.b; blue = c0.b - c2.r + (c0.g - c0.r); From 28c1e6c6ca0816ab328619fcfbc3cecb5cd7488c Mon Sep 17 00:00:00 2001 From: myownfriend Date: Wed, 21 May 2014 15:14:56 -0400 Subject: [PATCH 36/44] Update 16bit.glsl Sorry. Made a little copy and paste error. --- Data/Sys/Shaders/16bit.glsl | 1 - 1 file changed, 1 deletion(-) diff --git a/Data/Sys/Shaders/16bit.glsl b/Data/Sys/Shaders/16bit.glsl index ebc755ec47..f7d8170ebe 100644 --- a/Data/Sys/Shaders/16bit.glsl +++ b/Data/Sys/Shaders/16bit.glsl @@ -1,5 +1,4 @@ uniform sampler2D samp9; -uniform sampler2D samp9; out vec4 ocol0; in vec2 uv0; From c2e5e030b011633e1382dd66359d5975befa23b2 Mon Sep 17 00:00:00 2001 From: myownfriend Date: Wed, 21 May 2014 15:15:48 -0400 Subject: [PATCH 37/44] Update asciiart.glsl --- Data/Sys/Shaders/asciiart.glsl | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Data/Sys/Shaders/asciiart.glsl b/Data/Sys/Shaders/asciiart.glsl index b4133a592a..f9f5ab7788 100644 --- a/Data/Sys/Shaders/asciiart.glsl +++ b/Data/Sys/Shaders/asciiart.glsl @@ -84,7 +84,8 @@ void main() 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)); - if (diff_f < mindiff) { + if (diff_f < mindiff) + { mindiff = diff_f; minc = float(i); mina = a; From 41f13f9c99fa7bf33651c15ed828b53955355fde Mon Sep 17 00:00:00 2001 From: myownfriend Date: Wed, 21 May 2014 16:29:25 -0400 Subject: [PATCH 38/44] Update primarycolors.glsl --- Data/Sys/Shaders/primarycolors.glsl | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/Data/Sys/Shaders/primarycolors.glsl b/Data/Sys/Shaders/primarycolors.glsl index 658b04b6ea..29ae0ac200 100644 --- a/Data/Sys/Shaders/primarycolors.glsl +++ b/Data/Sys/Shaders/primarycolors.glsl @@ -35,7 +35,8 @@ void main() } } - if (c0.r > c0.b && c0.g > c0.b){ + if (c0.r > c0.b && c0.g > c0.b) + { if (c0.r < c0.g + 0.05 && c0.g < c0.r + 0.05) { red = 0.7; @@ -64,12 +65,14 @@ void main() blue = 0.7; green = 0.7; } - else if (c0.g > c0.b + 0.05){ + else if (c0.g > c0.b + 0.05) + { red = 0.05; blue = 0.05; green = 0.7; } - else if (c0.b > c0.g + 0.05){ + else if (c0.b > c0.g + 0.05) + { red = 0.05; blue = 0.7; green = 0.05; From c3864db4b361b035d215018e91ea4b815935671f Mon Sep 17 00:00:00 2001 From: myownfriend Date: Wed, 21 May 2014 16:36:46 -0400 Subject: [PATCH 39/44] Update 32bit.glsl --- Data/Sys/Shaders/32bit.glsl | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Data/Sys/Shaders/32bit.glsl b/Data/Sys/Shaders/32bit.glsl index fddb386b74..1a9594f19c 100644 --- a/Data/Sys/Shaders/32bit.glsl +++ b/Data/Sys/Shaders/32bit.glsl @@ -10,9 +10,9 @@ void main() //Change this number to increase the pixel size. float pixelSize = 2.0; - float red = 0.0; - float green = 0.0; - float blue = 0.0; + float red = 0.0; + float green = 0.0; + float blue = 0.0; vec2 pos = floor(uv0 * resolution.xy / pixelSize) * pixelSize * resolution.zw; From cd6aa34979d62d3da9a27dca7a166c8c3d62af36 Mon Sep 17 00:00:00 2001 From: myownfriend Date: Wed, 21 May 2014 16:38:25 -0400 Subject: [PATCH 40/44] Update acidmetal.glsl --- Data/Sys/Shaders/acidmetal.glsl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Data/Sys/Shaders/acidmetal.glsl b/Data/Sys/Shaders/acidmetal.glsl index d52efb35a2..b34626b709 100644 --- a/Data/Sys/Shaders/acidmetal.glsl +++ b/Data/Sys/Shaders/acidmetal.glsl @@ -6,8 +6,8 @@ in vec2 uv0; void main() { vec4 c0 = texture(samp9, uv0); - float red = 0.0; - float blue = 0.0; + float red = 0.0; + float blue = 0.0; if (c0.r > 0.15 && c0.b > 0.15) { From f5579d9816687683bf3b5bc192847c7ada66568b Mon Sep 17 00:00:00 2001 From: myownfriend Date: Wed, 21 May 2014 16:42:18 -0400 Subject: [PATCH 41/44] Update cool1.glsl --- Data/Sys/Shaders/cool1.glsl | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Data/Sys/Shaders/cool1.glsl b/Data/Sys/Shaders/cool1.glsl index 04e1b5b1a2..6c1b7d5875 100644 --- a/Data/Sys/Shaders/cool1.glsl +++ b/Data/Sys/Shaders/cool1.glsl @@ -6,9 +6,9 @@ in vec2 uv0; void main() { vec4 c0 = texture(samp9, uv0); - float red = 0.0; - float green = 0.0; - float blue = 0.0; + float red = 0.0; + float green = 0.0; + float blue = 0.0; if (c0.r < 0.50 || c0.b > 0.5) { From 12a9c5f0cee189568fab2787559153496317d236 Mon Sep 17 00:00:00 2001 From: myownfriend Date: Wed, 21 May 2014 16:43:55 -0400 Subject: [PATCH 42/44] Update fire2.glsl --- Data/Sys/Shaders/fire2.glsl | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Data/Sys/Shaders/fire2.glsl b/Data/Sys/Shaders/fire2.glsl index 73360b630b..f8f7e7a92b 100644 --- a/Data/Sys/Shaders/fire2.glsl +++ b/Data/Sys/Shaders/fire2.glsl @@ -6,9 +6,9 @@ in vec2 uv0; void main() { vec4 c0 = texture(samp9, uv0); - float red = 0.0; - float green = 0.0; - float blue = 0.0; + float red = 0.0; + float green = 0.0; + float blue = 0.0; float avg = (c0.r + c0.g + c0.b) / 3.0; red = c0.r + (c0.g / 2.0) + (c0.b / 3.0); From 24027b78e3b2c94e52102675ebef8b8758ae7be4 Mon Sep 17 00:00:00 2001 From: myownfriend Date: Wed, 21 May 2014 16:45:32 -0400 Subject: [PATCH 43/44] Update emboss.glsl --- Data/Sys/Shaders/emboss.glsl | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/Data/Sys/Shaders/emboss.glsl b/Data/Sys/Shaders/emboss.glsl index 9c75390853..978c6d0eef 100644 --- a/Data/Sys/Shaders/emboss.glsl +++ b/Data/Sys/Shaders/emboss.glsl @@ -7,18 +7,18 @@ 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; + 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; + 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); + red = y2 + (1.0 - y); + green = y2 + (1.0 - y); + blue = y2 + (1.0 - y); ocol0 = float4(red, green, blue, alpha); } From 7853766a6bbd2b33005bbae5f850693b1606339e Mon Sep 17 00:00:00 2001 From: myownfriend Date: Wed, 21 May 2014 17:09:26 -0400 Subject: [PATCH 44/44] Update emboss.glsl --- Data/Sys/Shaders/emboss.glsl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Data/Sys/Shaders/emboss.glsl b/Data/Sys/Shaders/emboss.glsl index 978c6d0eef..7b9b2212a4 100644 --- a/Data/Sys/Shaders/emboss.glsl +++ b/Data/Sys/Shaders/emboss.glsl @@ -16,7 +16,7 @@ void main() float blue = c0.b; float alpha = c0.a; - red = y2 + (1.0 - y); + red = y2 + (1.0 - y); green = y2 + (1.0 - y); blue = y2 + (1.0 - y);