merge of long discussed new pipeline
This commit is contained in:
@@ -1,16 +1,10 @@
|
||||
#version 110
|
||||
|
||||
uniform sampler2D image;
|
||||
|
||||
uniform float radius;
|
||||
uniform vec2 resolution;
|
||||
uniform bool horiz_blur;
|
||||
uniform bool vert_blur;
|
||||
uniform int iteration;
|
||||
uniform vec2 resolution;
|
||||
|
||||
varying vec2 vTexCoord;
|
||||
|
||||
void main(void) {
|
||||
vec4 process(vec4 col) {
|
||||
float rad = ceil(radius);
|
||||
|
||||
float divider = 1.0 / rad;
|
||||
@@ -19,15 +13,15 @@ void main(void) {
|
||||
|
||||
if (iteration == 0 && horiz_blur && !radius_is_zero) {
|
||||
for (float x=-rad+0.5;x<=rad;x+=2.0) {
|
||||
color += texture2D(image, (vec2(gl_FragCoord.x+x, gl_FragCoord.y))/resolution)*(divider);
|
||||
color += texture2D(texture, vec2(gl_FragCoord.x+x, gl_FragCoord.y)/resolution)*(divider);
|
||||
}
|
||||
gl_FragColor = color;
|
||||
return color;
|
||||
} else if (iteration == 1 && vert_blur && !radius_is_zero) {
|
||||
for (float x=-rad+0.5;x<=rad;x+=2.0) {
|
||||
color += texture2D(image, (vec2(gl_FragCoord.x, gl_FragCoord.y+x))/resolution)*(divider);
|
||||
color += texture2D(texture, vec2(gl_FragCoord.x, gl_FragCoord.y+x)/resolution)*(divider);
|
||||
}
|
||||
gl_FragColor = color;
|
||||
return color;
|
||||
} else {
|
||||
gl_FragColor = texture2D(image, vTexCoord);
|
||||
return col;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,13 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<effect name="Box Blur" category="Blur">
|
||||
<row name="Radius">
|
||||
<field type="double" min="0" default="10" id="radius"/>
|
||||
</row>
|
||||
<row name="Horizontal">
|
||||
<field type="bool" default="1" id="horiz_blur"/>
|
||||
</row>
|
||||
<row name="Vertical">
|
||||
<field type="bool" default="1" id="vert_blur"/>
|
||||
</row>
|
||||
<shader vert="common.vert" frag="boxblur.frag" iterations="2"/>
|
||||
<effect name="Box Blur" category="Blur" id="org.olivevideoeditor.Olive.boxblur">
|
||||
<field name="Radius" type="double" min="0" default="10" id="radius"/>
|
||||
<field name="Horizontal" type="bool" default="1" id="horiz_blur"/>
|
||||
<field name="Vertical" type="bool" default="1" id="vert_blur"/>
|
||||
<shader vert="common.vert" frag="boxblur.frag" iterations="2" />
|
||||
</effect>
|
||||
@@ -1,7 +1,3 @@
|
||||
#version 120
|
||||
|
||||
uniform sampler2D tex0;
|
||||
varying vec2 vTexCoord;
|
||||
const float PI = 3.1415926535;
|
||||
|
||||
uniform vec2 resolution;
|
||||
@@ -18,15 +14,15 @@ vec2 distort(vec2 p, vec2 offset) {
|
||||
return 0.5 * (p + 1.0);
|
||||
}
|
||||
|
||||
void main(void) {
|
||||
vec4 process(vec4 col) {
|
||||
vec2 offset = vec2(xoff/resolution.x, yoff/resolution.y);
|
||||
vec2 xy = 2.0 * vTexCoord - 1.0 - offset;
|
||||
vec2 xy = 2.0 * v_texcoord - 1.0 - offset;
|
||||
vec2 uv;
|
||||
float d = length(xy);
|
||||
uv = distort(xy, offset);
|
||||
if (uv.x >= 0.0 && uv.x <= 1.0 && uv.y >= 0.0 && uv.y <= 1.0) {
|
||||
gl_FragColor = texture2D(tex0, uv);
|
||||
return texture2D(texture, uv);
|
||||
} else {
|
||||
discard;
|
||||
return vec4(0.0);
|
||||
}
|
||||
}
|
||||
@@ -1,22 +1,17 @@
|
||||
#version 110
|
||||
|
||||
uniform vec2 resolution;
|
||||
|
||||
uniform sampler2D tex;
|
||||
varying vec2 vTexCoord;
|
||||
|
||||
uniform float red_amount;
|
||||
uniform float green_amount;
|
||||
uniform float blue_amount;
|
||||
|
||||
void main(void) {
|
||||
uniform vec2 resolution;
|
||||
|
||||
vec4 process(vec4 col) {
|
||||
vec2 rOffset = vec2(red_amount*0.01)/resolution;
|
||||
vec2 gOffset = vec2(green_amount*0.01)/resolution;
|
||||
vec2 bOffset = vec2(blue_amount*0.01)/resolution;
|
||||
|
||||
vec4 rValue = texture2D(tex, vTexCoord - rOffset);
|
||||
vec4 gValue = texture2D(tex, vTexCoord - gOffset);
|
||||
vec4 bValue = texture2D(tex, vTexCoord - bOffset);
|
||||
vec4 rValue = texture2D(texture, v_texcoord - rOffset);
|
||||
vec4 gValue = texture2D(texture, v_texcoord - gOffset);
|
||||
vec4 bValue = texture2D(texture, v_texcoord - bOffset);
|
||||
|
||||
gl_FragColor = vec4(rValue.r, gValue.g, bValue.b, texture2D(tex, vTexCoord).a);
|
||||
return vec4(rValue.r, gValue.g, bValue.b, col.a);
|
||||
}
|
||||
+31
-27
@@ -1,43 +1,47 @@
|
||||
#version 110
|
||||
|
||||
uniform float left;
|
||||
uniform float top;
|
||||
uniform float right;
|
||||
uniform float bottom;
|
||||
uniform float feather;
|
||||
uniform bool invert;
|
||||
uniform vec2 resolution;
|
||||
|
||||
uniform mediump float amount_val;
|
||||
uniform sampler2D myTexture;
|
||||
varying vec2 vTexCoord;
|
||||
|
||||
void main(void) {
|
||||
vec4 textureColor = texture2D(myTexture, vec2(vTexCoord.x, vTexCoord.y));
|
||||
float alpha = textureColor.a;
|
||||
vec4 process(vec4 col) {
|
||||
float alpha = 1.0;
|
||||
|
||||
|
||||
if (feather == 0.0) {
|
||||
if (vTexCoord.x < (left*0.01) || vTexCoord.y < (top*0.01) || vTexCoord.x > (1.0-(right*0.01)) || vTexCoord.y > (1.0-(bottom*0.01))) {
|
||||
if (v_texcoord.x < (left*0.01) || v_texcoord.y < (top*0.01) || v_texcoord.x > (1.0-(right*0.01)) || v_texcoord.y > (1.0-(bottom*0.01))) {
|
||||
alpha = 0.0;
|
||||
}
|
||||
} else {
|
||||
float f = pow(2.0, 10.0-(feather*0.1));
|
||||
if (left > 0.0) alpha = alpha * clamp(((vTexCoord.x+(0.5/f))-(left*0.01))*f, 0.0, 1.0); // left
|
||||
if (top > 0.0) alpha = alpha * clamp(((vTexCoord.y+(0.5/f))-(top*0.01))*f, 0.0, 1.0); // top
|
||||
if (right > 0.0) alpha = alpha * clamp((((1.0-vTexCoord.x)+(0.5/f))-(right*0.01))*f, 0.0, 1.0); // right
|
||||
if (bottom > 0.0) alpha = alpha * clamp((((1.0-vTexCoord.y)+(0.5/f))-(bottom*0.01))*f, 0.0, 1.0); // bottom
|
||||
|
||||
float f = pow(2.0, 10.0-(feather*0.25));
|
||||
|
||||
if (left > 0.0) {
|
||||
alpha *= clamp(((resolution.x*v_texcoord.x+(0.5/f))-(left*0.01*resolution.x))*f, 0.0, 1.0); // left
|
||||
}
|
||||
|
||||
if (top > 0.0) {
|
||||
alpha *= clamp(((resolution.y*v_texcoord.y+(0.5/f))-(top*0.01*resolution.y))*f, 0.0, 1.0); // top
|
||||
}
|
||||
|
||||
if (right > 0.0) {
|
||||
alpha *= clamp(((resolution.x*(1.0-v_texcoord.x)+(0.5/f))-(right*0.01*resolution.x))*f, 0.0, 1.0); // right
|
||||
}
|
||||
|
||||
if (bottom > 0.0) {
|
||||
alpha *= clamp(((resolution.y*(1.0-v_texcoord.y)+(0.5/f))-(bottom*0.01*resolution.y))*f, 0.0, 1.0); // bottom
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
if (invert)
|
||||
{gl_FragColor = vec4(
|
||||
textureColor.r*(1.0 - alpha),
|
||||
textureColor.g*(1.0 - alpha),
|
||||
textureColor.b*(1.0 - alpha),
|
||||
1.0 - alpha
|
||||
);}
|
||||
else{
|
||||
gl_FragColor = vec4(
|
||||
textureColor.r*(alpha),
|
||||
textureColor.g*(alpha),
|
||||
textureColor.b*(alpha),
|
||||
alpha
|
||||
);}
|
||||
if (invert) {
|
||||
return col * (1.0-alpha);
|
||||
} else {
|
||||
return col * alpha;
|
||||
}
|
||||
}
|
||||
@@ -1,15 +1,11 @@
|
||||
#version 110
|
||||
|
||||
#define M_PI 3.1415926535897932384626433832795
|
||||
|
||||
uniform sampler2D image;
|
||||
|
||||
uniform float angle; // degrees
|
||||
uniform float length;
|
||||
|
||||
uniform vec2 resolution;
|
||||
|
||||
void main(void) {
|
||||
vec4 process(vec4 col) {
|
||||
if (length > 0.0) {
|
||||
float ceillen = ceil(length);
|
||||
float radians = (angle*M_PI)/180.0;
|
||||
@@ -21,10 +17,10 @@ void main(void) {
|
||||
for (float i=-ceillen+0.5;i<=ceillen;i+=2.0) {
|
||||
float y = sin_angle * i;
|
||||
float x = cos_angle * i;
|
||||
color += texture2D(image, vec2(gl_FragCoord.x+x, gl_FragCoord.y+y)/resolution)*(divider);
|
||||
color += texture2D(texture, vec2(gl_FragCoord.x+x, gl_FragCoord.y+y)/resolution)*(divider);
|
||||
}
|
||||
gl_FragColor = color;
|
||||
return color;
|
||||
} else {
|
||||
gl_FragColor = texture2D(image, gl_FragCoord.xy/resolution);
|
||||
return col;
|
||||
}
|
||||
}
|
||||
@@ -1,16 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<effect name="Drop Shadow" category="Stylize">
|
||||
<row name="Color">
|
||||
<field type="color" r="0" g="0" b="0" id="shadowcolor"/>
|
||||
</row>
|
||||
<row name="Softness">
|
||||
<field type="double" min="0" default="20" id="shadowsoftness"/>
|
||||
</row>
|
||||
<row name="Opacity">
|
||||
<field type="double" min="0" default="100" max="100" id="shadowopacity"/>
|
||||
</row>
|
||||
<row name="Distance">
|
||||
<field type="double" min="0" default="20" id="shadowdistance"/>
|
||||
</row>
|
||||
<shader vert="common.vert" frag="dropshadow.frag"/>
|
||||
</effect>
|
||||
@@ -1,23 +1,14 @@
|
||||
#version 110
|
||||
|
||||
uniform bool horiz;
|
||||
uniform bool vert;
|
||||
|
||||
uniform sampler2D myTexture;
|
||||
varying vec2 vTexCoord;
|
||||
vec4 process(vec4 col) {
|
||||
float x = v_texcoord.x;
|
||||
float y = v_texcoord.y;
|
||||
|
||||
void main(void) {
|
||||
float x = vTexCoord.x;
|
||||
float y = vTexCoord.y;
|
||||
if (!horiz && !vert) return col;
|
||||
|
||||
if (horiz) x = 1.0 - x;
|
||||
if (vert) y = 1.0 - y;
|
||||
|
||||
vec4 textureColor = texture2D(myTexture, vec2(x, y));
|
||||
gl_FragColor = vec4(
|
||||
textureColor.r,
|
||||
textureColor.g,
|
||||
textureColor.b,
|
||||
textureColor.a
|
||||
);
|
||||
return texture2D(texture, vec2(x, y));
|
||||
}
|
||||
@@ -1,18 +1,11 @@
|
||||
#version 110
|
||||
|
||||
#define M_PI 3.1415926535897932384626433832795
|
||||
|
||||
uniform sampler2D image;
|
||||
|
||||
//uniform float radius;
|
||||
uniform float sigma;
|
||||
uniform vec2 resolution;
|
||||
uniform bool horiz_blur;
|
||||
uniform bool vert_blur;
|
||||
uniform int iteration;
|
||||
|
||||
varying vec2 vTexCoord;
|
||||
|
||||
float gaussian(float x, float sigma) {
|
||||
return (1.0/(sigma*sqrt(2.0*M_PI)))*exp(-0.5*pow(x/sigma, 2.0));
|
||||
}
|
||||
@@ -21,7 +14,7 @@ float gaussian2(float x, float y, float sigma) {
|
||||
return (1.0/(pow(sigma, 2.0)*2.0*M_PI))*exp(-0.5*((pow(x, 2.0) + pow(y, 2.0))/pow(sigma, 2.0)));
|
||||
}
|
||||
|
||||
void main(void) {
|
||||
vec4 process(vec4 col) {
|
||||
float rad = ceil(3.0 * sigma);
|
||||
|
||||
float sum = 0.0;
|
||||
@@ -39,16 +32,16 @@ void main(void) {
|
||||
if (iteration == 0 && horiz_blur && !radius_is_zero) {
|
||||
for (float x=-rad+0.5;x<=rad;x+=2.0) {
|
||||
float weight = (gaussian2(x, 0.0, sigma)/sum);
|
||||
color += texture2D(image, (vec2(gl_FragCoord.x+x, gl_FragCoord.y))/resolution)*(weight);
|
||||
color += texture2D(texture, vec2(gl_FragCoord.x+x, gl_FragCoord.y)/resolution)*(weight);
|
||||
}
|
||||
gl_FragColor = color;
|
||||
return color;
|
||||
} else if (iteration == 1 && vert_blur && !radius_is_zero) {
|
||||
for (float x=-rad+0.5;x<=rad;x+=2.0) {
|
||||
float weight = (gaussian2(0.0, x, sigma)/sum);
|
||||
color += texture2D(image, (vec2(gl_FragCoord.x, gl_FragCoord.y+x))/resolution)*(weight);
|
||||
color += texture2D(texture, vec2(gl_FragCoord.x, gl_FragCoord.y+x)/resolution)*(weight);
|
||||
}
|
||||
gl_FragColor = color;
|
||||
return color;
|
||||
} else {
|
||||
gl_FragColor = texture2D(image, vTexCoord);
|
||||
return col;
|
||||
}
|
||||
}
|
||||
@@ -1,13 +0,0 @@
|
||||
#version 110
|
||||
|
||||
uniform float amount;
|
||||
|
||||
uniform sampler2D myTexture;
|
||||
varying vec2 vTexCoord;
|
||||
|
||||
void main(void) {
|
||||
vec4 textureColor = texture2D(myTexture, vTexCoord);
|
||||
float amount_val = amount * 0.01;
|
||||
vec3 col = textureColor.rgb+((vec3(1.0)-textureColor.rgb-textureColor.rgb)*vec3(amount_val));
|
||||
gl_FragColor = vec4(col, textureColor.a);
|
||||
}
|
||||
@@ -4,9 +4,6 @@ feel free to use or modify at will*/
|
||||
|
||||
/*the following three functions convert RGB into YCbCr in the same manner as in JPEG images*/
|
||||
|
||||
uniform sampler2D tex;
|
||||
varying vec2 vTexCoord;
|
||||
|
||||
uniform vec3 key_color;
|
||||
uniform float tola;
|
||||
uniform float tolb;
|
||||
@@ -42,13 +39,11 @@ float colorclose(float Cb_p,float Cr_p,float Cb_key,float Cr_key,float tola,floa
|
||||
if (temp < tolb) {return ((temp-tola)/(tolb-tola));}
|
||||
return (1.0);
|
||||
}
|
||||
|
||||
void main(void) {
|
||||
|
||||
vec4 process(vec4 texture_color) {
|
||||
float cb_key = rgb2cb(key_color);
|
||||
float cr_key = rgb2cr(key_color);
|
||||
|
||||
vec4 texture_color = texture2D(tex, vTexCoord);
|
||||
|
||||
float cb = rgb2cb(texture_color.rgb);
|
||||
float cr = rgb2cr(texture_color.rgb);
|
||||
float mask = colorclose(cb, cr, cb_key, cr_key, (tola/100.0), (tolb/100.0));
|
||||
@@ -68,5 +63,5 @@ void main(void) {
|
||||
} else if (mode == 2) { // original
|
||||
}
|
||||
|
||||
gl_FragColor = texture_color;
|
||||
return texture_color;
|
||||
}
|
||||
@@ -2,10 +2,6 @@
|
||||
Based on Edward Cannon's Simple Chroma Key (adaptation by Olive Team)
|
||||
RGB to HSV based on MattKC's toonify source code
|
||||
Feel free to modify and use at will */
|
||||
#version 110
|
||||
|
||||
uniform sampler2D tex;
|
||||
varying vec2 vTexCoord;
|
||||
|
||||
uniform float loc;
|
||||
uniform float hic;
|
||||
@@ -57,8 +53,7 @@ bool isNotIncreasingSequence(float a, float b, float c) {
|
||||
return (c < b || a > b);
|
||||
}
|
||||
|
||||
void main(void) {
|
||||
vec4 texture_color = texture2D(tex,vTexCoord);
|
||||
vec4 process(vec4 texture_color) {
|
||||
vec3 color = texture_color.rgb;
|
||||
float toCheck = 0.0;
|
||||
|
||||
@@ -79,5 +74,5 @@ void main(void) {
|
||||
}
|
||||
texture_color.a = isNotIncreasingSequence(loc, toCheck, hic) ? (invert ? texture_color.a : 0.0) : (invert ? 0.0 : texture_color.a);
|
||||
texture_color.rgb *= texture_color.a;
|
||||
gl_FragColor = texture_color;
|
||||
return texture_color;
|
||||
}
|
||||
@@ -1,15 +1,12 @@
|
||||
#version 120
|
||||
uniform sampler2D tex0;
|
||||
varying vec2 vTexCoord;
|
||||
#define M_PI 3.1415926535897932384626433832795
|
||||
|
||||
uniform float size;
|
||||
|
||||
void main(void) {
|
||||
vec4 process(vec4 col) {
|
||||
float maxFactor = 2.0 - (size * 0.01);
|
||||
|
||||
vec2 uv;
|
||||
vec2 xy = 2.0 * vTexCoord - 1.0;
|
||||
vec2 xy = 2.0 * v_texcoord - 1.0;
|
||||
float d = length(xy);
|
||||
if (d < (2.0-maxFactor)) {
|
||||
d = length(xy * maxFactor);
|
||||
@@ -20,8 +17,7 @@ void main(void) {
|
||||
uv.x = r * cos(phi) + 0.5;
|
||||
uv.y = r * sin(phi) + 0.5;
|
||||
} else {
|
||||
uv = vTexCoord;
|
||||
uv = v_texcoord;
|
||||
}
|
||||
vec4 c = texture2D(tex0, uv);
|
||||
gl_FragColor = c;
|
||||
return texture2D(texture, uv);
|
||||
}
|
||||
@@ -1,12 +1,7 @@
|
||||
#version 110
|
||||
|
||||
uniform float hue;
|
||||
uniform float saturation;
|
||||
uniform float brightness;
|
||||
|
||||
uniform sampler2D myTexture;
|
||||
varying vec2 vTexCoord;
|
||||
|
||||
vec3 rgb2hsv(vec3 c) {
|
||||
vec4 K = vec4(0.0, -1.0 / 3.0, 2.0 / 3.0, -1.0);
|
||||
vec4 p = mix(vec4(c.bg, K.wz), vec4(c.gb, K.xy), step(c.b, c.g));
|
||||
@@ -23,9 +18,7 @@ vec3 hsv2rgb(vec3 c) {
|
||||
return c.z * mix(K.xxx, clamp(p - K.xxx, 0.0, 1.0), c.y);
|
||||
}
|
||||
|
||||
void main(void) {
|
||||
vec4 tex_color = texture2D(myTexture, vTexCoord);
|
||||
|
||||
vec4 process(vec4 tex_color) {
|
||||
vec3 hsv = rgb2hsv(tex_color.rgb);
|
||||
hsv.r += (hue/360.0);
|
||||
hsv.g *= (saturation*0.01);
|
||||
@@ -33,10 +26,8 @@ void main(void) {
|
||||
|
||||
vec3 rgb = hsv2rgb(hsv);
|
||||
|
||||
gl_FragColor = vec4(
|
||||
rgb.r,
|
||||
rgb.g,
|
||||
rgb.b,
|
||||
return vec4(
|
||||
rgb.rgb,
|
||||
tex_color.a
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
uniform float amount;
|
||||
|
||||
vec4 process(vec4 col) {
|
||||
float amount_val = amount * 0.01;
|
||||
vec3 color = col.rgb+((vec3(1.0)-col.rgb-col.rgb)*vec3(amount_val));
|
||||
return vec4(color, col.a);
|
||||
}
|
||||
@@ -1,19 +1,13 @@
|
||||
#version 110
|
||||
|
||||
uniform sampler2D sceneTex; // 0
|
||||
uniform float gamma_cent; // 0.6
|
||||
uniform float numColors; // 8.0
|
||||
|
||||
varying vec2 vTexCoord;
|
||||
|
||||
void main() {
|
||||
vec4 process(vec4 color) {
|
||||
float gamma = gamma_cent*0.01;
|
||||
vec4 color = texture2D(sceneTex, vTexCoord);
|
||||
vec3 c = color.rgb;
|
||||
c = pow(c, vec3(gamma, gamma, gamma));
|
||||
c = c * numColors;
|
||||
c = floor(c);
|
||||
c = c / numColors;
|
||||
c = pow(c, vec3(1.0/gamma));
|
||||
gl_FragColor = vec4(c, color.a);
|
||||
return vec4(c, color.a);
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
uniform float amount;
|
||||
|
||||
uniform vec2 resolution; // screen resolution
|
||||
|
||||
vec4 process(vec4 col) {
|
||||
float alpha = texture2D(texture, v_texcoord)[3];
|
||||
|
||||
vec3 p = gl_FragCoord.xyz/vec3(resolution, 1.0)-.5;
|
||||
vec4 color = texture2D(texture,.5+(p.xy*=.992));
|
||||
vec3 o = color.rgb;
|
||||
for (float i=0.;i<amount;i++) {
|
||||
p.z += pow(max(0.,.5-length(color.rg)),2.)*exp(-i*.08);
|
||||
}
|
||||
return vec4(o*o+p.z, alpha);
|
||||
}
|
||||
@@ -1,5 +1,3 @@
|
||||
#version 110
|
||||
|
||||
uniform vec2 resolution;
|
||||
uniform float time;
|
||||
|
||||
@@ -7,9 +5,6 @@ uniform float amount;
|
||||
uniform bool color;
|
||||
uniform bool blend;
|
||||
|
||||
uniform sampler2D myTexture;
|
||||
varying vec2 vTexCoord;
|
||||
|
||||
// precision lowp float;
|
||||
|
||||
float PHI = 1.61803398874989484820459 * 00000.1; // Golden Ratio
|
||||
@@ -20,28 +15,19 @@ float gold_noise(vec2 coordinate, float seed){
|
||||
return fract(tan(distance(coordinate*(seed+PHI), vec2(PHI, PI)))*SQ2)*(amount*0.01);
|
||||
}
|
||||
|
||||
void main(void) {
|
||||
vec4 process(vec4 col) {
|
||||
vec3 noise;
|
||||
if (color) {
|
||||
noise = vec3(gold_noise(vTexCoord, time + 42069.0), gold_noise(vTexCoord, time + 69220.0), gold_noise(vTexCoord, time + 1337.0));
|
||||
noise = vec3(gold_noise(v_texcoord, time + 42069.0), gold_noise(v_texcoord, time + 69220.0), gold_noise(v_texcoord, time + 1337.0));
|
||||
} else {
|
||||
noise = vec3(gold_noise(vTexCoord, time + 69420.0));
|
||||
noise = vec3(gold_noise(v_texcoord, time + 69420.0));
|
||||
}
|
||||
|
||||
if (blend) {
|
||||
noise = (noise - vec3(amount*0.005))*vec3(2.0);
|
||||
|
||||
vec4 textureColor = texture2D(myTexture, vec2(vTexCoord.x, vTexCoord.y));
|
||||
gl_FragColor = vec4(textureColor.rgb+noise, textureColor.a);
|
||||
return vec4(col.rgb+noise, col.a);
|
||||
} else {
|
||||
gl_FragColor = vec4(noise, 1.0);
|
||||
return vec4(noise, 1.0);
|
||||
}
|
||||
}
|
||||
|
||||
/*void main(void) {
|
||||
vec4 textureColor = texture2D(myTexture, vec2(vTexCoord.x, vTexCoord.y));
|
||||
textureColor.r += gold_noise(resolution);
|
||||
textureColor.g += gold_noise(resolution);
|
||||
textureColor.b += gold_noise(resolution);
|
||||
gl_FragColor = textureColor;
|
||||
}*/
|
||||
@@ -1,20 +1,16 @@
|
||||
#version 110
|
||||
|
||||
varying vec2 vTexCoord;
|
||||
uniform sampler2D texture;
|
||||
uniform float pixels_x;
|
||||
uniform float pixels_y;
|
||||
uniform bool bypass;
|
||||
|
||||
void main(void) {
|
||||
vec4 process(vec4 col) {
|
||||
if (bypass) {
|
||||
gl_FragColor = texture2D(texture, vTexCoord);
|
||||
return col;
|
||||
} else {
|
||||
vec2 p = vTexCoord;
|
||||
vec2 p = v_texcoord;
|
||||
|
||||
p.x -= mod(p.x, 1.0 / pixels_x);
|
||||
p.y -= mod(p.y, 1.0 / pixels_y);
|
||||
|
||||
gl_FragColor = texture2D(texture, p);
|
||||
return texture2D(texture, p);
|
||||
}
|
||||
}
|
||||
@@ -1,15 +1,12 @@
|
||||
#version 110
|
||||
|
||||
#define M_PI 3.1415926535897932384626433832795
|
||||
|
||||
uniform sampler2D image;
|
||||
uniform float radius;
|
||||
uniform float center_x;
|
||||
uniform float center_y;
|
||||
|
||||
uniform vec2 resolution;
|
||||
|
||||
void main(void) {
|
||||
vec4 process(vec4 col) {
|
||||
if (radius > 0.0) {
|
||||
vec2 distance = vec2((gl_FragCoord.x - (resolution.x/2.0) - center_x), (gl_FragCoord.y - (resolution.y/2.0) - center_y));
|
||||
|
||||
@@ -28,10 +25,10 @@ void main(void) {
|
||||
for (float i=-limit+0.5;i<=limit;i+=2.0) {
|
||||
float y = sin_angle * i;
|
||||
float x = cos_angle * i;
|
||||
color += texture2D(image, vec2(gl_FragCoord.x+x, gl_FragCoord.y+y)/resolution)*(divider);
|
||||
color += texture2D(texture, vec2(gl_FragCoord.x+x, gl_FragCoord.y+y)/resolution)*(divider);
|
||||
}
|
||||
gl_FragColor = color;
|
||||
return color;
|
||||
} else {
|
||||
gl_FragColor = texture2D(image, gl_FragCoord.xy/resolution);
|
||||
return col;
|
||||
}
|
||||
}
|
||||
@@ -1,7 +1,3 @@
|
||||
#version 110
|
||||
|
||||
varying vec2 vTexCoord;
|
||||
|
||||
uniform float speed;
|
||||
uniform float intensity;
|
||||
uniform float frequency;
|
||||
@@ -12,10 +8,9 @@ uniform bool stretch;
|
||||
|
||||
uniform vec2 resolution; // Screen resolution
|
||||
uniform float time; // time in seconds
|
||||
uniform sampler2D tex0; // scene buffer
|
||||
|
||||
void main(void) {
|
||||
vec2 texCoord = vTexCoord;
|
||||
vec4 process(vec4 col) {
|
||||
vec2 texCoord = v_texcoord;
|
||||
vec2 center = vec2(1.0);
|
||||
|
||||
if (!stretch) {
|
||||
@@ -29,6 +24,6 @@ void main(void) {
|
||||
|
||||
vec2 p = 2.0 * texCoord - center;
|
||||
float len = length(p);
|
||||
vec2 uv = vTexCoord + (p/len)*cos((frequency*0.01)*(len*12.0-real_time*(speed*0.05)))*(intensity*0.0005);
|
||||
gl_FragColor = texture2D(tex0,uv);
|
||||
vec2 uv = v_texcoord + (p/len)*cos((frequency*0.01)*(len*12.0-real_time*(speed*0.05)))*(intensity*0.0005);
|
||||
return texture2D(texture, uv);
|
||||
}
|
||||
@@ -1,9 +1,4 @@
|
||||
#version 110
|
||||
|
||||
varying vec2 vTexCoord;
|
||||
|
||||
uniform vec2 resolution; // Screen resolution
|
||||
uniform sampler2D tex0; // scene buffer
|
||||
|
||||
uniform float xoff;
|
||||
uniform float yoff;
|
||||
@@ -12,8 +7,8 @@ uniform bool tile;
|
||||
uniform bool hide_edges;
|
||||
uniform bool stretch;
|
||||
|
||||
void main(void) {
|
||||
vec2 texCoord = vTexCoord;
|
||||
vec4 process(vec4 col) {
|
||||
vec2 texCoord = v_texcoord;
|
||||
|
||||
vec2 offset = vec2(1.0);
|
||||
|
||||
@@ -28,7 +23,7 @@ void main(void) {
|
||||
}
|
||||
|
||||
vec2 p = 2.0 * texCoord - offset;
|
||||
vec2 adj_tc = 2.0 * vTexCoord - 1.0;
|
||||
vec2 adj_tc = 2.0 * v_texcoord - 1.0;
|
||||
float r = dot(p,p);
|
||||
if (r > 1.0) discard;
|
||||
float f = (1.0-sqrt(1.0-r))/(r);
|
||||
@@ -39,7 +34,7 @@ void main(void) {
|
||||
uv.x = mod(uv.x, 1.0);
|
||||
uv.y = mod(uv.y, 1.0);
|
||||
} else if (hide_edges && (uv.x < 0.0 || uv.x > 1.0 || uv.y < 0.0 || uv.y > 1.0)) {
|
||||
discard;
|
||||
return vec4(0.0);
|
||||
}
|
||||
gl_FragColor = vec4(texture2D(tex0,uv));
|
||||
}
|
||||
return vec4(texture2D(texture,uv));
|
||||
}
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
#version 110
|
||||
|
||||
// Swirl effect parameters
|
||||
uniform float radius;
|
||||
uniform float angle;
|
||||
@@ -7,13 +5,10 @@ uniform float center_x;
|
||||
uniform float center_y;
|
||||
uniform vec2 resolution;
|
||||
|
||||
uniform sampler2D myTexture;
|
||||
varying vec2 vTexCoord;
|
||||
|
||||
void main(void) {
|
||||
vec4 process(vec4 col) {
|
||||
vec2 center = vec2((resolution.x*0.5)+center_x, (resolution.y*0.5)+center_y);
|
||||
|
||||
vec2 uv = vTexCoord.st;
|
||||
vec2 uv = v_texcoord.st;
|
||||
|
||||
vec2 tc = uv * resolution;
|
||||
tc -= center;
|
||||
@@ -26,5 +21,6 @@ void main(void) {
|
||||
tc = vec2(dot(tc, vec2(c, -s)), dot(tc, vec2(s, c)));
|
||||
}
|
||||
tc += center;
|
||||
gl_FragColor = texture2D(myTexture, tc / resolution);
|
||||
|
||||
return texture2D(texture, tc / resolution);
|
||||
}
|
||||
@@ -1,33 +1,14 @@
|
||||
#version 110
|
||||
|
||||
varying vec2 vTexCoord;
|
||||
uniform sampler2D tex0; // scene buffer
|
||||
|
||||
uniform float scale;
|
||||
uniform float centerx;
|
||||
uniform float centery;
|
||||
uniform bool mirrorx;
|
||||
uniform bool mirrory;
|
||||
|
||||
void main(void) {
|
||||
vec2 texCoord = vTexCoord;
|
||||
|
||||
/*vec2 coord = vec2(
|
||||
mod(vTexCoord.x*tilecount, 1.0),
|
||||
mod(vTexCoord.y*tilecount, 1.0)
|
||||
);
|
||||
|
||||
if (mirrorx && mod(vTexCoord.x*tilecount, 2.0) > 1.0) {
|
||||
coord.x = 1.0 - coord.x;
|
||||
}
|
||||
|
||||
if (mirrory && mod(vTexCoord.y*tilecount, 2.0) > 1.0) {
|
||||
coord.y = 1.0 - coord.y;
|
||||
}*/
|
||||
|
||||
vec4 process(vec4 col) {
|
||||
|
||||
float adj_scale = scale*0.01;
|
||||
|
||||
vec2 scaled_coords = (vTexCoord/adj_scale);
|
||||
vec2 scaled_coords = (v_texcoord/adj_scale);
|
||||
vec2 coord = scaled_coords-vec2(0.5/adj_scale, 0.5/adj_scale)+vec2(0.5, 0.5)+vec2(-centerx*0.01, -centery*0.01);
|
||||
vec2 modcoord = mod(coord, 1.0);
|
||||
|
||||
@@ -39,5 +20,6 @@ void main(void) {
|
||||
modcoord.y = 1.0 - modcoord.y;
|
||||
}
|
||||
|
||||
gl_FragColor = vec4(texture2D(tex0, modcoord));
|
||||
return vec4(texture2D(texture, modcoord));
|
||||
|
||||
}
|
||||
@@ -1,6 +1,3 @@
|
||||
#version 110
|
||||
|
||||
uniform sampler2D sceneTex; // 0
|
||||
uniform float lensRadiusX;
|
||||
uniform float lensRadiusY;
|
||||
uniform float centerX;
|
||||
@@ -10,14 +7,11 @@ uniform vec2 resolution;
|
||||
uniform bool invert;
|
||||
// uniform vec2 lensRadius; // 0.45, 0.38
|
||||
|
||||
varying vec2 vTexCoord;
|
||||
|
||||
void main(void) {
|
||||
vec4 process(vec4 c) {
|
||||
if (lensRadiusX == 0.0) {
|
||||
discard;
|
||||
return vec4(0.0);
|
||||
}
|
||||
vec4 c = texture2D(sceneTex, vTexCoord);
|
||||
vec2 vignetteCoord = vTexCoord;
|
||||
vec2 vignetteCoord = v_texcoord;
|
||||
if (circular) {
|
||||
float ar = (resolution.x/resolution.y);
|
||||
vignetteCoord.x *= ar;
|
||||
@@ -31,5 +25,5 @@ void main(void) {
|
||||
else
|
||||
{c *= smoothstep(size, size*0.99*(1.0-lensRadiusY*0.01), dist);}
|
||||
|
||||
gl_FragColor = c;
|
||||
}
|
||||
return c;
|
||||
}
|
||||
|
||||
@@ -1,19 +0,0 @@
|
||||
#version 110
|
||||
|
||||
uniform float amount;
|
||||
|
||||
uniform sampler2D tex0;
|
||||
uniform vec2 resolution; // screen resolution
|
||||
varying vec2 vTexCoord;
|
||||
#define T texture2D(tex0,.5+(p.xy*=.992))
|
||||
|
||||
void main() {
|
||||
float alpha = texture2D(tex0, vTexCoord)[3];
|
||||
|
||||
vec3 p = gl_FragCoord.xyz/vec3(resolution, 1.0)-.5;
|
||||
vec3 o = T.rgb;
|
||||
for (float i=0.;i<amount;i++) {
|
||||
p.z += pow(max(0.,.5-length(T.rg)),2.)*exp(-i*.08);
|
||||
}
|
||||
gl_FragColor=vec4(o*o+p.z, alpha);
|
||||
}
|
||||
@@ -1,32 +1,21 @@
|
||||
#version 110
|
||||
|
||||
uniform float frequency;
|
||||
uniform float intensity;
|
||||
uniform float evolution;
|
||||
uniform bool vertical;
|
||||
|
||||
uniform sampler2D myTexture;
|
||||
varying vec2 vTexCoord;
|
||||
|
||||
void main(void) {
|
||||
float x = vTexCoord.x;
|
||||
float y = vTexCoord.y;
|
||||
vec4 process(vec4 col) {
|
||||
float x = v_texcoord.x;
|
||||
float y = v_texcoord.y;
|
||||
|
||||
if (vertical) {
|
||||
x -= sin((vTexCoord.y-(evolution*0.01))*frequency)*intensity*0.01;
|
||||
x -= sin((v_texcoord.y-(evolution*0.01))*frequency)*intensity*0.01;
|
||||
} else {
|
||||
y -= sin((vTexCoord.x-(evolution*0.01))*frequency)*intensity*0.01;
|
||||
y -= sin((v_texcoord.x-(evolution*0.01))*frequency)*intensity*0.01;
|
||||
}
|
||||
|
||||
if (y < 0.0 || y > 1.0 || x < 0.0 || x > 1.0) {
|
||||
discard;
|
||||
return vec4(0.0);
|
||||
} else {
|
||||
vec4 textureColor = texture2D(myTexture, vec2(x, y));
|
||||
gl_FragColor = vec4(
|
||||
textureColor.r,
|
||||
textureColor.g,
|
||||
textureColor.b,
|
||||
textureColor.a
|
||||
);
|
||||
return texture2D(texture, vec2(x, y));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user