├── .gitignore ├── test_files ├── Hexagon.tiff ├── noise2d.png ├── v002-CRT-Mask-RGB-Shadow.png ├── v002-CRT-Mask-RGB-Straight.png ├── v002-CRT-Mask-RGB-Staggered.png ├── v002-CRT-Mask-Scanline-Staggered.png ├── README.md ├── Test-Functionality.fs ├── v002 Light Leak.vs ├── Test-IMG_THIS_PIXEL.fs ├── Test-IMG_PIXEL.fs ├── Test-IMG_THIS_NORM_PIXEL.fs ├── Color Invert.fs ├── Test-IMG_NORM_PIXEL.fs ├── Maximum Component.fs ├── Bright.fs ├── Flip H.fs ├── Flip V.fs ├── Apply Alpha.fs ├── Test-Event.fs ├── Show Alpha.fs ├── Minimum Component.fs ├── Test-Bool.fs ├── Solid Color.fs ├── Rotate.vs ├── Mirror Edge.vs ├── White Point Adjust.fs ├── Test-ImportedImage.fs ├── Test-Float.fs ├── Sorting Smear.vs ├── Exposure Adjust.fs ├── Freeze Frame.fs ├── Set Alpha.fs ├── VVMotionBlur 3.0.fs ├── Test-PersistentBuffer.fs ├── Vertex Manipulator.vs ├── Histogram Viewer.fs ├── Color Posterize.fs ├── Rotate.fs ├── False Color.fs ├── Test-Point.fs ├── Deinterlace.fs ├── Heart.fs ├── Test-Long.fs ├── Gamma Correction.fs ├── Test-Color.fs ├── Emboss.vs ├── Color Relookup.fs ├── Mirror.fs ├── 3d Rotate.fs ├── Fade.fs ├── Interlace Mirror.fs ├── Life.vs ├── RGB Invert.fs ├── Posterize.fs ├── Wipe Up.fs ├── Wipe Left.fs ├── Wipe Right.fs ├── Test-Audio.fs ├── Test-MultiPassRendering.fs ├── v002 Dilate.vs ├── v002 Erode.vs ├── Layer Position.fs ├── Wipe Down.fs ├── Test-PersistentBufferDifferingSizes.fs ├── Test-TempBufferDifferingSizes.fs ├── RGB EQ.fs ├── Edges.vs ├── FastMosh.vs ├── Lens Flare.vs ├── Sketch.vs ├── Soft Blur.vs ├── Color Blowout.vs ├── Dot Screen.vs ├── Edge Distort.vs ├── Edge Trace.vs ├── Line Screen.vs ├── Sharpen RGB.vs ├── Smudged Lens.vs ├── Thermal Camera.vs ├── Unsharp Mask.vs ├── Circular Screen.vs ├── Optical Flow Distort.vs ├── Saturation Bleed.vs ├── Sharpen Luminance.vs ├── Crosswarp.fs ├── Auto Levels.vs ├── Neon.vs ├── Glow.vs ├── Window Blinds.fs ├── RGB Trails 3.0.fs ├── Side Scroller And Flip.fs ├── Luma Transition.fs ├── Sepia Tone.fs ├── Vertical Tearing.fs ├── HSVtoRGB.fs ├── RGBtoHSV.fs ├── Color Monochrome.fs ├── Zoom.fs ├── Multiply Blend.fs ├── v002-CRT-Displacement.fs ├── Mirror Edge.fs ├── Dreamy.fs ├── Test-Sampler.fs ├── Burn.fs ├── Heart Transition.fs ├── Shake.fs ├── Vertex Manipulator.fs ├── v002 Bleach Bypass.fs ├── Vibrance.fs ├── XYZoom.fs ├── Channel Slide.fs ├── v002 Erode.fs ├── Pinwheel.fs ├── Radial.fs ├── Triangle Warp.fs ├── v002 Dilate.fs ├── Morph.fs ├── Colour Distance.fs ├── Wind.fs ├── Long Exposure.fs ├── Simple Zoom Transition.fs ├── Window Slice.fs ├── Squeeze.fs ├── Fade Gray Scale.fs ├── Angular.fs ├── Circle Open.fs ├── Fade Color.fs ├── Glitch Memories.fs ├── Unsharp Mask.fs ├── Directional.fs ├── Polar Function.fs ├── Trapezoid Distortion.fs ├── Stripes.fs ├── Emboss.fs ├── Luminance Posterize.fs ├── Ripple Transition.fs ├── Night Vision.fs ├── Sharpen Luminance.fs ├── Diagonal Blur.fs ├── Water Drop.fs ├── Circle Crop.fs ├── Swirl.fs ├── Displacement.fs ├── Polka Dots Curtain.fs ├── Color Phase.fs ├── HorizVertHold.fs ├── VU Meter.fs ├── Cubic Warp.fs ├── Interlace.fs ├── Echo Trace.fs ├── v002 Vignette.fs ├── Radial Gradient.fs ├── TV Static.fs ├── Directional Warp.fs ├── Linear Blur.fs ├── Noise Displace.fs ├── Twirl.fs ├── Linear Gradient.fs ├── Random Squares.fs ├── Color History.fs ├── Test-AudioFFT.fs ├── Sphere Map.fs ├── Checkerboard.fs ├── FFT Filled Waveform.fs ├── Shockwave.fs └── Waveform Displace.fs ├── .travis.yml ├── Cargo.toml ├── LICENSE-APACHE ├── tests ├── parse.rs └── roundtrip.rs └── LICENSE-MIT /.gitignore: -------------------------------------------------------------------------------- 1 | /target 2 | Cargo.lock 3 | -------------------------------------------------------------------------------- /test_files/Hexagon.tiff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nannou-org/isf/HEAD/test_files/Hexagon.tiff -------------------------------------------------------------------------------- /test_files/noise2d.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nannou-org/isf/HEAD/test_files/noise2d.png -------------------------------------------------------------------------------- /test_files/v002-CRT-Mask-RGB-Shadow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nannou-org/isf/HEAD/test_files/v002-CRT-Mask-RGB-Shadow.png -------------------------------------------------------------------------------- /test_files/v002-CRT-Mask-RGB-Straight.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nannou-org/isf/HEAD/test_files/v002-CRT-Mask-RGB-Straight.png -------------------------------------------------------------------------------- /test_files/v002-CRT-Mask-RGB-Staggered.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nannou-org/isf/HEAD/test_files/v002-CRT-Mask-RGB-Staggered.png -------------------------------------------------------------------------------- /test_files/v002-CRT-Mask-Scanline-Staggered.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nannou-org/isf/HEAD/test_files/v002-CRT-Mask-Scanline-Staggered.png -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: rust 2 | rust: 3 | - nightly 4 | - stable 5 | script: 6 | - cargo check --verbose 7 | - cargo test --verbose 8 | - cargo doc --verbose 9 | -------------------------------------------------------------------------------- /test_files/README.md: -------------------------------------------------------------------------------- 1 | These test files have been sourced from the following site: 2 | 3 | https://www.interactiveshaderformat.com/spec 4 | 5 | They have been included within this repo with permission from the founders of 6 | the ISF specification. 7 | -------------------------------------------------------------------------------- /test_files/Test-Functionality.fs: -------------------------------------------------------------------------------- 1 | /*{ 2 | "DESCRIPTION": "just colors the passed image opaque red, tests basic rendering functionality", 3 | "CREDIT": "by zoidberg", 4 | "ISFVSN": "2.0", 5 | "CATEGORIES": [ 6 | "TEST-GLSL FX" 7 | ], 8 | "INPUTS": [ 9 | { 10 | "NAME": "inputImage", 11 | "TYPE": "image" 12 | } 13 | ] 14 | }*/ 15 | 16 | void main() 17 | { 18 | gl_FragColor = vec4(1.0, 0.0, 0.0, 1.0); 19 | } -------------------------------------------------------------------------------- /test_files/v002 Light Leak.vs: -------------------------------------------------------------------------------- 1 | 2 | #if __VERSION__ <= 120 3 | varying mat2 rotmat; 4 | #else 5 | out mat2 rotmat; 6 | #endif 7 | 8 | void main() 9 | { 10 | isf_vertShaderInit(); 11 | 12 | // setup basic rotation matrix here 13 | float theta = radians(angle); 14 | 15 | // dont need to compute this more than once.. 16 | float c = cos(theta); 17 | float s = sin(theta); 18 | 19 | // rotation matrix 20 | rotmat = mat2(c,s,-s,c); 21 | } -------------------------------------------------------------------------------- /test_files/Test-IMG_THIS_PIXEL.fs: -------------------------------------------------------------------------------- 1 | /*{ 2 | "DESCRIPTION": "demonstrates the use of IMG_THIS_PIXEL to fetch a pixel color from an input", 3 | "CREDIT": "by zoidberg", 4 | "ISFVSN": "2.0", 5 | "CATEGORIES": [ 6 | "TEST-GLSL FX" 7 | ], 8 | "INPUTS": [ 9 | { 10 | "NAME": "inputImage", 11 | "TYPE": "image" 12 | } 13 | ] 14 | }*/ 15 | 16 | void main() 17 | { 18 | vec4 test = IMG_THIS_PIXEL(inputImage); 19 | gl_FragColor = test; 20 | } 21 | -------------------------------------------------------------------------------- /test_files/Test-IMG_PIXEL.fs: -------------------------------------------------------------------------------- 1 | /*{ 2 | "DESCRIPTION": "demonstrates the use of IMG_PIXEL to fetch a pixel color from an input", 3 | "CREDIT": "by zoidberg", 4 | "ISFVSN": "2.0", 5 | "CATEGORIES": [ 6 | "TEST-GLSL FX" 7 | ], 8 | "INPUTS": [ 9 | { 10 | "NAME": "inputImage", 11 | "TYPE": "image" 12 | } 13 | ] 14 | }*/ 15 | 16 | void main() 17 | { 18 | vec4 test = IMG_PIXEL(inputImage, gl_FragCoord.xy); 19 | gl_FragColor = test; 20 | } 21 | -------------------------------------------------------------------------------- /test_files/Test-IMG_THIS_NORM_PIXEL.fs: -------------------------------------------------------------------------------- 1 | /*{ 2 | "DESCRIPTION": "demonstrates the use of IMG_THIS_NORM_PIXEL to fetch a pixel color from an input", 3 | "CREDIT": "by zoidberg", 4 | "ISFVSN": "2.0", 5 | "CATEGORIES": [ 6 | "TEST-GLSL FX" 7 | ], 8 | "INPUTS": [ 9 | { 10 | "NAME": "inputImage", 11 | "TYPE": "image" 12 | } 13 | ] 14 | }*/ 15 | 16 | void main() 17 | { 18 | vec4 test = IMG_THIS_NORM_PIXEL(inputImage); 19 | gl_FragColor = test; 20 | } 21 | -------------------------------------------------------------------------------- /test_files/Color Invert.fs: -------------------------------------------------------------------------------- 1 | /*{ 2 | "CREDIT": "by zoidberg", 3 | "ISFVSN": "2", 4 | "DESCRIPTION": "Inverts the RGB channels of the input", 5 | "CATEGORIES": [ 6 | "Color Effect", "Utility" 7 | ], 8 | "INPUTS": [ 9 | { 10 | "NAME": "inputImage", 11 | "TYPE": "image" 12 | } 13 | ] 14 | }*/ 15 | 16 | void main() { 17 | vec4 srcPixel = IMG_THIS_PIXEL(inputImage); 18 | gl_FragColor = vec4(1.0-srcPixel.r, 1.0-srcPixel.g, 1.0-srcPixel.b, srcPixel.a); 19 | } -------------------------------------------------------------------------------- /test_files/Test-IMG_NORM_PIXEL.fs: -------------------------------------------------------------------------------- 1 | /*{ 2 | "DESCRIPTION": "demonstrates the use of IMG_NORM_PIXEL to fetch a pixel color from an input", 3 | "CREDIT": "by zoidberg", 4 | "ISFVSN": "2.0", 5 | "CATEGORIES": [ 6 | "TEST-GLSL FX" 7 | ], 8 | "INPUTS": [ 9 | { 10 | "NAME": "inputImage", 11 | "TYPE": "image" 12 | } 13 | ] 14 | }*/ 15 | 16 | void main() 17 | { 18 | vec4 test = IMG_NORM_PIXEL(inputImage, isf_FragNormCoord); 19 | gl_FragColor = test; 20 | } 21 | -------------------------------------------------------------------------------- /test_files/Maximum Component.fs: -------------------------------------------------------------------------------- 1 | /*{ 2 | "CREDIT": "by zoidberg", 3 | "ISFVSN": "2", 4 | "CATEGORIES": [ 5 | "Color Effect", "Utility" 6 | ], 7 | "INPUTS": [ 8 | { 9 | "NAME": "inputImage", 10 | "TYPE": "image" 11 | } 12 | ] 13 | }*/ 14 | 15 | void main() { 16 | vec4 srcPixel = IMG_THIS_PIXEL(inputImage); 17 | float maxComponent = max(srcPixel.r, max(srcPixel.g, srcPixel.b)); 18 | gl_FragColor = vec4(maxComponent, maxComponent, maxComponent, srcPixel.a); 19 | } -------------------------------------------------------------------------------- /test_files/Bright.fs: -------------------------------------------------------------------------------- 1 | /*{ 2 | "CREDIT": "by zoidberg", 3 | "ISFVSN": "2", 4 | "CATEGORIES": [ 5 | "Color Adjustment" 6 | ], 7 | "INPUTS": [ 8 | { 9 | "NAME": "inputImage", 10 | "TYPE": "image" 11 | }, 12 | { 13 | "NAME": "bright", 14 | "TYPE": "float", 15 | "MIN": -1.0, 16 | "MAX": 1.0, 17 | "DEFAULT": 0.0 18 | } 19 | ] 20 | }*/ 21 | 22 | void main() { 23 | gl_FragColor = clamp(IMG_THIS_PIXEL(inputImage) + vec4(bright,bright,bright,0.0), 0.0, 1.0); 24 | } -------------------------------------------------------------------------------- /test_files/Flip H.fs: -------------------------------------------------------------------------------- 1 | /*{ 2 | "CREDIT": "by VIDVOX", 3 | "ISFVSN": "2", 4 | "CATEGORIES": [ 5 | "Geometry Adjustment" 6 | ], 7 | "INPUTS": [ 8 | { 9 | "NAME": "inputImage", 10 | "TYPE": "image" 11 | } 12 | ] 13 | }*/ 14 | 15 | void main() { 16 | vec2 normSrcCoord; 17 | 18 | normSrcCoord.x = isf_FragNormCoord[0]; 19 | normSrcCoord.y = isf_FragNormCoord[1]; 20 | 21 | normSrcCoord.x = (1.0-normSrcCoord.x); 22 | 23 | gl_FragColor = IMG_NORM_PIXEL(inputImage, normSrcCoord); 24 | } -------------------------------------------------------------------------------- /test_files/Flip V.fs: -------------------------------------------------------------------------------- 1 | /*{ 2 | "CREDIT": "by VIDVOX", 3 | "ISFVSN": "2", 4 | "CATEGORIES": [ 5 | "Geometry Adjustment" 6 | ], 7 | "INPUTS": [ 8 | { 9 | "NAME": "inputImage", 10 | "TYPE": "image" 11 | } 12 | ] 13 | }*/ 14 | 15 | void main() { 16 | vec2 normSrcCoord; 17 | 18 | normSrcCoord.x = isf_FragNormCoord[0]; 19 | normSrcCoord.y = isf_FragNormCoord[1]; 20 | 21 | normSrcCoord.y = (1.0-normSrcCoord.y); 22 | 23 | gl_FragColor = IMG_NORM_PIXEL(inputImage, normSrcCoord); 24 | } -------------------------------------------------------------------------------- /test_files/Apply Alpha.fs: -------------------------------------------------------------------------------- 1 | /*{ 2 | "CATEGORIES": [ 3 | "Color Adjustment", 4 | "Masking", 5 | "Utility" 6 | ], 7 | "CREDIT": "by VIDVOX", 8 | "INPUTS": [ 9 | { 10 | "NAME": "inputImage", 11 | "TYPE": "image" 12 | } 13 | ], 14 | "ISFVSN": "2" 15 | } 16 | */ 17 | 18 | void main() { 19 | vec4 srcPixel = IMG_THIS_PIXEL(inputImage); 20 | srcPixel.rgb = srcPixel.rgb * srcPixel.a; 21 | srcPixel.a = 1.0; 22 | gl_FragColor = srcPixel; 23 | } -------------------------------------------------------------------------------- /test_files/Test-Event.fs: -------------------------------------------------------------------------------- 1 | /*{ 2 | "DESCRIPTION": "demonstrates the use of an event-type input", 3 | "CREDIT": "by zoidberg", 4 | "ISFVSN": "2.0", 5 | "CATEGORIES": [ 6 | "TEST-GLSL FX" 7 | ], 8 | "INPUTS": [ 9 | { 10 | "NAME": "inputImage", 11 | "TYPE": "image" 12 | }, 13 | { 14 | "NAME": "flashEvent", 15 | "TYPE": "event" 16 | } 17 | ] 18 | }*/ 19 | 20 | void main() 21 | { 22 | vec4 srcPixel = IMG_THIS_PIXEL(inputImage); 23 | gl_FragColor = (flashEvent==true) ? vec4(1.0,1.0,1.0,1.0) : srcPixel; 24 | } 25 | -------------------------------------------------------------------------------- /test_files/Show Alpha.fs: -------------------------------------------------------------------------------- 1 | /*{ 2 | "CATEGORIES": [ 3 | "Utility" 4 | ], 5 | "CREDIT": "VIDVOX", 6 | "DESCRIPTION": "Maps the alpha to grayscale", 7 | "INPUTS": [ 8 | { 9 | "NAME": "inputImage", 10 | "TYPE": "image" 11 | } 12 | ], 13 | "ISFVSN": "2" 14 | } 15 | */ 16 | 17 | void main() { 18 | vec4 inputPixelColor = IMG_THIS_PIXEL(inputImage); 19 | inputPixelColor.rgb = vec3(inputPixelColor.a); 20 | inputPixelColor.a = 1.0; 21 | gl_FragColor = inputPixelColor; 22 | } 23 | -------------------------------------------------------------------------------- /test_files/Minimum Component.fs: -------------------------------------------------------------------------------- 1 | /*{ 2 | "CATEGORIES": [ 3 | "Color Effect", 4 | "Utility" 5 | ], 6 | "CREDIT": "by zoidberg", 7 | "INPUTS": [ 8 | { 9 | "NAME": "inputImage", 10 | "TYPE": "image" 11 | } 12 | ], 13 | "ISFVSN": "2" 14 | } 15 | */ 16 | 17 | void main() { 18 | vec4 srcPixel = IMG_THIS_PIXEL(inputImage); 19 | float minComponent = min(srcPixel.r, min(srcPixel.g, srcPixel.b)); 20 | gl_FragColor = vec4(minComponent, minComponent, minComponent, srcPixel.a); 21 | } -------------------------------------------------------------------------------- /test_files/Test-Bool.fs: -------------------------------------------------------------------------------- 1 | /*{ 2 | "DESCRIPTION": "demonstrates a BOOL-type input on an image filter", 3 | "CREDIT": "by zoidberg", 4 | "ISFVSN": "2.0", 5 | "CATEGORIES": [ 6 | "TEST-GLSL FX" 7 | ], 8 | "INPUTS": [ 9 | { 10 | "NAME": "inputImage", 11 | "TYPE": "image" 12 | }, 13 | { 14 | "NAME": "flashToggle", 15 | "TYPE": "bool", 16 | "DEFAULT": 1.0 17 | } 18 | ] 19 | }*/ 20 | 21 | void main() 22 | { 23 | vec4 srcPixel = IMG_THIS_PIXEL(inputImage); 24 | gl_FragColor = (flashToggle==true) ? vec4(1.0,1.0,1.0,1.0) : srcPixel; 25 | } 26 | -------------------------------------------------------------------------------- /Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "isf" 3 | version = "0.1.0" 4 | authors = ["mitchmindtree "] 5 | description = "Parsing, Deserialization and Serialization of the Interactive Shader Format." 6 | readme = "README.md" 7 | keywords = ["interactive", "shader", "format", "isf", "glsl"] 8 | license = "MIT OR Apache-2.0" 9 | repository = "https://github.com/nannou-org/isf.git" 10 | homepage = "https://github.com/nannou-org/isf" 11 | edition = "2018" 12 | 13 | [dependencies] 14 | serde = { version = "1", features = ["derive"] } 15 | serde_json = "1" 16 | thiserror = "1" 17 | -------------------------------------------------------------------------------- /test_files/Solid Color.fs: -------------------------------------------------------------------------------- 1 | /*{ 2 | "CATEGORIES": [ 3 | "Color", 4 | "Utility" 5 | ], 6 | "CREDIT": "by Carter Rosenberg", 7 | "DESCRIPTION": "demonstrates the use of color-type image inputs", 8 | "INPUTS": [ 9 | { 10 | "DEFAULT": [ 11 | 1, 12 | 0, 13 | 0, 14 | 1 15 | ], 16 | "NAME": "Color", 17 | "TYPE": "color" 18 | } 19 | ], 20 | "ISFVSN": "2" 21 | } 22 | */ 23 | 24 | void main() 25 | { 26 | gl_FragColor = Color; 27 | } 28 | -------------------------------------------------------------------------------- /test_files/Rotate.vs: -------------------------------------------------------------------------------- 1 | #if __VERSION__ <= 120 2 | varying vec2 translated_coord; 3 | #else 4 | out vec2 translated_coord; 5 | #endif 6 | 7 | const float pi = 3.14159265359; 8 | 9 | void main() { 10 | isf_vertShaderInit(); 11 | 12 | vec2 loc = RENDERSIZE * vec2(vv_FragNormCoord[0],vv_FragNormCoord[1]); 13 | float r = distance(RENDERSIZE/2.0, loc); 14 | float a = atan ((loc.y-RENDERSIZE.y/2.0),(loc.x-RENDERSIZE.x/2.0)); 15 | 16 | loc.x = r * cos(a + 2.0 * pi * angle) + 0.5; 17 | loc.y = r * sin(a + 2.0 * pi * angle) + 0.5; 18 | 19 | translated_coord = loc / RENDERSIZE + vec2(0.5); 20 | 21 | } -------------------------------------------------------------------------------- /test_files/Mirror Edge.vs: -------------------------------------------------------------------------------- 1 | #if __VERSION__ <= 120 2 | varying vec2 translated_coord; 3 | #else 4 | out vec2 translated_coord; 5 | #endif 6 | 7 | const float pi = 3.14159265359; 8 | 9 | void main() { 10 | isf_vertShaderInit(); 11 | 12 | vec2 loc = RENDERSIZE * vec2(isf_FragNormCoord[0],isf_FragNormCoord[1]); 13 | 14 | float r = distance(RENDERSIZE/2.0, loc); 15 | float a = atan ((loc.y-RENDERSIZE.y/2.0),(loc.x-RENDERSIZE.x/2.0)); 16 | 17 | loc.x = r * cos(a + 2.0 * pi * angle) + 0.5; 18 | loc.y = r * sin(a + 2.0 * pi * angle) + 0.5; 19 | 20 | translated_coord = loc / RENDERSIZE + vec2(0.5); 21 | 22 | } -------------------------------------------------------------------------------- /LICENSE-APACHE: -------------------------------------------------------------------------------- 1 | Copyright 2020 Nannou Organisation 2 | 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | -------------------------------------------------------------------------------- /test_files/White Point Adjust.fs: -------------------------------------------------------------------------------- 1 | /*{ 2 | "CREDIT": "by zoidberg", 3 | "ISFVSN": "2", 4 | "DESCRIPTION": "Modifies the white point by multiplying the src pixel by the color value", 5 | "CATEGORIES": [ 6 | "Color Adjustment" 7 | ], 8 | "INPUTS": [ 9 | { 10 | "NAME": "inputImage", 11 | "TYPE": "image" 12 | }, 13 | { 14 | "NAME": "newWhite", 15 | "TYPE": "color", 16 | "DEFAULT": [ 17 | 1.0, 18 | 1.0, 19 | 1.0, 20 | 1.0 21 | ] 22 | } 23 | ] 24 | }*/ 25 | 26 | 27 | 28 | void main() { 29 | vec4 tmpColorA = IMG_THIS_PIXEL(inputImage); 30 | gl_FragColor = tmpColorA * newWhite; 31 | } -------------------------------------------------------------------------------- /test_files/Test-ImportedImage.fs: -------------------------------------------------------------------------------- 1 | /*{ 2 | "DESCRIPTION": "demonstrates the use of multiple image-type inputs", 3 | "CREDIT": "by zoidberg", 4 | "ISFVSN": "2.0", 5 | "CATEGORIES": [ 6 | "TEST-GLSL FX" 7 | ], 8 | "INPUTS": [ 9 | { 10 | "NAME": "inputImage", 11 | "TYPE": "image" 12 | } 13 | ], 14 | "IMPORTED": { 15 | "blendImage": { 16 | "PATH": "Hexagon.tiff" 17 | } 18 | } 19 | }*/ 20 | 21 | void main() 22 | { 23 | vec4 srcPixel = IMG_NORM_PIXEL(inputImage, isf_FragNormCoord); 24 | vec4 blendPixel = IMG_NORM_PIXEL(blendImage, isf_FragNormCoord); 25 | 26 | gl_FragColor = (srcPixel + blendPixel)/2.0; 27 | } 28 | -------------------------------------------------------------------------------- /test_files/Test-Float.fs: -------------------------------------------------------------------------------- 1 | /*{ 2 | "DESCRIPTION": "demonstrates the use of float-type inputs", 3 | "CREDIT": "by zoidberg", 4 | "ISFVSN": "2.0", 5 | "CATEGORIES": [ 6 | "TEST-GLSL FX" 7 | ], 8 | "INPUTS": [ 9 | { 10 | "NAME": "inputImage", 11 | "TYPE": "image" 12 | }, 13 | { 14 | "NAME": "level", 15 | "TYPE": "float", 16 | "DEFAULT": 0.5, 17 | "MIN": 0.0, 18 | "MAX": 1.0 19 | } 20 | ] 21 | }*/ 22 | 23 | void main() 24 | { 25 | vec4 srcPixel = IMG_THIS_PIXEL(inputImage); 26 | float luma = (srcPixel.r+srcPixel.g+srcPixel.b)/3.0; 27 | vec4 dstPixel = (luma>level) ? srcPixel : vec4(0,0,0,1); 28 | gl_FragColor = dstPixel; 29 | } 30 | -------------------------------------------------------------------------------- /test_files/Sorting Smear.vs: -------------------------------------------------------------------------------- 1 | #if __VERSION__ <= 120 2 | varying vec2 left_coord; 3 | varying vec2 right_coord; 4 | varying vec2 above_coord; 5 | varying vec2 below_coord; 6 | #else 7 | out vec2 left_coord; 8 | out vec2 right_coord; 9 | out vec2 above_coord; 10 | out vec2 below_coord; 11 | #endif 12 | 13 | 14 | void main() 15 | { 16 | isf_vertShaderInit(); 17 | vec2 texc = vec2(isf_FragNormCoord[0],isf_FragNormCoord[1]); 18 | vec2 d = 1.0/RENDERSIZE; 19 | 20 | left_coord = clamp(vec2(texc.xy + vec2(-d.x , 0)),0.0,1.0); 21 | right_coord = clamp(vec2(texc.xy + vec2(d.x , 0)),0.0,1.0); 22 | above_coord = clamp(vec2(texc.xy + vec2(0,d.y)),0.0,1.0); 23 | below_coord = clamp(vec2(texc.xy + vec2(0,-d.y)),0.0,1.0); 24 | } -------------------------------------------------------------------------------- /test_files/Exposure Adjust.fs: -------------------------------------------------------------------------------- 1 | /*{ 2 | "CREDIT": "by carter rosenberg", 3 | "ISFVSN": "2", 4 | "CATEGORIES": [ 5 | "Color Adjustment" 6 | ], 7 | "INPUTS": [ 8 | { 9 | "NAME": "inputImage", 10 | "TYPE": "image" 11 | }, 12 | { 13 | "NAME": "inputEV", 14 | "TYPE": "float", 15 | "MIN": -10.0, 16 | "MAX": 10.0, 17 | "DEFAULT": 0.5 18 | } 19 | ] 20 | }*/ 21 | 22 | 23 | 24 | void main() { 25 | // based on 26 | // https://developer.apple.com/library/mac/documentation/graphicsimaging/reference/CoreImageFilterReference/Reference/reference.html#//apple_ref/doc/filter/ci/CIExposureAdjust 27 | vec4 tmpColorA = IMG_THIS_PIXEL(inputImage); 28 | tmpColorA.rgb = tmpColorA.rgb * pow(2.0, inputEV); 29 | gl_FragColor = tmpColorA; 30 | } 31 | -------------------------------------------------------------------------------- /test_files/Freeze Frame.fs: -------------------------------------------------------------------------------- 1 | /*{ 2 | "DESCRIPTION": "Holds the output on the captured freeze frame", 3 | "CREDIT": "by VIDVOX", 4 | "ISFVSN": "2", 5 | "CATEGORIES": [ 6 | "Utility" 7 | ], 8 | "INPUTS": [ 9 | { 10 | "NAME": "inputImage", 11 | "TYPE": "image" 12 | }, 13 | { 14 | "NAME": "freeze", 15 | "TYPE": "bool", 16 | "DEFAULT": 0.0 17 | } 18 | ], 19 | "PASSES": [ 20 | { 21 | "TARGET":"freezeBuffer", 22 | "PERSISTENT": true 23 | } 24 | ] 25 | 26 | }*/ 27 | 28 | // Essentially the same as a feedback buffer where you can only set it to a mix of 1.0 29 | 30 | void main() 31 | { 32 | if (freeze) { 33 | gl_FragColor = IMG_THIS_PIXEL(freezeBuffer); 34 | } 35 | else { 36 | gl_FragColor = IMG_THIS_PIXEL(inputImage); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /test_files/Set Alpha.fs: -------------------------------------------------------------------------------- 1 | /*{ 2 | "CATEGORIES": [ 3 | "Color Adjustment", 4 | "Utility" 5 | ], 6 | "CREDIT": "VIDVOX", 7 | "DESCRIPTION": "Sets the alpha channel of the image", 8 | "INPUTS": [ 9 | { 10 | "NAME": "inputImage", 11 | "TYPE": "image" 12 | }, 13 | { 14 | "DEFAULT": 0.5, 15 | "LABEL": "New Alpha", 16 | "MAX": 1, 17 | "MIN": 0, 18 | "NAME": "newAlpha", 19 | "TYPE": "float" 20 | } 21 | ], 22 | "ISFVSN": "2" 23 | } 24 | */ 25 | 26 | void main() { 27 | vec4 inputPixelColor = IMG_THIS_NORM_PIXEL(inputImage); 28 | 29 | inputPixelColor.a = newAlpha; 30 | 31 | gl_FragColor = inputPixelColor; 32 | } 33 | -------------------------------------------------------------------------------- /test_files/VVMotionBlur 3.0.fs: -------------------------------------------------------------------------------- 1 | /*{ 2 | "DESCRIPTION": "this is basically identical to the demonstration of a persistent buffer", 3 | "CREDIT": "by zoidberg", 4 | "ISFVSN": "2", 5 | "CATEGORIES": [ 6 | "Blur" 7 | ], 8 | "INPUTS": [ 9 | { 10 | "NAME": "inputImage", 11 | "TYPE": "image" 12 | }, 13 | { 14 | "NAME": "blurAmount", 15 | "TYPE": "float", 16 | "DEFAULT": 0.0 17 | } 18 | ], 19 | "PASSES": [ 20 | { 21 | "TARGET":"bufferVariableNameA", 22 | "PERSISTENT": true, 23 | "FLOAT": true 24 | }, 25 | { 26 | 27 | } 28 | ] 29 | 30 | }*/ 31 | 32 | void main() 33 | { 34 | vec4 freshPixel = IMG_PIXEL(inputImage,gl_FragCoord.xy); 35 | vec4 stalePixel = IMG_PIXEL(bufferVariableNameA,gl_FragCoord.xy); 36 | gl_FragColor = mix(freshPixel,stalePixel,blurAmount); 37 | } 38 | -------------------------------------------------------------------------------- /test_files/Test-PersistentBuffer.fs: -------------------------------------------------------------------------------- 1 | /*{ 2 | "DESCRIPTION": "demonstrates the use of a persistent buffer to create a motion-blur type effect. also demonstrates the simplest use of steps: a one-step rendering pass", 3 | "CREDIT": "by zoidberg", 4 | "ISFVSN": "2.0", 5 | "CATEGORIES": [ 6 | "TEST-GLSL FX" 7 | ], 8 | "INPUTS": [ 9 | { 10 | "NAME": "inputImage", 11 | "TYPE": "image" 12 | }, 13 | { 14 | "NAME": "blurAmount", 15 | "TYPE": "float" 16 | } 17 | ], 18 | "PASSES": [ 19 | { 20 | "TARGET": "bufferVariableNameA", 21 | "PERSISTENT": true, 22 | "FLOAT": true 23 | } 24 | ] 25 | 26 | }*/ 27 | 28 | void main() 29 | { 30 | vec4 freshPixel = IMG_THIS_PIXEL(inputImage); 31 | vec4 stalePixel = IMG_THIS_PIXEL(bufferVariableNameA); 32 | gl_FragColor = mix(freshPixel,stalePixel,blurAmount); 33 | } 34 | -------------------------------------------------------------------------------- /test_files/Vertex Manipulator.vs: -------------------------------------------------------------------------------- 1 | 2 | 3 | void main() 4 | { 5 | isf_vertShaderInit(); 6 | 7 | vec4 position = gl_Position; 8 | vec4 coord; 9 | if ((position.x<0.0)&&(position.y<0.0)) { 10 | coord.xy = bottomleft / RENDERSIZE; 11 | coord.x = coord.x * 2.0; 12 | coord.y = coord.y * 2.0; 13 | } 14 | else if ((position.x>0.0)&&(position.y<0.0)) { 15 | coord.xy = bottomright / RENDERSIZE; 16 | coord.x = (1.0-coord.x) * -2.0; 17 | coord.y = coord.y * 2.0; 18 | } 19 | else if (position.x<0.0) { 20 | coord.xy = topleft / RENDERSIZE; 21 | coord.x = coord.x * 2.0; 22 | coord.y = (1.0-coord.y) * -2.0; 23 | } 24 | else { 25 | coord.xy = topright / RENDERSIZE; 26 | coord.x = (1.0-coord.x) * -2.0; 27 | coord.y = (1.0-coord.y) * -2.0; 28 | } 29 | gl_Position.xy = position.xy + coord.xy; 30 | 31 | } 32 | -------------------------------------------------------------------------------- /test_files/Histogram Viewer.fs: -------------------------------------------------------------------------------- 1 | /*{ 2 | "CATEGORIES" : [ 3 | "Histogram", "Utility" 4 | ], 5 | "DESCRIPTION": "Draws an RGB histogram from a provided histogram image", 6 | "CREDIT": "by VIDVOX", 7 | "ISFVSN": "2", 8 | "INPUTS": [ 9 | { 10 | "NAME": "histogramImage", 11 | "TYPE": "image" 12 | } 13 | ] 14 | }*/ 15 | 16 | 17 | void main() { 18 | vec4 outColor = vec4(0., 0., 0., 0.); 19 | vec4 histoVals = IMG_NORM_PIXEL(histogramImage, vec2(isf_FragNormCoord.x, 0.5)); 20 | if (histoVals.r >= isf_FragNormCoord.y) { 21 | outColor.r = 1.0; 22 | outColor.a = 1.0; 23 | } 24 | if (histoVals.g >= isf_FragNormCoord.y) { 25 | outColor.g = 1.0; 26 | outColor.a = 1.0; 27 | } 28 | if (histoVals.b >= isf_FragNormCoord.y) { 29 | outColor.b = 1.0; 30 | outColor.a = 1.0; 31 | } 32 | 33 | gl_FragColor = outColor; 34 | 35 | } 36 | -------------------------------------------------------------------------------- /test_files/Color Posterize.fs: -------------------------------------------------------------------------------- 1 | /*{ 2 | "CATEGORIES": [ 3 | "Color Effect", 4 | "Retro" 5 | ], 6 | "CREDIT": "by zoidberg", 7 | "INPUTS": [ 8 | { 9 | "NAME": "inputImage", 10 | "TYPE": "image" 11 | }, 12 | { 13 | "DEFAULT": 30, 14 | "MAX": 30, 15 | "MIN": 2, 16 | "NAME": "levels", 17 | "TYPE": "float" 18 | } 19 | ], 20 | "ISFVSN": "2" 21 | } 22 | */ 23 | 24 | void main() { 25 | // get the src pixel, convert to HSL, posterize the 'L', convert back to RGB 26 | vec4 srcPixel = IMG_THIS_PIXEL(inputImage); 27 | vec4 amountPerLevel = vec4(1.0/levels); 28 | vec4 numOfLevels = floor(srcPixel/amountPerLevel); 29 | vec4 outColor = numOfLevels * (vec4(1.0) / (vec4(levels) - vec4(1.0))); 30 | outColor.a = srcPixel.a; 31 | gl_FragColor = outColor; 32 | } 33 | -------------------------------------------------------------------------------- /test_files/Rotate.fs: -------------------------------------------------------------------------------- 1 | /*{ 2 | "CATEGORIES": [ 3 | "Geometry Adjustment", 4 | "Utility" 5 | ], 6 | "CREDIT": "by VIDVOX", 7 | "INPUTS": [ 8 | { 9 | "NAME": "inputImage", 10 | "TYPE": "image" 11 | }, 12 | { 13 | "DEFAULT": 0, 14 | "MAX": 1, 15 | "MIN": 0, 16 | "NAME": "angle", 17 | "TYPE": "float" 18 | } 19 | ], 20 | "ISFVSN": "2" 21 | } 22 | */ 23 | 24 | #if __VERSION__ <= 120 25 | varying vec2 translated_coord; 26 | #else 27 | in vec2 translated_coord; 28 | #endif 29 | 30 | void main() { 31 | vec2 loc = translated_coord; 32 | // if out of range draw black 33 | if ((loc.x < 0.0)||(loc.y < 0.0)||(loc.x > 1.0)||(loc.y > 1.0)) { 34 | gl_FragColor = vec4(0.0); 35 | } 36 | else { 37 | gl_FragColor = IMG_NORM_PIXEL(inputImage,loc); 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /test_files/False Color.fs: -------------------------------------------------------------------------------- 1 | /*{ 2 | "CREDIT": "by zoidberg", 3 | "ISFVSN": "2", 4 | "CATEGORIES": [ 5 | "Color Effect" 6 | ], 7 | "INPUTS": [ 8 | { 9 | "NAME": "inputImage", 10 | "TYPE": "image" 11 | }, 12 | { 13 | "NAME": "brightColor", 14 | "TYPE": "color", 15 | "DEFAULT": [ 16 | 1.0, 17 | 0.9, 18 | 0.8, 19 | 1.0 20 | ] 21 | }, 22 | { 23 | "NAME": "darkColor", 24 | "TYPE": "color", 25 | "DEFAULT": [ 26 | 0.3, 27 | 0.0, 28 | 0.0, 29 | 1.0 30 | ] 31 | } 32 | ] 33 | }*/ 34 | 35 | //const vec4 lumcoeff = vec4(0.299, 0.587, 0.114, 0.0); 36 | const vec4 lumcoeff = vec4(0.2126, 0.7152, 0.0722, 0.0); 37 | 38 | void main() { 39 | vec4 srcPixel = IMG_THIS_PIXEL(inputImage); 40 | float luminance = dot(srcPixel,lumcoeff); 41 | gl_FragColor = mix(vec4(darkColor.rgb, srcPixel.a), vec4(brightColor.rgb, srcPixel.a), luminance); 42 | } 43 | -------------------------------------------------------------------------------- /test_files/Test-Point.fs: -------------------------------------------------------------------------------- 1 | /*{ 2 | "DESCRIPTION": "demonstrates the use of a 2d point-type input", 3 | "CREDIT": "by zoidberg", 4 | "ISFVSN": "2.0", 5 | "CATEGORIES": [ 6 | "TEST-GLSL FX" 7 | ], 8 | "INPUTS": [ 9 | { 10 | "NAME": "inputImage", 11 | "TYPE": "image" 12 | }, 13 | { 14 | "NAME": "location", 15 | "TYPE": "point2D", 16 | "DEFAULT": [ 17 | 0, 18 | 0 19 | ] 20 | }, 21 | { 22 | "NAME": "locationB", 23 | "TYPE": "point2D", 24 | "DEFAULT": [ 25 | 0, 26 | 0 27 | ], 28 | "MIN": [ 29 | 0, 30 | 0 31 | ], 32 | "MAX": [ 33 | 1920, 34 | 1080 35 | ] 36 | } 37 | ] 38 | }*/ 39 | 40 | void main() 41 | { 42 | vec4 srcPixel = IMG_THIS_PIXEL(inputImage); 43 | if (abs(gl_FragCoord.xy.x-location.x)<10.0 && abs(gl_FragCoord.xy.y-location.y)<10.0) 44 | gl_FragColor = vec4(1,1,1,1); 45 | else 46 | gl_FragColor = srcPixel; 47 | } 48 | -------------------------------------------------------------------------------- /test_files/Deinterlace.fs: -------------------------------------------------------------------------------- 1 | /*{ 2 | "CATEGORIES": [ 3 | "Utility" 4 | ], 5 | "CREDIT": "by zoidberg", 6 | "INPUTS": [ 7 | { 8 | "NAME": "inputImage", 9 | "TYPE": "image" 10 | } 11 | ], 12 | "ISFVSN": "2" 13 | } 14 | */ 15 | 16 | const vec2 pointOffset = vec2(0.0, 1.0); 17 | 18 | void main() { 19 | vec4 outColor; 20 | // "upper" (a.k.a. "the top row") 21 | if (fract((gl_FragCoord.y+0.5)/2.0) == 0.0) { 22 | //gl_FragColor = vec4(1,0,0,1); 23 | outColor = (IMG_PIXEL(inputImage, gl_FragCoord.xy) + IMG_PIXEL(inputImage, gl_FragCoord.xy - pointOffset))/2.0; 24 | gl_FragColor = outColor; 25 | } 26 | // "lower" (a.k.a. "the bottom row") 27 | else { 28 | //gl_FragColor = vec4(0,1,0,1); 29 | outColor = (IMG_PIXEL(inputImage, gl_FragCoord.xy) + IMG_PIXEL(inputImage, gl_FragCoord.xy + pointOffset))/2.0; 30 | gl_FragColor = outColor; 31 | } 32 | } -------------------------------------------------------------------------------- /test_files/Heart.fs: -------------------------------------------------------------------------------- 1 | /*{ 2 | "CREDIT": "by VIDVOX", 3 | "ISFVSN": "2", 4 | "CATEGORIES": [ 5 | "Geometry" 6 | ], 7 | "INPUTS": [ 8 | { 9 | "NAME": "size", 10 | "LABEL": "Size", 11 | "TYPE": "float", 12 | "MIN": 0.0, 13 | "MAX": 1.0, 14 | "DEFAULT": 0.25 15 | }, 16 | { 17 | "NAME": "color", 18 | "LABEL": "Fill Color", 19 | "TYPE": "color", 20 | "DEFAULT": [ 21 | 1.0, 22 | 0.0, 23 | 0.0, 24 | 1.0 25 | ] 26 | } 27 | ] 28 | }*/ 29 | 30 | 31 | // Adapted from https://glsl.io/transition/d71472a550601b96d69d 32 | 33 | 34 | bool inHeart (vec2 p, vec2 center, float size) { 35 | if (size == 0.0) return false; 36 | vec2 o = (p-center)/(1.6*size); 37 | return pow(o.x*o.x+o.y*o.y-0.3, 3.0) < o.x*o.x*pow(o.y, 3.0); 38 | } 39 | 40 | void main() { 41 | vec2 p = isf_FragNormCoord; 42 | float m = inHeart(p, vec2(0.5, 0.4), size) ? 1.0 : 0.0; 43 | gl_FragColor = mix(vec4(0.0), color, m); 44 | } -------------------------------------------------------------------------------- /test_files/Test-Long.fs: -------------------------------------------------------------------------------- 1 | /*{ 2 | "DESCRIPTION": "demonstrates the use of long-type inputs as pop-up buttons to display either the red, green, or blue channel of an image", 3 | "CREDIT": "by zoidberg", 4 | "ISFVSN": "2.0", 5 | "CATEGORIES": [ 6 | "TEST-GLSL FX" 7 | ], 8 | "INPUTS": [ 9 | { 10 | "NAME": "inputImage", 11 | "TYPE": "image" 12 | }, 13 | { 14 | "NAME": "longInputIsPopUpButton", 15 | "VALUES": [ 16 | 0, 17 | 1, 18 | 2 19 | ], 20 | "LABELS": [ 21 | "red", 22 | "green", 23 | "blue" 24 | ], 25 | "DEFAULT": 1, 26 | "TYPE": "long" 27 | } 28 | ] 29 | }*/ 30 | 31 | void main() 32 | { 33 | vec4 srcPixel = IMG_THIS_PIXEL(inputImage); 34 | if (longInputIsPopUpButton == 0) 35 | gl_FragColor = srcPixel.rrra; 36 | else if (longInputIsPopUpButton == 1) 37 | gl_FragColor = srcPixel.ggga; 38 | else if (longInputIsPopUpButton == 2) 39 | gl_FragColor = srcPixel.bbba; 40 | } 41 | -------------------------------------------------------------------------------- /test_files/Gamma Correction.fs: -------------------------------------------------------------------------------- 1 | /*{ 2 | "CREDIT": "by zoidberg", 3 | "ISFVSN": "2", 4 | "CATEGORIES": [ 5 | "Color Adjustment", "Utility" 6 | ], 7 | "INPUTS": [ 8 | { 9 | "NAME": "inputImage", 10 | "TYPE": "image" 11 | }, 12 | { 13 | "NAME": "gamma", 14 | "TYPE": "float", 15 | "MIN": 0.0, 16 | "MAX": 1.0, 17 | "DEFAULT": 0.5 18 | } 19 | ] 20 | }*/ 21 | 22 | 23 | 24 | void main() { 25 | // the input gamma range is 0.0-1.0 (normalized). the actual gamma range i want to use is 0.0 - 5.0. 26 | // however, actual gamma 0.0-1.0 is just as interesting as actual gamma 1.0-5.0, so we scale the normalized input to match... 27 | float realGamma = (gamma<=0.5) ? (gamma * 2.0) : (((gamma-0.5) * 2.0 * 4.0) + 1.0); 28 | vec4 tmpColorA = IMG_THIS_PIXEL(inputImage); 29 | vec4 tmpColorB; 30 | tmpColorB.rgb = pow(tmpColorA.rgb, vec3(1.0/realGamma)); 31 | tmpColorB.a = tmpColorA.a; 32 | gl_FragColor = tmpColorB; 33 | } 34 | -------------------------------------------------------------------------------- /test_files/Test-Color.fs: -------------------------------------------------------------------------------- 1 | /*{ 2 | "DESCRIPTION": "demonstrates the use of color-type image inputs", 3 | "CREDIT": "by zoidberg", 4 | "ISFVSN": "2.0", 5 | "CATEGORIES": [ 6 | "TEST-GLSL FX" 7 | ], 8 | "INPUTS": [ 9 | { 10 | "NAME": "inputImage", 11 | "TYPE": "image" 12 | }, 13 | { 14 | "NAME": "level", 15 | "TYPE": "float", 16 | "DEFAULT": 0.5, 17 | "MIN": 0.0, 18 | "MAX": 1.0 19 | }, 20 | { 21 | "NAME": "lowColor", 22 | "TYPE": "color", 23 | "DEFAULT": [ 24 | 0.0, 25 | 0.0, 26 | 1.0, 27 | 1.0 28 | ] 29 | }, 30 | { 31 | "NAME": "highColor", 32 | "TYPE": "color", 33 | "DEFAULT": [ 34 | 1.0, 35 | 1.0, 36 | 1.0, 37 | 1.0 38 | ] 39 | } 40 | ] 41 | }*/ 42 | 43 | void main() 44 | { 45 | vec4 srcPixel = IMG_THIS_PIXEL(inputImage); 46 | vec4 dstPixel = ((srcPixel.r+srcPixel.g+srcPixel.b)/3.0>level) ? lowColor : highColor; 47 | gl_FragColor = dstPixel; 48 | } 49 | -------------------------------------------------------------------------------- /test_files/Emboss.vs: -------------------------------------------------------------------------------- 1 | #if __VERSION__ <= 120 2 | varying vec2 left_coord; 3 | varying vec2 right_coord; 4 | varying vec2 above_coord; 5 | varying vec2 below_coord; 6 | 7 | varying vec2 lefta_coord; 8 | varying vec2 rightb_coord; 9 | #else 10 | out vec2 left_coord; 11 | out vec2 right_coord; 12 | out vec2 above_coord; 13 | out vec2 below_coord; 14 | 15 | out vec2 lefta_coord; 16 | out vec2 rightb_coord; 17 | #endif 18 | 19 | 20 | void main() 21 | { 22 | isf_vertShaderInit(); 23 | vec2 texc = vec2(isf_FragNormCoord[0],isf_FragNormCoord[1]); 24 | vec2 d = 1.0/RENDERSIZE; 25 | 26 | left_coord = clamp(vec2(texc.xy + vec2(-d.x , 0)),0.0,1.0); 27 | right_coord = clamp(vec2(texc.xy + vec2(d.x , 0)),0.0,1.0); 28 | above_coord = clamp(vec2(texc.xy + vec2(0,d.y)),0.0,1.0); 29 | below_coord = clamp(vec2(texc.xy + vec2(0,-d.y)),0.0,1.0); 30 | 31 | lefta_coord = clamp(vec2(texc.xy + vec2(-d.x , d.x)),0.0,1.0); 32 | rightb_coord = clamp(vec2(texc.xy + vec2(d.x , -d.x)),0.0,1.0); 33 | } -------------------------------------------------------------------------------- /test_files/Color Relookup.fs: -------------------------------------------------------------------------------- 1 | /*{ 2 | "CREDIT": "by VIDVOX", 3 | "ISFVSN": "2", 4 | "CATEGORIES": [ 5 | "Glitch" 6 | ], 7 | "INPUTS": [ 8 | { 9 | "NAME": "inputImage", 10 | "TYPE": "image" 11 | }, 12 | { 13 | "NAME": "lookupImage", 14 | "TYPE": "image" 15 | }, 16 | { 17 | "NAME": "mix_amount", 18 | "TYPE": "float", 19 | "MIN": 0.0, 20 | "MAX": 1.0, 21 | "DEFAULT": 0.5 22 | } 23 | ] 24 | }*/ 25 | 26 | void main() { 27 | vec4 thisColor = IMG_THIS_PIXEL(inputImage); 28 | vec2 lookupCoord; 29 | lookupCoord.x = mix (thisColor.r, thisColor.g, mix_amount); 30 | lookupCoord.x = mix (lookupCoord.x, thisColor.b, mix_amount); 31 | lookupCoord.x = RENDERSIZE.x * lookupCoord.x / 255.0; 32 | 33 | lookupCoord.y = mix (thisColor.r, thisColor.g, mix_amount); 34 | lookupCoord.y = mix (lookupCoord.y, thisColor.b, mix_amount); 35 | lookupCoord.y = RENDERSIZE.y * lookupCoord.y / 255.0; 36 | 37 | gl_FragColor = IMG_NORM_PIXEL(lookupImage, lookupCoord); 38 | } -------------------------------------------------------------------------------- /test_files/Mirror.fs: -------------------------------------------------------------------------------- 1 | /*{ 2 | "CREDIT": "by VIDVOX", 3 | "ISFVSN": "2", 4 | "CATEGORIES": [ 5 | "Geometry Adjustment" 6 | ], 7 | "INPUTS": [ 8 | { 9 | "NAME": "inputImage", 10 | "TYPE": "image" 11 | }, 12 | { 13 | "NAME": "horizontal", 14 | "TYPE": "bool", 15 | "DEFAULT": 1.0 16 | }, 17 | { 18 | "NAME": "vertical", 19 | "TYPE": "bool", 20 | "DEFAULT": 0.0 21 | } 22 | ] 23 | }*/ 24 | 25 | void main() { 26 | // isf_FragNormCoord[0] and isf_FragNormCoord[1] are my normalized x/y coordinates 27 | // if we're not doing a flip in either direction we can just pass thru 28 | vec2 normSrcCoord; 29 | 30 | normSrcCoord.x = isf_FragNormCoord[0]; 31 | normSrcCoord.y = isf_FragNormCoord[1]; 32 | 33 | if ((normSrcCoord.x > 0.5)&&(horizontal)) { 34 | normSrcCoord.x = (1.0-normSrcCoord.x); 35 | } 36 | if ((normSrcCoord.y > 0.5)&&(vertical)) { 37 | normSrcCoord.y = (1.0-normSrcCoord.y); 38 | } 39 | 40 | gl_FragColor = IMG_NORM_PIXEL(inputImage, normSrcCoord); 41 | } -------------------------------------------------------------------------------- /tests/parse.rs: -------------------------------------------------------------------------------- 1 | // Check that we can parse and deserialize every test file. 2 | #[test] 3 | fn parse_test_files() { 4 | let test_files_path = std::path::Path::new(env!("CARGO_MANIFEST_DIR")).join("test_files"); 5 | assert!(test_files_path.exists()); 6 | assert!(test_files_path.is_dir()); 7 | for entry in std::fs::read_dir(test_files_path).unwrap() { 8 | let entry = entry.unwrap(); 9 | let path = entry.path(); 10 | let ext = path.extension().and_then(|s| s.to_str()); 11 | if ext == Some("fs") || ext == Some("vs") { 12 | let glsl_str = std::fs::read_to_string(&path).unwrap(); 13 | let _isf = match isf::parse(&glsl_str) { 14 | // Ignore non-ISF vertex shaders. 15 | Err(isf::ParseError::MissingTopComment) if ext == Some("vs") => continue, 16 | Err(err) => panic!("err while parsing {}: {}", path.display(), err), 17 | Ok(isf) => isf, 18 | }; 19 | } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /test_files/3d Rotate.fs: -------------------------------------------------------------------------------- 1 | /*{ 2 | "DESCRIPTION": "performs a 3d rotation", 3 | "CREDIT": "by zoidberg", 4 | "ISFVSN": "2", 5 | "CATEGORIES": [ 6 | "Geometry Adjustment", "Utility" 7 | ], 8 | "INPUTS": [ 9 | { 10 | "NAME": "inputImage", 11 | "TYPE": "image" 12 | }, 13 | { 14 | "NAME": "xrot", 15 | "LABEL": "X rotate", 16 | "TYPE": "float", 17 | "MIN": 0.0, 18 | "MAX": 2.0, 19 | "DEFAULT": 1.0 20 | }, 21 | { 22 | "NAME": "yrot", 23 | "LABEL": "Y rotate", 24 | "TYPE": "float", 25 | "MIN": 0.0, 26 | "MAX": 2.0, 27 | "DEFAULT": 1.0 28 | }, 29 | { 30 | "NAME": "zrot", 31 | "LABEL": "Z rotate", 32 | "TYPE": "float", 33 | "MIN": 0.0, 34 | "MAX": 2.0, 35 | "DEFAULT": 1.0 36 | }, 37 | { 38 | "NAME": "zoom", 39 | "LABEL": "Zoom Level", 40 | "TYPE": "float", 41 | "MIN": 0.0, 42 | "MAX": 1.0, 43 | "DEFAULT": 1.0 44 | } 45 | ] 46 | }*/ 47 | 48 | 49 | void main() 50 | { 51 | gl_FragColor = IMG_THIS_PIXEL(inputImage); 52 | } 53 | -------------------------------------------------------------------------------- /test_files/Fade.fs: -------------------------------------------------------------------------------- 1 | /* 2 | { 3 | "INPUTS" : [ 4 | { 5 | "TYPE" : "image", 6 | "NAME" : "startImage" 7 | }, 8 | { 9 | "NAME" : "endImage", 10 | "TYPE" : "image" 11 | }, 12 | { 13 | "MAX" : 1, 14 | "TYPE" : "float", 15 | "MIN" : 0, 16 | "NAME" : "progress", 17 | "DEFAULT" : 0 18 | } 19 | ], 20 | "CREDIT": "Automatically converted from https://www.github.com/gl-transitions/gl-transitions/tree/master/fade.glsl", 21 | "DESCRIPTION": "", 22 | "CATEGORIES" : [ 23 | "Dissolve" 24 | ], 25 | "ISFVSN" : "2" 26 | } 27 | */ 28 | 29 | 30 | 31 | vec4 getFromColor(vec2 inUV) { 32 | return IMG_NORM_PIXEL(startImage, inUV); 33 | } 34 | vec4 getToColor(vec2 inUV) { 35 | return IMG_NORM_PIXEL(endImage, inUV); 36 | } 37 | 38 | 39 | 40 | // author: gre 41 | // license: MIT 42 | 43 | vec4 transition (vec2 uv) { 44 | return mix( 45 | getFromColor(uv), 46 | getToColor(uv), 47 | progress 48 | ); 49 | } 50 | 51 | 52 | 53 | void main() { 54 | gl_FragColor = transition(isf_FragNormCoord.xy); 55 | } -------------------------------------------------------------------------------- /test_files/Interlace Mirror.fs: -------------------------------------------------------------------------------- 1 | /*{ 2 | "CATEGORIES": [ 3 | "Glitch", 4 | "Retro" 5 | ], 6 | "CREDIT": "by Carter Rosenberg", 7 | "DESCRIPTION": "", 8 | "INPUTS": [ 9 | { 10 | "NAME": "inputImage", 11 | "TYPE": "image" 12 | }, 13 | { 14 | "DEFAULT": 1, 15 | "LABEL": "Horizontal", 16 | "NAME": "horizontal", 17 | "TYPE": "bool" 18 | }, 19 | { 20 | "DEFAULT": 0, 21 | "LABEL": "Vertical", 22 | "NAME": "vertical", 23 | "TYPE": "bool" 24 | } 25 | ], 26 | "ISFVSN": "2" 27 | } 28 | */ 29 | 30 | void main() 31 | { 32 | vec2 pixelCoord = isf_FragNormCoord * RENDERSIZE; 33 | vec2 loc = pixelCoord; 34 | if (vertical) { 35 | if (mod(pixelCoord.x,2.0)>1.0) { 36 | loc.y = RENDERSIZE.y - pixelCoord.y; 37 | } 38 | } 39 | if (horizontal) { 40 | if (mod(pixelCoord.y,2.0)>1.0) { 41 | loc.x = RENDERSIZE.x - pixelCoord.x; 42 | } 43 | } 44 | gl_FragColor = IMG_PIXEL(inputImage,loc); 45 | } 46 | -------------------------------------------------------------------------------- /test_files/Life.vs: -------------------------------------------------------------------------------- 1 | #if __VERSION__ <= 120 2 | varying vec2 left_coord; 3 | varying vec2 right_coord; 4 | varying vec2 above_coord; 5 | varying vec2 below_coord; 6 | 7 | varying vec2 lefta_coord; 8 | varying vec2 righta_coord; 9 | varying vec2 leftb_coord; 10 | varying vec2 rightb_coord; 11 | #else 12 | out vec2 left_coord; 13 | out vec2 right_coord; 14 | out vec2 above_coord; 15 | out vec2 below_coord; 16 | 17 | out vec2 lefta_coord; 18 | out vec2 righta_coord; 19 | out vec2 leftb_coord; 20 | out vec2 rightb_coord; 21 | #endif 22 | 23 | 24 | void main() 25 | { 26 | isf_vertShaderInit(); 27 | vec2 texc = vec2(isf_FragNormCoord[0],isf_FragNormCoord[1]) * RENDERSIZE; 28 | 29 | left_coord = vec2(texc.xy + vec2(-1.0 , 0)); 30 | right_coord = vec2(texc.xy + vec2(1.0 , 0)); 31 | above_coord = vec2(texc.xy + vec2(0,1.0)); 32 | below_coord = vec2(texc.xy + vec2(0,-1.0)); 33 | 34 | lefta_coord = vec2(texc.xy + vec2(-1.0 , 1.0)); 35 | righta_coord = vec2(texc.xy + vec2(1.0 , 1.0)); 36 | leftb_coord = vec2(texc.xy + vec2(-1.0 , -1.0)); 37 | rightb_coord = vec2(texc.xy + vec2(1.0 , -1.0)); 38 | } -------------------------------------------------------------------------------- /test_files/RGB Invert.fs: -------------------------------------------------------------------------------- 1 | /*{ 2 | "CATEGORIES": [ 3 | "Color Effect", 4 | "Utility" 5 | ], 6 | "CREDIT": "by VIDVOX", 7 | "INPUTS": [ 8 | { 9 | "NAME": "inputImage", 10 | "TYPE": "image" 11 | }, 12 | { 13 | "DEFAULT": 1, 14 | "NAME": "r", 15 | "TYPE": "bool" 16 | }, 17 | { 18 | "DEFAULT": 1, 19 | "NAME": "g", 20 | "TYPE": "bool" 21 | }, 22 | { 23 | "DEFAULT": 1, 24 | "NAME": "b", 25 | "TYPE": "bool" 26 | }, 27 | { 28 | "DEFAULT": 0, 29 | "NAME": "a", 30 | "TYPE": "bool" 31 | } 32 | ], 33 | "ISFVSN": "2" 34 | } 35 | */ 36 | 37 | void main() { 38 | vec4 srcPixel = IMG_THIS_PIXEL(inputImage); 39 | if (r) 40 | srcPixel.r = 1.0-srcPixel.r; 41 | if (g) 42 | srcPixel.g = 1.0-srcPixel.g; 43 | if (b) 44 | srcPixel.b = 1.0-srcPixel.b; 45 | if (a) 46 | srcPixel.a = 1.0-srcPixel.a; 47 | gl_FragColor = srcPixel; 48 | } -------------------------------------------------------------------------------- /test_files/Posterize.fs: -------------------------------------------------------------------------------- 1 | /*{ 2 | "CATEGORIES": [ 3 | "Retro", 4 | "Stylize", 5 | "Color Effect" 6 | ], 7 | "CREDIT": "VIDVOX", 8 | "DESCRIPTION": "Posterizes an image", 9 | "INPUTS": [ 10 | { 11 | "NAME": "inputImage", 12 | "TYPE": "image" 13 | }, 14 | { 15 | "DEFAULT": 1.25, 16 | "LABEL": "Gamma", 17 | "MAX": 2, 18 | "MIN": 0.5, 19 | "NAME": "gamma", 20 | "TYPE": "float" 21 | }, 22 | { 23 | "DEFAULT": 6, 24 | "LABEL": "Quality", 25 | "MAX": 32, 26 | "MIN": 3, 27 | "NAME": "numColors", 28 | "TYPE": "float" 29 | } 30 | ], 31 | "ISFVSN": "2" 32 | } 33 | */ 34 | 35 | void main() { 36 | 37 | vec4 c = IMG_THIS_PIXEL(inputImage); 38 | 39 | c.rgb = pow(c.rgb, vec3(gamma, gamma, gamma)); 40 | c.rgb = c.rgb * numColors; 41 | c.rgb = floor(c.rgb); 42 | c.rgb = c.rgb / numColors; 43 | c.rgb = pow(c.rgb, vec3(1.0/gamma)); 44 | 45 | gl_FragColor = c; 46 | } 47 | -------------------------------------------------------------------------------- /test_files/Wipe Up.fs: -------------------------------------------------------------------------------- 1 | /* 2 | { 3 | "CATEGORIES" : [ 4 | "Wipe" 5 | ], 6 | "CREDIT": "Automatically converted from https://www.github.com/gl-transitions/gl-transitions/tree/master/wipeUp.glsl", 7 | "DESCRIPTION": "", 8 | "ISFVSN" : "2", 9 | "INPUTS" : [ 10 | { 11 | "TYPE" : "image", 12 | "NAME" : "startImage" 13 | }, 14 | { 15 | "NAME" : "endImage", 16 | "TYPE" : "image" 17 | }, 18 | { 19 | "MIN" : 0, 20 | "TYPE" : "float", 21 | "NAME" : "progress", 22 | "MAX" : 1, 23 | "DEFAULT" : 0 24 | } 25 | ] 26 | } 27 | */ 28 | 29 | 30 | 31 | vec4 getFromColor(vec2 inUV) { 32 | return IMG_NORM_PIXEL(startImage, inUV); 33 | } 34 | vec4 getToColor(vec2 inUV) { 35 | return IMG_NORM_PIXEL(endImage, inUV); 36 | } 37 | 38 | 39 | 40 | // Author: Jake Nelson 41 | // License: MIT 42 | 43 | vec4 transition(vec2 uv) { 44 | vec2 p=uv.xy/vec2(1.0).xy; 45 | vec4 a=getFromColor(p); 46 | vec4 b=getToColor(p); 47 | return mix(a, b, step(0.0+p.y,progress)); 48 | } 49 | 50 | 51 | 52 | void main() { 53 | gl_FragColor = transition(isf_FragNormCoord.xy); 54 | } -------------------------------------------------------------------------------- /test_files/Wipe Left.fs: -------------------------------------------------------------------------------- 1 | /* 2 | { 3 | "INPUTS" : [ 4 | { 5 | "TYPE" : "image", 6 | "NAME" : "startImage" 7 | }, 8 | { 9 | "TYPE" : "image", 10 | "NAME" : "endImage" 11 | }, 12 | { 13 | "TYPE" : "float", 14 | "MAX" : 1, 15 | "NAME" : "progress", 16 | "MIN" : 0, 17 | "DEFAULT" : 0 18 | } 19 | ], 20 | "CATEGORIES" : [ 21 | "Wipe" 22 | ], 23 | "CREDIT": "Automatically converted from https://www.github.com/gl-transitions/gl-transitions/tree/master/wipeLeft.glsl", 24 | "DESCRIPTION": "", 25 | "ISFVSN" : "2" 26 | } 27 | */ 28 | 29 | 30 | 31 | vec4 getFromColor(vec2 inUV) { 32 | return IMG_NORM_PIXEL(startImage, inUV); 33 | } 34 | vec4 getToColor(vec2 inUV) { 35 | return IMG_NORM_PIXEL(endImage, inUV); 36 | } 37 | 38 | 39 | 40 | // Author: Jake Nelson 41 | // License: MIT 42 | 43 | vec4 transition(vec2 uv) { 44 | vec2 p=uv.xy/vec2(1.0).xy; 45 | vec4 a=getFromColor(p); 46 | vec4 b=getToColor(p); 47 | return mix(a, b, step(1.0-p.x,progress)); 48 | } 49 | 50 | 51 | 52 | void main() { 53 | gl_FragColor = transition(isf_FragNormCoord.xy); 54 | } -------------------------------------------------------------------------------- /test_files/Wipe Right.fs: -------------------------------------------------------------------------------- 1 | /* 2 | { 3 | "INPUTS" : [ 4 | { 5 | "TYPE" : "image", 6 | "NAME" : "startImage" 7 | }, 8 | { 9 | "TYPE" : "image", 10 | "NAME" : "endImage" 11 | }, 12 | { 13 | "TYPE" : "float", 14 | "MAX" : 1, 15 | "NAME" : "progress", 16 | "MIN" : 0, 17 | "DEFAULT" : 0 18 | } 19 | ], 20 | "CATEGORIES" : [ 21 | "Wipe" 22 | ], 23 | "CREDIT": "Automatically converted from https://www.github.com/gl-transitions/gl-transitions/tree/master/wipeRight.glsl", 24 | "DESCRIPTION": "", 25 | "ISFVSN" : "2" 26 | } 27 | */ 28 | 29 | 30 | 31 | vec4 getFromColor(vec2 inUV) { 32 | return IMG_NORM_PIXEL(startImage, inUV); 33 | } 34 | vec4 getToColor(vec2 inUV) { 35 | return IMG_NORM_PIXEL(endImage, inUV); 36 | } 37 | 38 | 39 | 40 | // Author: Jake Nelson 41 | // License: MIT 42 | 43 | vec4 transition(vec2 uv) { 44 | vec2 p=uv.xy/vec2(1.0).xy; 45 | vec4 a=getFromColor(p); 46 | vec4 b=getToColor(p); 47 | return mix(a, b, step(0.0+p.x,progress)); 48 | } 49 | 50 | 51 | 52 | void main() { 53 | gl_FragColor = transition(isf_FragNormCoord.xy); 54 | } -------------------------------------------------------------------------------- /test_files/Test-Audio.fs: -------------------------------------------------------------------------------- 1 | /* 2 | { 3 | "CATEGORIES" : [ 4 | "Generator" 5 | ], 6 | "DESCRIPTION" : "Visualizes an FFT analysis image with custom set colors for frequency domain", 7 | "INPUTS" : [ 8 | { 9 | "NAME" : "waveImage", 10 | "TYPE" : "audio" 11 | }, 12 | { 13 | "NAME" : "waveSize", 14 | "TYPE" : "float", 15 | "MAX" : 0.5, 16 | "DEFAULT" : 0.05, 17 | "MIN" : 0 18 | }, 19 | { 20 | "NAME" : "stereo", 21 | "TYPE" : "bool", 22 | "DEFAULT" : 1 23 | } 24 | ], 25 | "CREDIT" : "by VIDVOX" 26 | } 27 | */ 28 | 29 | 30 | 31 | void main() { 32 | 33 | vec2 loc = vec2(vv_FragNormCoord[1], vv_FragNormCoord[0]); 34 | 35 | vec2 rawSize = IMG_SIZE(waveImage); 36 | float channel = 0.5; 37 | float offset = 0.0; 38 | if (stereo == true) { 39 | channel = (loc.x > 0.5) ? 0.0 : 1.0; 40 | offset = (loc.x > 0.5) ? 0.25 : -0.25; 41 | } 42 | 43 | vec2 waveLoc = vec2(loc.y,channel); 44 | vec4 wave = IMG_NORM_PIXEL(waveImage, waveLoc)+offset; 45 | vec4 waveAdd = (1.0 - smoothstep(0.0, waveSize, abs(wave - loc.x))); 46 | waveAdd.a = 1.0; 47 | gl_FragColor = waveAdd; 48 | } -------------------------------------------------------------------------------- /LICENSE-MIT: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2020 Nannou Organisation. 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /test_files/Test-MultiPassRendering.fs: -------------------------------------------------------------------------------- 1 | /*{ 2 | "DESCRIPTION": "demonstrates the use of two-pass rendering- the first pass renders to a persistent buffer which is substantially smaller than the res of the image being drawn. the second pass renders at the default requested size and scales up the image from the first pass", 3 | "CREDIT": "by zoidberg", 4 | "ISFVSN": "2.0", 5 | "CATEGORIES": [ 6 | "TEST-GLSL FX" 7 | ], 8 | "INPUTS": [ 9 | { 10 | "NAME": "inputImage", 11 | "TYPE": "image" 12 | } 13 | ], 14 | "PASSES": [ 15 | { 16 | "TARGET":"bufferVariableNameA", 17 | "PERSISTENT": true, 18 | "WIDTH": "$WIDTH/16.0", 19 | "HEIGHT": "$HEIGHT/16.0" 20 | }, 21 | { 22 | 23 | } 24 | ] 25 | 26 | }*/ 27 | 28 | void main() 29 | { 30 | // first pass: read the "inputImage"- remember, we're drawing to the persistent buffer "bufferVariableNameA" on the first pass 31 | if (PASSINDEX == 0) { 32 | gl_FragColor = IMG_THIS_NORM_PIXEL(inputImage); 33 | } 34 | // second pass: read from "bufferVariableNameA". output looks chunky and low-res. 35 | else if (PASSINDEX == 1) { 36 | gl_FragColor = IMG_THIS_NORM_PIXEL(bufferVariableNameA); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /test_files/v002 Dilate.vs: -------------------------------------------------------------------------------- 1 | 2 | #if __VERSION__ <= 120 3 | varying vec2 texcoord0; 4 | varying vec2 texcoord1; 5 | varying vec2 texcoord2; 6 | varying vec2 texcoord3; 7 | varying vec2 texcoord4; 8 | varying vec2 texcoord5; 9 | varying vec2 texcoord6; 10 | varying vec2 texcoord7; 11 | #else 12 | out vec2 texcoord0; 13 | out vec2 texcoord1; 14 | out vec2 texcoord2; 15 | out vec2 texcoord3; 16 | out vec2 texcoord4; 17 | out vec2 texcoord5; 18 | out vec2 texcoord6; 19 | out vec2 texcoord7; 20 | #endif 21 | 22 | void main() 23 | { 24 | isf_vertShaderInit(); 25 | // perform standard transform on vertex 26 | //gl_Position = ftransform(); 27 | 28 | // transform texcoord 29 | vec2 texcoord = vec2(isf_FragNormCoord[0],isf_FragNormCoord[1]); 30 | 31 | // get sample positions 32 | texcoord0 = texcoord + vec2(-amount, -amount); 33 | texcoord1 = texcoord + vec2( 0, -amount); 34 | texcoord2 = texcoord + vec2( amount, -amount); 35 | texcoord3 = texcoord + vec2(-amount, 0); 36 | texcoord4 = texcoord + vec2( amount, 0); 37 | texcoord5 = texcoord + vec2(-amount, amount); 38 | texcoord6 = texcoord + vec2( 0, amount); 39 | texcoord7 = texcoord + vec2( amount, amount); 40 | } 41 | -------------------------------------------------------------------------------- /test_files/v002 Erode.vs: -------------------------------------------------------------------------------- 1 | 2 | #if __VERSION__ <= 120 3 | varying vec2 texcoord0; 4 | varying vec2 texcoord1; 5 | varying vec2 texcoord2; 6 | varying vec2 texcoord3; 7 | varying vec2 texcoord4; 8 | varying vec2 texcoord5; 9 | varying vec2 texcoord6; 10 | varying vec2 texcoord7; 11 | #else 12 | out vec2 texcoord0; 13 | out vec2 texcoord1; 14 | out vec2 texcoord2; 15 | out vec2 texcoord3; 16 | out vec2 texcoord4; 17 | out vec2 texcoord5; 18 | out vec2 texcoord6; 19 | out vec2 texcoord7; 20 | #endif 21 | 22 | void main() 23 | { 24 | isf_vertShaderInit(); 25 | // perform standard transform on vertex 26 | //gl_Position = ftransform(); 27 | 28 | // transform texcoord 29 | vec2 texcoord = vec2(isf_FragNormCoord[0],isf_FragNormCoord[1]); 30 | 31 | // get sample positions 32 | texcoord0 = texcoord + vec2(-amount, -amount); 33 | texcoord1 = texcoord + vec2( 0, -amount); 34 | texcoord2 = texcoord + vec2( amount, -amount); 35 | texcoord3 = texcoord + vec2(-amount, 0); 36 | texcoord4 = texcoord + vec2( amount, 0); 37 | texcoord5 = texcoord + vec2(-amount, amount); 38 | texcoord6 = texcoord + vec2( 0, amount); 39 | texcoord7 = texcoord + vec2( amount, amount); 40 | } 41 | -------------------------------------------------------------------------------- /test_files/Layer Position.fs: -------------------------------------------------------------------------------- 1 | /*{ 2 | "DESCRIPTION": "", 3 | "CREDIT": "", 4 | "ISFVSN": "2", 5 | "CATEGORIES": [ 6 | "Geometry Adjustment", "Utility" 7 | ], 8 | "INPUTS": [ 9 | { 10 | "NAME": "inputImage", 11 | "TYPE": "image" 12 | }, 13 | { 14 | "NAME": "offset", 15 | "TYPE": "point2D", 16 | "DEFAULT": [ 17 | 0.5, 18 | 0.5 19 | ], 20 | "MIN": [ 21 | 0.0, 22 | 0.0 23 | ], 24 | "MAX": [ 25 | 1.0, 26 | 1.0 27 | ] 28 | }, 29 | { 30 | "NAME": "repeatImage", 31 | "TYPE": "bool", 32 | "DEFAULT": 0.0 33 | } 34 | ] 35 | 36 | }*/ 37 | 38 | void main() { 39 | vec4 outputColor = vec4(0.0); 40 | vec2 newLoc = offset; 41 | vec2 topSize = RENDERSIZE; 42 | 43 | newLoc = offset * RENDERSIZE; 44 | newLoc.x = topSize.x - newLoc.x; 45 | newLoc.y = topSize.y - newLoc.y; 46 | newLoc = (gl_FragCoord.xy + 2.0*newLoc) - topSize; 47 | 48 | if (repeatImage) { 49 | newLoc = mod(newLoc, RENDERSIZE); 50 | } 51 | 52 | if ((newLoc.x >= 0.0)&&(newLoc.x < RENDERSIZE.x)&&(newLoc.y >= 0.0)&&(newLoc.y <= RENDERSIZE.y)) { 53 | outputColor = IMG_PIXEL(inputImage, newLoc); 54 | } 55 | 56 | gl_FragColor = outputColor; 57 | } 58 | -------------------------------------------------------------------------------- /test_files/Wipe Down.fs: -------------------------------------------------------------------------------- 1 | /* 2 | { 3 | "ISFVSN" : "2", 4 | "INPUTS" : [ 5 | { 6 | "TYPE" : "image", 7 | "NAME" : "startImage" 8 | }, 9 | { 10 | "TYPE" : "image", 11 | "NAME" : "endImage" 12 | }, 13 | { 14 | "TYPE" : "float", 15 | "NAME" : "progress", 16 | "MIN" : 0, 17 | "MAX" : 1, 18 | "DEFAULT" : 0 19 | } 20 | ], 21 | "CATEGORIES" : [ 22 | "Wipe" 23 | ], 24 | "CREDIT": "Automatically converted from https://www.github.com/gl-transitions/gl-transitions/tree/master/wipeDown.glsl", 25 | "DESCRIPTION" : "Automatically converted from https://gl-transitions.com/" 26 | } 27 | */ 28 | 29 | 30 | 31 | vec4 getFromColor(vec2 inUV) { 32 | return IMG_NORM_PIXEL(startImage, inUV); 33 | } 34 | vec4 getToColor(vec2 inUV) { 35 | return IMG_NORM_PIXEL(endImage, inUV); 36 | } 37 | 38 | 39 | 40 | // Author: Jake Nelson 41 | // License: MIT 42 | 43 | vec4 transition(vec2 uv) { 44 | vec2 p=uv.xy/vec2(1.0).xy; 45 | vec4 a=getFromColor(p); 46 | vec4 b=getToColor(p); 47 | return mix(a, b, step(1.0-p.y,progress)); 48 | } 49 | 50 | 51 | 52 | void main() { 53 | gl_FragColor = transition(isf_FragNormCoord.xy); 54 | } -------------------------------------------------------------------------------- /test_files/Test-PersistentBufferDifferingSizes.fs: -------------------------------------------------------------------------------- 1 | /*{ 2 | "DESCRIPTION": "demonstrates the use of two-pass rendering- the first pass renders to a persistent buffer which is substantially smaller than the res of the image being drawn. the second pass renders at the default requested size and scales up the image from the first pass", 3 | "CREDIT": "by zoidberg", 4 | "ISFVSN": "2.0", 5 | "CATEGORIES": [ 6 | "TEST-GLSL FX" 7 | ], 8 | "INPUTS": [ 9 | { 10 | "NAME": "inputImage", 11 | "TYPE": "image" 12 | } 13 | ], 14 | "PASSES": [ 15 | { 16 | "TARGET":"bufferVariableNameA", 17 | "PERSISTENT": true, 18 | "FLOAT": true, 19 | "WIDTH": "$WIDTH/16.0", 20 | "HEIGHT": "$HEIGHT/16.0" 21 | }, 22 | { 23 | 24 | } 25 | ] 26 | 27 | }*/ 28 | 29 | void main() 30 | { 31 | // first pass: read the "inputImage"- remember, we're drawing to the persistent buffer "bufferVariableNameA" on the first pass 32 | if (PASSINDEX == 0) { 33 | gl_FragColor = IMG_THIS_NORM_PIXEL(inputImage); 34 | } 35 | // second pass: read from "bufferVariableNameA". output looks chunky and low-res. 36 | else if (PASSINDEX == 1) { 37 | gl_FragColor = IMG_THIS_NORM_PIXEL(bufferVariableNameA); 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /test_files/Test-TempBufferDifferingSizes.fs: -------------------------------------------------------------------------------- 1 | /*{ 2 | "DESCRIPTION": "same as TestPersistentBufferDifferingSizes, but uses a temp buffer instead of a persistent buffer", 3 | "CREDIT": "by zoidberg", 4 | "ISFVSN": "2.0", 5 | "CATEGORIES": [ 6 | "TEST-GLSL FX" 7 | ], 8 | "INPUTS": [ 9 | { 10 | "NAME": "inputImage", 11 | "TYPE": "image" 12 | } 13 | ], 14 | "PASSES": [ 15 | { 16 | "TARGET":"bufferVariableNameA", 17 | "WIDTH": "$WIDTH/16.0", 18 | "HEIGHT": "$HEIGHT/16.0" 19 | }, 20 | { 21 | "DESCRIPTION": "this empty pass is rendered at the same rez as whatever you are running the ISF filter at- the previous step rendered an image at one-sixteenth the res, so this step ensures that the output is full-size" 22 | } 23 | ] 24 | 25 | }*/ 26 | 27 | void main() 28 | { 29 | // first pass: read the "inputImage"- remember, we're drawing to the persistent buffer "bufferVariableNameA" on the first pass 30 | if (PASSINDEX == 0) { 31 | gl_FragColor = IMG_THIS_NORM_PIXEL(inputImage); 32 | } 33 | // second pass: read from "bufferVariableNameA". output looks chunky and low-res. 34 | else if (PASSINDEX == 1) { 35 | gl_FragColor = IMG_THIS_NORM_PIXEL(bufferVariableNameA); 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /test_files/RGB EQ.fs: -------------------------------------------------------------------------------- 1 | /*{ 2 | "CREDIT": "by VIDVOX", 3 | "ISFVSN": "2", 4 | "CATEGORIES": [ 5 | "Color Adjustment" 6 | ], 7 | "INPUTS": [ 8 | { 9 | "NAME": "inputImage", 10 | "TYPE": "image" 11 | }, 12 | { 13 | "NAME": "red", 14 | "TYPE": "float", 15 | "MIN": 0.0, 16 | "MAX": 2.0, 17 | "DEFAULT": 1.0 18 | }, 19 | { 20 | "NAME": "green", 21 | "TYPE": "float", 22 | "MIN": 0.0, 23 | "MAX": 2.0, 24 | "DEFAULT": 1.0 25 | }, 26 | { 27 | "NAME": "blue", 28 | "TYPE": "float", 29 | "MIN": 0.0, 30 | "MAX": 2.0, 31 | "DEFAULT": 1.0 32 | }, 33 | { 34 | "NAME": "gain", 35 | "TYPE": "float", 36 | "MIN": -1.0, 37 | "MAX": 1.0, 38 | "DEFAULT": 0.0 39 | } 40 | ] 41 | }*/ 42 | 43 | 44 | 45 | 46 | void main() { 47 | vec4 pixel = IMG_THIS_PIXEL(inputImage); 48 | float brightness = (pixel.r * red + pixel.g * green + pixel.b * blue) / 3.0; 49 | 50 | pixel.r = pixel.r * red; 51 | pixel.g = pixel.g * green; 52 | pixel.b = pixel.b * blue; 53 | 54 | if (gain >= 0.0) { 55 | pixel.a = (brightness >= gain) ? pixel.a : 0.0; 56 | } 57 | else { 58 | pixel.a = (brightness <= 1.0-abs(gain)) ? pixel.a : 0.0; 59 | } 60 | gl_FragColor = pixel; 61 | } 62 | -------------------------------------------------------------------------------- /test_files/Edges.vs: -------------------------------------------------------------------------------- 1 | #if __VERSION__ <= 120 2 | varying vec2 left_coord; 3 | varying vec2 right_coord; 4 | varying vec2 above_coord; 5 | varying vec2 below_coord; 6 | 7 | varying vec2 lefta_coord; 8 | varying vec2 righta_coord; 9 | varying vec2 leftb_coord; 10 | varying vec2 rightb_coord; 11 | #else 12 | out vec2 left_coord; 13 | out vec2 right_coord; 14 | out vec2 above_coord; 15 | out vec2 below_coord; 16 | 17 | out vec2 lefta_coord; 18 | out vec2 righta_coord; 19 | out vec2 leftb_coord; 20 | out vec2 rightb_coord; 21 | #endif 22 | 23 | 24 | void main() 25 | { 26 | isf_vertShaderInit(); 27 | vec2 texc = vec2(isf_FragNormCoord[0],isf_FragNormCoord[1]); 28 | vec2 d = 1.0/RENDERSIZE; 29 | 30 | left_coord = clamp(vec2(texc.xy + vec2(-d.x , 0)),0.0,1.0); 31 | right_coord = clamp(vec2(texc.xy + vec2(d.x , 0)),0.0,1.0); 32 | above_coord = clamp(vec2(texc.xy + vec2(0,d.y)),0.0,1.0); 33 | below_coord = clamp(vec2(texc.xy + vec2(0,-d.y)),0.0,1.0); 34 | 35 | lefta_coord = clamp(vec2(texc.xy + vec2(-d.x , d.x)),0.0,1.0); 36 | righta_coord = clamp(vec2(texc.xy + vec2(d.x , d.x)),0.0,1.0); 37 | leftb_coord = clamp(vec2(texc.xy + vec2(-d.x , -d.x)),0.0,1.0); 38 | rightb_coord = clamp(vec2(texc.xy + vec2(d.x , -d.x)),0.0,1.0); 39 | } -------------------------------------------------------------------------------- /test_files/FastMosh.vs: -------------------------------------------------------------------------------- 1 | #if __VERSION__ <= 120 2 | varying vec2 left_coord; 3 | varying vec2 right_coord; 4 | varying vec2 above_coord; 5 | varying vec2 below_coord; 6 | 7 | varying vec2 lefta_coord; 8 | varying vec2 righta_coord; 9 | varying vec2 leftb_coord; 10 | varying vec2 rightb_coord; 11 | #else 12 | out vec2 left_coord; 13 | out vec2 right_coord; 14 | out vec2 above_coord; 15 | out vec2 below_coord; 16 | 17 | out vec2 lefta_coord; 18 | out vec2 righta_coord; 19 | out vec2 leftb_coord; 20 | out vec2 rightb_coord; 21 | #endif 22 | 23 | 24 | void main() 25 | { 26 | isf_vertShaderInit(); 27 | vec2 texc = vec2(isf_FragNormCoord[0],isf_FragNormCoord[1]); 28 | vec2 d = 1.0/RENDERSIZE; 29 | 30 | left_coord = clamp(vec2(texc.xy + vec2(-d.x , 0)),0.0,1.0); 31 | right_coord = clamp(vec2(texc.xy + vec2(d.x , 0)),0.0,1.0); 32 | above_coord = clamp(vec2(texc.xy + vec2(0,d.y)),0.0,1.0); 33 | below_coord = clamp(vec2(texc.xy + vec2(0,-d.y)),0.0,1.0); 34 | 35 | lefta_coord = clamp(vec2(texc.xy + vec2(-d.x , d.x)),0.0,1.0); 36 | righta_coord = clamp(vec2(texc.xy + vec2(d.x , d.x)),0.0,1.0); 37 | leftb_coord = clamp(vec2(texc.xy + vec2(-d.x , -d.x)),0.0,1.0); 38 | rightb_coord = clamp(vec2(texc.xy + vec2(d.x , -d.x)),0.0,1.0); 39 | } -------------------------------------------------------------------------------- /test_files/Lens Flare.vs: -------------------------------------------------------------------------------- 1 | #if __VERSION__ <= 120 2 | varying vec2 left_coord; 3 | varying vec2 right_coord; 4 | varying vec2 above_coord; 5 | varying vec2 below_coord; 6 | 7 | varying vec2 lefta_coord; 8 | varying vec2 righta_coord; 9 | varying vec2 leftb_coord; 10 | varying vec2 rightb_coord; 11 | #else 12 | out vec2 left_coord; 13 | out vec2 right_coord; 14 | out vec2 above_coord; 15 | out vec2 below_coord; 16 | 17 | out vec2 lefta_coord; 18 | out vec2 righta_coord; 19 | out vec2 leftb_coord; 20 | out vec2 rightb_coord; 21 | #endif 22 | 23 | 24 | void main() 25 | { 26 | isf_vertShaderInit(); 27 | vec2 texc = vec2(isf_FragNormCoord[0],isf_FragNormCoord[1]); 28 | vec2 d = 1.0/RENDERSIZE; 29 | 30 | left_coord = clamp(vec2(texc.xy + vec2(-d.x , 0)),0.0,1.0); 31 | right_coord = clamp(vec2(texc.xy + vec2(d.x , 0)),0.0,1.0); 32 | above_coord = clamp(vec2(texc.xy + vec2(0,d.y)),0.0,1.0); 33 | below_coord = clamp(vec2(texc.xy + vec2(0,-d.y)),0.0,1.0); 34 | 35 | lefta_coord = clamp(vec2(texc.xy + vec2(-d.x , d.x)),0.0,1.0); 36 | righta_coord = clamp(vec2(texc.xy + vec2(d.x , d.x)),0.0,1.0); 37 | leftb_coord = clamp(vec2(texc.xy + vec2(-d.x , -d.x)),0.0,1.0); 38 | rightb_coord = clamp(vec2(texc.xy + vec2(d.x , -d.x)),0.0,1.0); 39 | } -------------------------------------------------------------------------------- /test_files/Sketch.vs: -------------------------------------------------------------------------------- 1 | #if __VERSION__ <= 120 2 | varying vec2 left_coord; 3 | varying vec2 right_coord; 4 | varying vec2 above_coord; 5 | varying vec2 below_coord; 6 | 7 | varying vec2 lefta_coord; 8 | varying vec2 righta_coord; 9 | varying vec2 leftb_coord; 10 | varying vec2 rightb_coord; 11 | #else 12 | out vec2 left_coord; 13 | out vec2 right_coord; 14 | out vec2 above_coord; 15 | out vec2 below_coord; 16 | 17 | out vec2 lefta_coord; 18 | out vec2 righta_coord; 19 | out vec2 leftb_coord; 20 | out vec2 rightb_coord; 21 | #endif 22 | 23 | 24 | void main() 25 | { 26 | isf_vertShaderInit(); 27 | vec2 texc = vec2(isf_FragNormCoord[0],isf_FragNormCoord[1]); 28 | vec2 d = 1.0/RENDERSIZE; 29 | 30 | left_coord = clamp(vec2(texc.xy + vec2(-d.x , 0)),0.0,1.0); 31 | right_coord = clamp(vec2(texc.xy + vec2(d.x , 0)),0.0,1.0); 32 | above_coord = clamp(vec2(texc.xy + vec2(0,d.y)),0.0,1.0); 33 | below_coord = clamp(vec2(texc.xy + vec2(0,-d.y)),0.0,1.0); 34 | 35 | lefta_coord = clamp(vec2(texc.xy + vec2(-d.x , d.x)),0.0,1.0); 36 | righta_coord = clamp(vec2(texc.xy + vec2(d.x , d.x)),0.0,1.0); 37 | leftb_coord = clamp(vec2(texc.xy + vec2(-d.x , -d.x)),0.0,1.0); 38 | rightb_coord = clamp(vec2(texc.xy + vec2(d.x , -d.x)),0.0,1.0); 39 | } -------------------------------------------------------------------------------- /test_files/Soft Blur.vs: -------------------------------------------------------------------------------- 1 | #if __VERSION__ <= 120 2 | varying vec2 left_coord; 3 | varying vec2 right_coord; 4 | varying vec2 above_coord; 5 | varying vec2 below_coord; 6 | 7 | varying vec2 lefta_coord; 8 | varying vec2 righta_coord; 9 | varying vec2 leftb_coord; 10 | varying vec2 rightb_coord; 11 | #else 12 | out vec2 left_coord; 13 | out vec2 right_coord; 14 | out vec2 above_coord; 15 | out vec2 below_coord; 16 | 17 | out vec2 lefta_coord; 18 | out vec2 righta_coord; 19 | out vec2 leftb_coord; 20 | out vec2 rightb_coord; 21 | #endif 22 | 23 | 24 | void main() 25 | { 26 | isf_vertShaderInit(); 27 | vec2 texc = vec2(isf_FragNormCoord[0],isf_FragNormCoord[1]); 28 | vec2 d = 1.0/RENDERSIZE; 29 | 30 | left_coord = clamp(vec2(texc.xy + vec2(-d.x , 0)),0.0,1.0); 31 | right_coord = clamp(vec2(texc.xy + vec2(d.x , 0)),0.0,1.0); 32 | above_coord = clamp(vec2(texc.xy + vec2(0,d.y)),0.0,1.0); 33 | below_coord = clamp(vec2(texc.xy + vec2(0,-d.y)),0.0,1.0); 34 | 35 | lefta_coord = clamp(vec2(texc.xy + vec2(-d.x , d.x)),0.0,1.0); 36 | righta_coord = clamp(vec2(texc.xy + vec2(d.x , d.x)),0.0,1.0); 37 | leftb_coord = clamp(vec2(texc.xy + vec2(-d.x , -d.x)),0.0,1.0); 38 | rightb_coord = clamp(vec2(texc.xy + vec2(d.x , -d.x)),0.0,1.0); 39 | } -------------------------------------------------------------------------------- /test_files/Color Blowout.vs: -------------------------------------------------------------------------------- 1 | #if __VERSION__ <= 120 2 | varying vec2 left_coord; 3 | varying vec2 right_coord; 4 | varying vec2 above_coord; 5 | varying vec2 below_coord; 6 | 7 | varying vec2 lefta_coord; 8 | varying vec2 righta_coord; 9 | varying vec2 leftb_coord; 10 | varying vec2 rightb_coord; 11 | #else 12 | out vec2 left_coord; 13 | out vec2 right_coord; 14 | out vec2 above_coord; 15 | out vec2 below_coord; 16 | 17 | out vec2 lefta_coord; 18 | out vec2 righta_coord; 19 | out vec2 leftb_coord; 20 | out vec2 rightb_coord; 21 | #endif 22 | 23 | 24 | void main() 25 | { 26 | isf_vertShaderInit(); 27 | vec2 texc = vec2(isf_FragNormCoord[0],isf_FragNormCoord[1]); 28 | vec2 d = 1.0/RENDERSIZE; 29 | 30 | left_coord = clamp(vec2(texc.xy + vec2(-d.x , 0)),0.0,1.0); 31 | right_coord = clamp(vec2(texc.xy + vec2(d.x , 0)),0.0,1.0); 32 | above_coord = clamp(vec2(texc.xy + vec2(0,d.y)),0.0,1.0); 33 | below_coord = clamp(vec2(texc.xy + vec2(0,-d.y)),0.0,1.0); 34 | 35 | lefta_coord = clamp(vec2(texc.xy + vec2(-d.x , d.x)),0.0,1.0); 36 | righta_coord = clamp(vec2(texc.xy + vec2(d.x , d.x)),0.0,1.0); 37 | leftb_coord = clamp(vec2(texc.xy + vec2(-d.x , -d.x)),0.0,1.0); 38 | rightb_coord = clamp(vec2(texc.xy + vec2(d.x , -d.x)),0.0,1.0); 39 | } -------------------------------------------------------------------------------- /test_files/Dot Screen.vs: -------------------------------------------------------------------------------- 1 | #if __VERSION__ <= 120 2 | varying vec2 left_coord; 3 | varying vec2 right_coord; 4 | varying vec2 above_coord; 5 | varying vec2 below_coord; 6 | 7 | varying vec2 lefta_coord; 8 | varying vec2 righta_coord; 9 | varying vec2 leftb_coord; 10 | varying vec2 rightb_coord; 11 | #else 12 | out vec2 left_coord; 13 | out vec2 right_coord; 14 | out vec2 above_coord; 15 | out vec2 below_coord; 16 | 17 | out vec2 lefta_coord; 18 | out vec2 righta_coord; 19 | out vec2 leftb_coord; 20 | out vec2 rightb_coord; 21 | #endif 22 | 23 | 24 | void main() 25 | { 26 | isf_vertShaderInit(); 27 | vec2 texc = vec2(isf_FragNormCoord[0],isf_FragNormCoord[1]); 28 | vec2 d = 1.0/RENDERSIZE; 29 | 30 | left_coord = clamp(vec2(texc.xy + vec2(-d.x , 0)),0.0,1.0); 31 | right_coord = clamp(vec2(texc.xy + vec2(d.x , 0)),0.0,1.0); 32 | above_coord = clamp(vec2(texc.xy + vec2(0,d.y)),0.0,1.0); 33 | below_coord = clamp(vec2(texc.xy + vec2(0,-d.y)),0.0,1.0); 34 | 35 | lefta_coord = clamp(vec2(texc.xy + vec2(-d.x , d.x)),0.0,1.0); 36 | righta_coord = clamp(vec2(texc.xy + vec2(d.x , d.x)),0.0,1.0); 37 | leftb_coord = clamp(vec2(texc.xy + vec2(-d.x , -d.x)),0.0,1.0); 38 | rightb_coord = clamp(vec2(texc.xy + vec2(d.x , -d.x)),0.0,1.0); 39 | } -------------------------------------------------------------------------------- /test_files/Edge Distort.vs: -------------------------------------------------------------------------------- 1 | #if __VERSION__ <= 120 2 | varying vec2 left_coord; 3 | varying vec2 right_coord; 4 | varying vec2 above_coord; 5 | varying vec2 below_coord; 6 | 7 | varying vec2 lefta_coord; 8 | varying vec2 righta_coord; 9 | varying vec2 leftb_coord; 10 | varying vec2 rightb_coord; 11 | #else 12 | out vec2 left_coord; 13 | out vec2 right_coord; 14 | out vec2 above_coord; 15 | out vec2 below_coord; 16 | 17 | out vec2 lefta_coord; 18 | out vec2 righta_coord; 19 | out vec2 leftb_coord; 20 | out vec2 rightb_coord; 21 | #endif 22 | 23 | 24 | void main() 25 | { 26 | isf_vertShaderInit(); 27 | vec2 texc = vec2(isf_FragNormCoord[0],isf_FragNormCoord[1]); 28 | vec2 d = 1.0/RENDERSIZE; 29 | 30 | left_coord = clamp(vec2(texc.xy + vec2(-d.x , 0)),0.0,1.0); 31 | right_coord = clamp(vec2(texc.xy + vec2(d.x , 0)),0.0,1.0); 32 | above_coord = clamp(vec2(texc.xy + vec2(0,d.y)),0.0,1.0); 33 | below_coord = clamp(vec2(texc.xy + vec2(0,-d.y)),0.0,1.0); 34 | 35 | lefta_coord = clamp(vec2(texc.xy + vec2(-d.x , d.x)),0.0,1.0); 36 | righta_coord = clamp(vec2(texc.xy + vec2(d.x , d.x)),0.0,1.0); 37 | leftb_coord = clamp(vec2(texc.xy + vec2(-d.x , -d.x)),0.0,1.0); 38 | rightb_coord = clamp(vec2(texc.xy + vec2(d.x , -d.x)),0.0,1.0); 39 | } -------------------------------------------------------------------------------- /test_files/Edge Trace.vs: -------------------------------------------------------------------------------- 1 | #if __VERSION__ <= 120 2 | varying vec2 left_coord; 3 | varying vec2 right_coord; 4 | varying vec2 above_coord; 5 | varying vec2 below_coord; 6 | 7 | varying vec2 lefta_coord; 8 | varying vec2 righta_coord; 9 | varying vec2 leftb_coord; 10 | varying vec2 rightb_coord; 11 | #else 12 | out vec2 left_coord; 13 | out vec2 right_coord; 14 | out vec2 above_coord; 15 | out vec2 below_coord; 16 | 17 | out vec2 lefta_coord; 18 | out vec2 righta_coord; 19 | out vec2 leftb_coord; 20 | out vec2 rightb_coord; 21 | #endif 22 | 23 | 24 | void main() 25 | { 26 | isf_vertShaderInit(); 27 | vec2 texc = vec2(isf_FragNormCoord[0],isf_FragNormCoord[1]); 28 | vec2 d = spread/RENDERSIZE; 29 | 30 | left_coord = clamp(vec2(texc.xy + vec2(-d.x , 0)),0.0,1.0); 31 | right_coord = clamp(vec2(texc.xy + vec2(d.x , 0)),0.0,1.0); 32 | above_coord = clamp(vec2(texc.xy + vec2(0,d.y)),0.0,1.0); 33 | below_coord = clamp(vec2(texc.xy + vec2(0,-d.y)),0.0,1.0); 34 | 35 | lefta_coord = clamp(vec2(texc.xy + vec2(-d.x , d.x)),0.0,1.0); 36 | righta_coord = clamp(vec2(texc.xy + vec2(d.x , d.x)),0.0,1.0); 37 | leftb_coord = clamp(vec2(texc.xy + vec2(-d.x , -d.x)),0.0,1.0); 38 | rightb_coord = clamp(vec2(texc.xy + vec2(d.x , -d.x)),0.0,1.0); 39 | } -------------------------------------------------------------------------------- /test_files/Line Screen.vs: -------------------------------------------------------------------------------- 1 | #if __VERSION__ <= 120 2 | varying vec2 left_coord; 3 | varying vec2 right_coord; 4 | varying vec2 above_coord; 5 | varying vec2 below_coord; 6 | 7 | varying vec2 lefta_coord; 8 | varying vec2 righta_coord; 9 | varying vec2 leftb_coord; 10 | varying vec2 rightb_coord; 11 | #else 12 | out vec2 left_coord; 13 | out vec2 right_coord; 14 | out vec2 above_coord; 15 | out vec2 below_coord; 16 | 17 | out vec2 lefta_coord; 18 | out vec2 righta_coord; 19 | out vec2 leftb_coord; 20 | out vec2 rightb_coord; 21 | #endif 22 | 23 | 24 | void main() 25 | { 26 | isf_vertShaderInit(); 27 | vec2 texc = vec2(isf_FragNormCoord[0],isf_FragNormCoord[1]); 28 | vec2 d = 1.0/RENDERSIZE; 29 | 30 | left_coord = clamp(vec2(texc.xy + vec2(-d.x , 0)),0.0,1.0); 31 | right_coord = clamp(vec2(texc.xy + vec2(d.x , 0)),0.0,1.0); 32 | above_coord = clamp(vec2(texc.xy + vec2(0,d.y)),0.0,1.0); 33 | below_coord = clamp(vec2(texc.xy + vec2(0,-d.y)),0.0,1.0); 34 | 35 | lefta_coord = clamp(vec2(texc.xy + vec2(-d.x , d.x)),0.0,1.0); 36 | righta_coord = clamp(vec2(texc.xy + vec2(d.x , d.x)),0.0,1.0); 37 | leftb_coord = clamp(vec2(texc.xy + vec2(-d.x , -d.x)),0.0,1.0); 38 | rightb_coord = clamp(vec2(texc.xy + vec2(d.x , -d.x)),0.0,1.0); 39 | } -------------------------------------------------------------------------------- /test_files/Sharpen RGB.vs: -------------------------------------------------------------------------------- 1 | #if __VERSION__ <= 120 2 | varying vec2 left_coord; 3 | varying vec2 right_coord; 4 | varying vec2 above_coord; 5 | varying vec2 below_coord; 6 | 7 | varying vec2 lefta_coord; 8 | varying vec2 righta_coord; 9 | varying vec2 leftb_coord; 10 | varying vec2 rightb_coord; 11 | #else 12 | out vec2 left_coord; 13 | out vec2 right_coord; 14 | out vec2 above_coord; 15 | out vec2 below_coord; 16 | 17 | out vec2 lefta_coord; 18 | out vec2 righta_coord; 19 | out vec2 leftb_coord; 20 | out vec2 rightb_coord; 21 | #endif 22 | 23 | 24 | void main() 25 | { 26 | isf_vertShaderInit(); 27 | vec2 texc = vec2(isf_FragNormCoord[0],isf_FragNormCoord[1]); 28 | vec2 d = 1.0/RENDERSIZE; 29 | 30 | left_coord = clamp(vec2(texc.xy + vec2(-d.x , 0)),0.0,1.0); 31 | right_coord = clamp(vec2(texc.xy + vec2(d.x , 0)),0.0,1.0); 32 | above_coord = clamp(vec2(texc.xy + vec2(0,d.y)),0.0,1.0); 33 | below_coord = clamp(vec2(texc.xy + vec2(0,-d.y)),0.0,1.0); 34 | 35 | lefta_coord = clamp(vec2(texc.xy + vec2(-d.x , d.x)),0.0,1.0); 36 | righta_coord = clamp(vec2(texc.xy + vec2(d.x , d.x)),0.0,1.0); 37 | leftb_coord = clamp(vec2(texc.xy + vec2(-d.x , -d.x)),0.0,1.0); 38 | rightb_coord = clamp(vec2(texc.xy + vec2(d.x , -d.x)),0.0,1.0); 39 | } -------------------------------------------------------------------------------- /test_files/Smudged Lens.vs: -------------------------------------------------------------------------------- 1 | #if __VERSION__ <= 120 2 | varying vec2 left_coord; 3 | varying vec2 right_coord; 4 | varying vec2 above_coord; 5 | varying vec2 below_coord; 6 | 7 | varying vec2 lefta_coord; 8 | varying vec2 righta_coord; 9 | varying vec2 leftb_coord; 10 | varying vec2 rightb_coord; 11 | #else 12 | out vec2 left_coord; 13 | out vec2 right_coord; 14 | out vec2 above_coord; 15 | out vec2 below_coord; 16 | 17 | out vec2 lefta_coord; 18 | out vec2 righta_coord; 19 | out vec2 leftb_coord; 20 | out vec2 rightb_coord; 21 | #endif 22 | 23 | 24 | void main() 25 | { 26 | isf_vertShaderInit(); 27 | vec2 texc = vec2(isf_FragNormCoord[0],isf_FragNormCoord[1]); 28 | vec2 d = 1.0/RENDERSIZE; 29 | 30 | left_coord = clamp(vec2(texc.xy + vec2(-d.x , 0)),0.0,1.0); 31 | right_coord = clamp(vec2(texc.xy + vec2(d.x , 0)),0.0,1.0); 32 | above_coord = clamp(vec2(texc.xy + vec2(0,d.y)),0.0,1.0); 33 | below_coord = clamp(vec2(texc.xy + vec2(0,-d.y)),0.0,1.0); 34 | 35 | lefta_coord = clamp(vec2(texc.xy + vec2(-d.x , d.x)),0.0,1.0); 36 | righta_coord = clamp(vec2(texc.xy + vec2(d.x , d.x)),0.0,1.0); 37 | leftb_coord = clamp(vec2(texc.xy + vec2(-d.x , -d.x)),0.0,1.0); 38 | rightb_coord = clamp(vec2(texc.xy + vec2(d.x , -d.x)),0.0,1.0); 39 | } -------------------------------------------------------------------------------- /test_files/Thermal Camera.vs: -------------------------------------------------------------------------------- 1 | #if __VERSION__ <= 120 2 | varying vec2 left_coord; 3 | varying vec2 right_coord; 4 | varying vec2 above_coord; 5 | varying vec2 below_coord; 6 | 7 | varying vec2 lefta_coord; 8 | varying vec2 righta_coord; 9 | varying vec2 leftb_coord; 10 | varying vec2 rightb_coord; 11 | #else 12 | out vec2 left_coord; 13 | out vec2 right_coord; 14 | out vec2 above_coord; 15 | out vec2 below_coord; 16 | 17 | out vec2 lefta_coord; 18 | out vec2 righta_coord; 19 | out vec2 leftb_coord; 20 | out vec2 rightb_coord; 21 | #endif 22 | 23 | 24 | void main() 25 | { 26 | isf_vertShaderInit(); 27 | vec2 texc = vec2(isf_FragNormCoord[0],isf_FragNormCoord[1]); 28 | vec2 d = 1.0/RENDERSIZE; 29 | 30 | left_coord = clamp(vec2(texc.xy + vec2(-d.x , 0)),0.0,1.0); 31 | right_coord = clamp(vec2(texc.xy + vec2(d.x , 0)),0.0,1.0); 32 | above_coord = clamp(vec2(texc.xy + vec2(0,d.y)),0.0,1.0); 33 | below_coord = clamp(vec2(texc.xy + vec2(0,-d.y)),0.0,1.0); 34 | 35 | lefta_coord = clamp(vec2(texc.xy + vec2(-d.x , d.x)),0.0,1.0); 36 | righta_coord = clamp(vec2(texc.xy + vec2(d.x , d.x)),0.0,1.0); 37 | leftb_coord = clamp(vec2(texc.xy + vec2(-d.x , -d.x)),0.0,1.0); 38 | rightb_coord = clamp(vec2(texc.xy + vec2(d.x , -d.x)),0.0,1.0); 39 | } -------------------------------------------------------------------------------- /test_files/Unsharp Mask.vs: -------------------------------------------------------------------------------- 1 | #if __VERSION__ <= 120 2 | varying vec2 left_coord; 3 | varying vec2 right_coord; 4 | varying vec2 above_coord; 5 | varying vec2 below_coord; 6 | 7 | varying vec2 lefta_coord; 8 | varying vec2 righta_coord; 9 | varying vec2 leftb_coord; 10 | varying vec2 rightb_coord; 11 | #else 12 | out vec2 left_coord; 13 | out vec2 right_coord; 14 | out vec2 above_coord; 15 | out vec2 below_coord; 16 | 17 | out vec2 lefta_coord; 18 | out vec2 righta_coord; 19 | out vec2 leftb_coord; 20 | out vec2 rightb_coord; 21 | #endif 22 | 23 | 24 | void main() 25 | { 26 | isf_vertShaderInit(); 27 | vec2 texc = vec2(isf_FragNormCoord[0],isf_FragNormCoord[1]); 28 | vec2 d = 1.0/RENDERSIZE; 29 | 30 | left_coord = clamp(vec2(texc.xy + vec2(-d.x , 0)),0.0,1.0); 31 | right_coord = clamp(vec2(texc.xy + vec2(d.x , 0)),0.0,1.0); 32 | above_coord = clamp(vec2(texc.xy + vec2(0,d.y)),0.0,1.0); 33 | below_coord = clamp(vec2(texc.xy + vec2(0,-d.y)),0.0,1.0); 34 | 35 | lefta_coord = clamp(vec2(texc.xy + vec2(-d.x , d.x)),0.0,1.0); 36 | righta_coord = clamp(vec2(texc.xy + vec2(d.x , d.x)),0.0,1.0); 37 | leftb_coord = clamp(vec2(texc.xy + vec2(-d.x , -d.x)),0.0,1.0); 38 | rightb_coord = clamp(vec2(texc.xy + vec2(d.x , -d.x)),0.0,1.0); 39 | } -------------------------------------------------------------------------------- /test_files/Circular Screen.vs: -------------------------------------------------------------------------------- 1 | #if __VERSION__ <= 120 2 | varying vec2 left_coord; 3 | varying vec2 right_coord; 4 | varying vec2 above_coord; 5 | varying vec2 below_coord; 6 | 7 | varying vec2 lefta_coord; 8 | varying vec2 righta_coord; 9 | varying vec2 leftb_coord; 10 | varying vec2 rightb_coord; 11 | #else 12 | out vec2 left_coord; 13 | out vec2 right_coord; 14 | out vec2 above_coord; 15 | out vec2 below_coord; 16 | 17 | out vec2 lefta_coord; 18 | out vec2 righta_coord; 19 | out vec2 leftb_coord; 20 | out vec2 rightb_coord; 21 | #endif 22 | 23 | 24 | void main() 25 | { 26 | isf_vertShaderInit(); 27 | vec2 texc = vec2(isf_FragNormCoord[0],isf_FragNormCoord[1]); 28 | vec2 d = 1.0/RENDERSIZE; 29 | 30 | left_coord = clamp(vec2(texc.xy + vec2(-d.x , 0)),0.0,1.0); 31 | right_coord = clamp(vec2(texc.xy + vec2(d.x , 0)),0.0,1.0); 32 | above_coord = clamp(vec2(texc.xy + vec2(0,d.y)),0.0,1.0); 33 | below_coord = clamp(vec2(texc.xy + vec2(0,-d.y)),0.0,1.0); 34 | 35 | lefta_coord = clamp(vec2(texc.xy + vec2(-d.x , d.x)),0.0,1.0); 36 | righta_coord = clamp(vec2(texc.xy + vec2(d.x , d.x)),0.0,1.0); 37 | leftb_coord = clamp(vec2(texc.xy + vec2(-d.x , -d.x)),0.0,1.0); 38 | rightb_coord = clamp(vec2(texc.xy + vec2(d.x , -d.x)),0.0,1.0); 39 | } -------------------------------------------------------------------------------- /test_files/Optical Flow Distort.vs: -------------------------------------------------------------------------------- 1 | #if __VERSION__ <= 120 2 | varying vec2 left_coord; 3 | varying vec2 right_coord; 4 | varying vec2 above_coord; 5 | varying vec2 below_coord; 6 | 7 | varying vec2 lefta_coord; 8 | varying vec2 righta_coord; 9 | varying vec2 leftb_coord; 10 | varying vec2 rightb_coord; 11 | #else 12 | out vec2 left_coord; 13 | out vec2 right_coord; 14 | out vec2 above_coord; 15 | out vec2 below_coord; 16 | 17 | out vec2 lefta_coord; 18 | out vec2 righta_coord; 19 | out vec2 leftb_coord; 20 | out vec2 rightb_coord; 21 | #endif 22 | 23 | 24 | void main() 25 | { 26 | isf_vertShaderInit(); 27 | vec2 texc = vec2(isf_FragNormCoord[0],isf_FragNormCoord[1]); 28 | vec2 d = 4.0/RENDERSIZE; 29 | 30 | left_coord = clamp(vec2(texc.xy + vec2(-d.x , 0)),0.0,1.0); 31 | right_coord = clamp(vec2(texc.xy + vec2(d.x , 0)),0.0,1.0); 32 | above_coord = clamp(vec2(texc.xy + vec2(0,d.y)),0.0,1.0); 33 | below_coord = clamp(vec2(texc.xy + vec2(0,-d.y)),0.0,1.0); 34 | 35 | lefta_coord = clamp(vec2(texc.xy + vec2(-d.x , d.x)),0.0,1.0); 36 | righta_coord = clamp(vec2(texc.xy + vec2(d.x , d.x)),0.0,1.0); 37 | leftb_coord = clamp(vec2(texc.xy + vec2(-d.x , -d.x)),0.0,1.0); 38 | rightb_coord = clamp(vec2(texc.xy + vec2(d.x , -d.x)),0.0,1.0); 39 | } -------------------------------------------------------------------------------- /test_files/Saturation Bleed.vs: -------------------------------------------------------------------------------- 1 | #if __VERSION__ <= 120 2 | varying vec2 left_coord; 3 | varying vec2 right_coord; 4 | varying vec2 above_coord; 5 | varying vec2 below_coord; 6 | 7 | varying vec2 lefta_coord; 8 | varying vec2 righta_coord; 9 | varying vec2 leftb_coord; 10 | varying vec2 rightb_coord; 11 | #else 12 | out vec2 left_coord; 13 | out vec2 right_coord; 14 | out vec2 above_coord; 15 | out vec2 below_coord; 16 | 17 | out vec2 lefta_coord; 18 | out vec2 righta_coord; 19 | out vec2 leftb_coord; 20 | out vec2 rightb_coord; 21 | #endif 22 | 23 | 24 | void main() 25 | { 26 | isf_vertShaderInit(); 27 | vec2 texc = vec2(isf_FragNormCoord[0],isf_FragNormCoord[1]); 28 | vec2 d = 1.0/RENDERSIZE; 29 | 30 | left_coord = clamp(vec2(texc.xy + vec2(-d.x , 0)),0.0,1.0); 31 | right_coord = clamp(vec2(texc.xy + vec2(d.x , 0)),0.0,1.0); 32 | above_coord = clamp(vec2(texc.xy + vec2(0,d.y)),0.0,1.0); 33 | below_coord = clamp(vec2(texc.xy + vec2(0,-d.y)),0.0,1.0); 34 | 35 | lefta_coord = clamp(vec2(texc.xy + vec2(-d.x , d.x)),0.0,1.0); 36 | righta_coord = clamp(vec2(texc.xy + vec2(d.x , d.x)),0.0,1.0); 37 | leftb_coord = clamp(vec2(texc.xy + vec2(-d.x , -d.x)),0.0,1.0); 38 | rightb_coord = clamp(vec2(texc.xy + vec2(d.x , -d.x)),0.0,1.0); 39 | } -------------------------------------------------------------------------------- /test_files/Sharpen Luminance.vs: -------------------------------------------------------------------------------- 1 | #if __VERSION__ <= 120 2 | varying vec2 left_coord; 3 | varying vec2 right_coord; 4 | varying vec2 above_coord; 5 | varying vec2 below_coord; 6 | 7 | varying vec2 lefta_coord; 8 | varying vec2 righta_coord; 9 | varying vec2 leftb_coord; 10 | varying vec2 rightb_coord; 11 | #else 12 | out vec2 left_coord; 13 | out vec2 right_coord; 14 | out vec2 above_coord; 15 | out vec2 below_coord; 16 | 17 | out vec2 lefta_coord; 18 | out vec2 righta_coord; 19 | out vec2 leftb_coord; 20 | out vec2 rightb_coord; 21 | #endif 22 | 23 | 24 | void main() 25 | { 26 | isf_vertShaderInit(); 27 | vec2 texc = vec2(isf_FragNormCoord[0],isf_FragNormCoord[1]); 28 | vec2 d = 1.0/RENDERSIZE; 29 | 30 | left_coord = clamp(vec2(texc.xy + vec2(-d.x , 0)),0.0,1.0); 31 | right_coord = clamp(vec2(texc.xy + vec2(d.x , 0)),0.0,1.0); 32 | above_coord = clamp(vec2(texc.xy + vec2(0,d.y)),0.0,1.0); 33 | below_coord = clamp(vec2(texc.xy + vec2(0,-d.y)),0.0,1.0); 34 | 35 | lefta_coord = clamp(vec2(texc.xy + vec2(-d.x , d.x)),0.0,1.0); 36 | righta_coord = clamp(vec2(texc.xy + vec2(d.x , d.x)),0.0,1.0); 37 | leftb_coord = clamp(vec2(texc.xy + vec2(-d.x , -d.x)),0.0,1.0); 38 | rightb_coord = clamp(vec2(texc.xy + vec2(d.x , -d.x)),0.0,1.0); 39 | } -------------------------------------------------------------------------------- /test_files/Crosswarp.fs: -------------------------------------------------------------------------------- 1 | /*{ 2 | "CATEGORIES": [ 3 | "Distortion" 4 | ], 5 | "CREDIT": "Automatically converted from https://www.github.com/gl-transitions/gl-transitions/tree/master/crosswarp.glsl", 6 | "DESCRIPTION": "", 7 | "INPUTS": [ 8 | { 9 | "NAME": "startImage", 10 | "TYPE": "image" 11 | }, 12 | { 13 | "NAME": "endImage", 14 | "TYPE": "image" 15 | }, 16 | { 17 | "DEFAULT": 0, 18 | "MAX": 1, 19 | "MIN": 0, 20 | "NAME": "progress", 21 | "TYPE": "float" 22 | } 23 | ], 24 | "ISFVSN": "2" 25 | } 26 | */ 27 | 28 | 29 | 30 | vec4 getFromColor(vec2 inUV) { 31 | return IMG_NORM_PIXEL(startImage, inUV); 32 | } 33 | vec4 getToColor(vec2 inUV) { 34 | return IMG_NORM_PIXEL(endImage, inUV); 35 | } 36 | 37 | 38 | 39 | // Author: Eke Péter 40 | // License: MIT 41 | vec4 transition(vec2 p) { 42 | float x = progress; 43 | x=smoothstep(.0,1.0,(x*2.0+p.x-1.0)); 44 | return mix(getFromColor((p-.5)*(1.-x)+.5), getToColor((p-.5)*x+.5), x); 45 | } 46 | 47 | 48 | 49 | void main() { 50 | gl_FragColor = transition(isf_FragNormCoord.xy); 51 | } -------------------------------------------------------------------------------- /test_files/Auto Levels.vs: -------------------------------------------------------------------------------- 1 | #if __VERSION__ <= 120 2 | varying vec2 left_coord; 3 | varying vec2 right_coord; 4 | varying vec2 above_coord; 5 | varying vec2 below_coord; 6 | 7 | varying vec2 lefta_coord; 8 | varying vec2 righta_coord; 9 | varying vec2 leftb_coord; 10 | varying vec2 rightb_coord; 11 | #else 12 | out vec2 left_coord; 13 | out vec2 right_coord; 14 | out vec2 above_coord; 15 | out vec2 below_coord; 16 | 17 | out vec2 lefta_coord; 18 | out vec2 righta_coord; 19 | out vec2 leftb_coord; 20 | out vec2 rightb_coord; 21 | #endif 22 | 23 | void main() 24 | { 25 | isf_vertShaderInit(); 26 | vec2 texc = vec2(isf_FragNormCoord[0],isf_FragNormCoord[1]); 27 | vec2 d = 1.0/RENDERSIZE; 28 | 29 | left_coord = clamp(vec2(texc.xy + vec2(-d.x , 0)),0.0,1.0); 30 | right_coord = clamp(vec2(texc.xy + vec2(d.x , 0)),0.0,1.0); 31 | above_coord = clamp(vec2(texc.xy + vec2(0,d.y)),0.0,1.0); 32 | below_coord = clamp(vec2(texc.xy + vec2(0,-d.y)),0.0,1.0); 33 | 34 | d = 1.0/RENDERSIZE; 35 | lefta_coord = clamp(vec2(texc.xy + vec2(-d.x , d.x)),0.0,1.0); 36 | righta_coord = clamp(vec2(texc.xy + vec2(d.x , d.x)),0.0,1.0); 37 | leftb_coord = clamp(vec2(texc.xy + vec2(-d.x , -d.x)),0.0,1.0); 38 | rightb_coord = clamp(vec2(texc.xy + vec2(d.x , -d.x)),0.0,1.0); 39 | } -------------------------------------------------------------------------------- /test_files/Neon.vs: -------------------------------------------------------------------------------- 1 | #if __VERSION__ <= 120 2 | varying vec2 left_coord; 3 | varying vec2 right_coord; 4 | varying vec2 above_coord; 5 | varying vec2 below_coord; 6 | 7 | varying vec2 lefta_coord; 8 | varying vec2 righta_coord; 9 | varying vec2 leftb_coord; 10 | varying vec2 rightb_coord; 11 | #else 12 | out vec2 left_coord; 13 | out vec2 right_coord; 14 | out vec2 above_coord; 15 | out vec2 below_coord; 16 | 17 | out vec2 lefta_coord; 18 | out vec2 righta_coord; 19 | out vec2 leftb_coord; 20 | out vec2 rightb_coord; 21 | #endif 22 | 23 | 24 | void main() 25 | { 26 | isf_vertShaderInit(); 27 | vec2 texc = vec2(isf_FragNormCoord[0],isf_FragNormCoord[1]); 28 | vec2 d = 1.0/RENDERSIZE; 29 | 30 | left_coord = clamp(vec2(texc.xy + vec2(-d.x , 0)),0.0,1.0); 31 | right_coord = clamp(vec2(texc.xy + vec2(d.x , 0)),0.0,1.0); 32 | above_coord = clamp(vec2(texc.xy + vec2(0,d.y)),0.0,1.0); 33 | below_coord = clamp(vec2(texc.xy + vec2(0,-d.y)),0.0,1.0); 34 | 35 | d = 1.0/RENDERSIZE; 36 | lefta_coord = clamp(vec2(texc.xy + vec2(-d.x , d.x)),0.0,1.0); 37 | righta_coord = clamp(vec2(texc.xy + vec2(d.x , d.x)),0.0,1.0); 38 | leftb_coord = clamp(vec2(texc.xy + vec2(-d.x , -d.x)),0.0,1.0); 39 | rightb_coord = clamp(vec2(texc.xy + vec2(d.x , -d.x)),0.0,1.0); 40 | } -------------------------------------------------------------------------------- /test_files/Glow.vs: -------------------------------------------------------------------------------- 1 | #if __VERSION__ <= 120 2 | varying vec2 texOffsets[3]; 3 | #else 4 | out vec2 texOffsets[3]; 5 | #endif 6 | 7 | const float radius = 10.0; 8 | 9 | void main(void) { 10 | // load the main shader stuff 11 | isf_vertShaderInit(); 12 | 13 | if (PASSINDEX==0 || PASSINDEX==2 || PASSINDEX==4 || PASSINDEX==6 || PASSINDEX==8) { 14 | float pixelWidth = 1.0/RENDERSIZE[0]*radius; 15 | if (PASSINDEX >= 2) 16 | pixelWidth *= .7; 17 | else if (PASSINDEX >= 6) 18 | pixelWidth *= 1.0; 19 | texOffsets[0] = isf_FragNormCoord; 20 | texOffsets[1] = clamp(vec2(isf_FragNormCoord[0]-pixelWidth, isf_FragNormCoord[1]),0.0,1.0); 21 | texOffsets[2] = clamp(vec2(isf_FragNormCoord[0]+pixelWidth, isf_FragNormCoord[1]),0.0,1.0); 22 | } 23 | else if (PASSINDEX==1 || PASSINDEX==3 || PASSINDEX==5 || PASSINDEX==7 || PASSINDEX==9) { 24 | float pixelHeight = 1.0/RENDERSIZE[1]*radius; 25 | if (PASSINDEX >= 3) 26 | pixelHeight *= .7; 27 | else if (PASSINDEX >= 6) 28 | pixelHeight *= 1.0; 29 | texOffsets[0] = isf_FragNormCoord; 30 | texOffsets[1] = clamp(vec2(isf_FragNormCoord[0], isf_FragNormCoord[1]-pixelHeight),0.0,1.0); 31 | texOffsets[2] = clamp(vec2(isf_FragNormCoord[0], isf_FragNormCoord[1]+pixelHeight),0.0,1.0); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /test_files/Window Blinds.fs: -------------------------------------------------------------------------------- 1 | /* 2 | { 3 | "CATEGORIES" : [ 4 | "Dissolve" 5 | ], 6 | "INPUTS" : [ 7 | { 8 | "TYPE" : "image", 9 | "NAME" : "startImage" 10 | }, 11 | { 12 | "NAME" : "endImage", 13 | "TYPE" : "image" 14 | }, 15 | { 16 | "NAME" : "progress", 17 | "MIN" : 0, 18 | "TYPE" : "float", 19 | "MAX" : 1, 20 | "DEFAULT" : 0 21 | } 22 | ], 23 | "CREDIT": "Automatically converted from https://www.github.com/gl-transitions/gl-transitions/tree/master/windowblinds.glsl", 24 | "DESCRIPTION": "", 25 | "ISFVSN" : "2" 26 | } 27 | */ 28 | 29 | 30 | 31 | vec4 getFromColor(vec2 inUV) { 32 | return IMG_NORM_PIXEL(startImage, inUV); 33 | } 34 | vec4 getToColor(vec2 inUV) { 35 | return IMG_NORM_PIXEL(endImage, inUV); 36 | } 37 | 38 | 39 | 40 | // Author: Fabien Benetou 41 | // License: MIT 42 | 43 | vec4 transition (vec2 uv) { 44 | float t = progress; 45 | 46 | if (mod(floor(uv.y*100.*progress),2.)==0.) 47 | t*=2.-.5; 48 | 49 | return mix( 50 | getFromColor(uv), 51 | getToColor(uv), 52 | mix(t, progress, smoothstep(0.8, 1.0, progress)) 53 | ); 54 | } 55 | 56 | 57 | 58 | void main() { 59 | gl_FragColor = transition(isf_FragNormCoord.xy); 60 | } -------------------------------------------------------------------------------- /test_files/RGB Trails 3.0.fs: -------------------------------------------------------------------------------- 1 | /*{ 2 | "CREDIT": "by zoidberg", 3 | "ISFVSN": "2", 4 | "DESCRIPTION": "a persistent buffer is used to maintain an image which is constantly updated. Similar to VVMotionBlur, but each channel has its own weight", 5 | "CATEGORIES": [ 6 | "Color Effect", "Blur" 7 | ], 8 | "INPUTS": [ 9 | { 10 | "NAME": "inputImage", 11 | "TYPE": "image" 12 | }, 13 | { 14 | "NAME": "rWeight", 15 | "TYPE": "float" 16 | }, 17 | { 18 | "NAME": "gWeight", 19 | "TYPE": "float" 20 | }, 21 | { 22 | "NAME": "bWeight", 23 | "TYPE": "float" 24 | }, 25 | { 26 | "NAME": "aWeight", 27 | "TYPE": "float", 28 | "DEFAULT": 0.0 29 | } 30 | ], 31 | "PASSES": [ 32 | { 33 | "TARGET":"accum", 34 | "PERSISTENT": true, 35 | "FLOAT": true 36 | }, 37 | { 38 | 39 | } 40 | ] 41 | 42 | }*/ 43 | 44 | void main() 45 | { 46 | if (PASSINDEX==0) { 47 | vec4 freshPixel = IMG_THIS_PIXEL(inputImage); 48 | vec4 stalePixel = IMG_THIS_PIXEL(accum); 49 | gl_FragColor = vec4(mix(freshPixel.r,stalePixel.r,rWeight), mix(freshPixel.g,stalePixel.g,gWeight), mix(freshPixel.b,stalePixel.b,bWeight), mix(freshPixel.a,stalePixel.a,aWeight)); 50 | } 51 | else 52 | gl_FragColor = IMG_THIS_PIXEL(accum); 53 | } 54 | -------------------------------------------------------------------------------- /test_files/Side Scroller And Flip.fs: -------------------------------------------------------------------------------- 1 | /*{ 2 | "CREDIT": "BrianChasalow", 3 | "ISFVSN": "2", 4 | "CATEGORIES": [ 5 | "Geometry Adjustment" 6 | ], 7 | "INPUTS": [ 8 | { 9 | "NAME": "inputImage", 10 | "TYPE": "image" 11 | }, 12 | { 13 | "NAME": "slide", 14 | "TYPE": "float", 15 | "MIN": 0.0, 16 | "MAX": 2.0, 17 | "DEFAULT": 0.0 18 | }, 19 | { 20 | "NAME": "shift", 21 | "TYPE": "float", 22 | "MIN": 0.0, 23 | "MAX": 2.0, 24 | "DEFAULT": 0.0 25 | }, 26 | { 27 | "NAME": "mirrorHorizontal", 28 | "TYPE": "bool", 29 | "MIN": false, 30 | "MAX": true, 31 | "DEFAULT": true 32 | }, 33 | { 34 | "NAME": "mirrorVertical", 35 | "TYPE": "bool", 36 | "MIN": false, 37 | "MAX": true, 38 | "DEFAULT": true 39 | } 40 | 41 | ] 42 | }*/ 43 | 44 | void main(void) 45 | { 46 | vec2 retard = isf_FragNormCoord; 47 | retard.x += slide; 48 | retard.y += shift; 49 | vec2 moddedRetard = mod(retard,1.0); 50 | 51 | if(mirrorHorizontal && retard.x >= 1.0 && retard.x <= 2.0) 52 | moddedRetard = vec2(1.0-moddedRetard.x, moddedRetard.y); 53 | if(mirrorVertical && retard.y >= 1.0 && retard.y <= 2.0) 54 | moddedRetard = vec2(moddedRetard.x, 1.0-moddedRetard.y); 55 | 56 | vec4 pixel = IMG_NORM_PIXEL(inputImage, moddedRetard); 57 | gl_FragColor = pixel; 58 | } -------------------------------------------------------------------------------- /test_files/Luma Transition.fs: -------------------------------------------------------------------------------- 1 | /* 2 | { 3 | "ISFVSN" : "2", 4 | "CATEGORIES" : [ 5 | "Dissolve" 6 | ], 7 | "INPUTS" : [ 8 | { 9 | "TYPE" : "image", 10 | "NAME" : "startImage" 11 | }, 12 | { 13 | "NAME" : "endImage", 14 | "TYPE" : "image" 15 | }, 16 | { 17 | "TYPE" : "float", 18 | "MIN" : 0, 19 | "DEFAULT" : 0, 20 | "NAME" : "progress", 21 | "MAX" : 1 22 | }, 23 | { 24 | "NAME" : "luma", 25 | "TYPE" : "image" 26 | } 27 | ], 28 | "CREDIT": "Automatically converted from https://www.github.com/gl-transitions/gl-transitions/tree/master/luma.glsl", 29 | "DESCRIPTION" : "Automatically converted from https://gl-transitions.com/" 30 | } 31 | */ 32 | 33 | 34 | 35 | vec4 getFromColor(vec2 inUV) { 36 | return IMG_NORM_PIXEL(startImage, inUV); 37 | } 38 | vec4 getToColor(vec2 inUV) { 39 | return IMG_NORM_PIXEL(endImage, inUV); 40 | } 41 | 42 | 43 | 44 | // Author: gre 45 | // License: MIT 46 | 47 | 48 | vec4 transition(vec2 uv) { 49 | return mix( 50 | getToColor(uv), 51 | getFromColor(uv), 52 | step(progress, IMG_NORM_PIXEL(luma, uv).r-0.001) 53 | ); 54 | } 55 | 56 | 57 | 58 | void main() { 59 | gl_FragColor = transition(isf_FragNormCoord.xy); 60 | } -------------------------------------------------------------------------------- /test_files/Sepia Tone.fs: -------------------------------------------------------------------------------- 1 | /*{ 2 | "CATEGORIES": [ 3 | "Color Effect", 4 | "Retro" 5 | ], 6 | "CREDIT": "by VIDVOX", 7 | "INPUTS": [ 8 | { 9 | "NAME": "inputImage", 10 | "TYPE": "image" 11 | }, 12 | { 13 | "DEFAULT": 0.8, 14 | "MAX": 1.2, 15 | "MIN": 0.8, 16 | "NAME": "contrast", 17 | "TYPE": "float" 18 | } 19 | ], 20 | "ISFVSN": "2" 21 | } 22 | */ 23 | 24 | 25 | // Adapted from https://www.omniref.com/ruby/gems/essytas/0.0.1/files/lib/glsl/sepia.frag 26 | 27 | void main() { 28 | 29 | vec4 rawColor = IMG_THIS_PIXEL(inputImage); 30 | vec4 color = rawColor; 31 | vec4 sepia1 = vec4( 0.2, 0.05, 0.0, 1.0 ); 32 | vec4 sepia2 = vec4( 1.0, 0.9, 0.5, 1.0 ); 33 | float sepiaMix = dot(vec3(0.3, 0.59, 0.11), color.rgb); 34 | color = mix(color, vec4(sepiaMix), 0.5); 35 | vec4 sepia = mix(sepia1, sepia2, sepiaMix); 36 | sepia = vec4( min( vec3( 1.0 ), sepia.rgb ), color.a ); 37 | 38 | float bright = 0.05; 39 | sepia = sepia + vec4(bright, bright, bright, 0.0); 40 | sepia.rgb = ((vec3(2.0) * (sepia.rgb - vec3(0.5))) * vec3(contrast) / vec3(2.0)) + vec3(0.5); 41 | sepia.a = rawColor.a; 42 | gl_FragColor = sepia; 43 | 44 | } 45 | -------------------------------------------------------------------------------- /tests/roundtrip.rs: -------------------------------------------------------------------------------- 1 | // Deserialize each ISF, serialize it back to JSON, then deserialize it again and make sure both 2 | // deserialized instances match. 3 | #[test] 4 | fn roundtrip_test_files() { 5 | let test_files_path = std::path::Path::new(env!("CARGO_MANIFEST_DIR")).join("test_files"); 6 | assert!(test_files_path.exists()); 7 | assert!(test_files_path.is_dir()); 8 | for entry in std::fs::read_dir(test_files_path).unwrap() { 9 | let entry = entry.unwrap(); 10 | let path = entry.path(); 11 | let ext = path.extension().and_then(|s| s.to_str()); 12 | if ext == Some("fs") || ext == Some("vs") { 13 | let glsl_str = std::fs::read_to_string(&path).unwrap(); 14 | let isf = match isf::parse(&glsl_str) { 15 | // Ignore non-ISF vertex shaders. 16 | Err(isf::ParseError::MissingTopComment) if ext == Some("vs") => continue, 17 | Err(err) => panic!("err while parsing {}: {}", path.display(), err), 18 | Ok(isf) => isf, 19 | }; 20 | let isf_string = serde_json::to_string_pretty(&isf).unwrap(); 21 | let isf2 = serde_json::from_str(&isf_string).unwrap(); 22 | assert_eq!(isf, isf2); 23 | } 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /test_files/Vertical Tearing.fs: -------------------------------------------------------------------------------- 1 | /* 2 | { 3 | "CATEGORIES" : [ 4 | "Glitch" 5 | ], 6 | "DESCRIPTION" : "This introduces a vertical tearing effect similar to when GL VBL sync is off.", 7 | "ISFVSN" : "2", 8 | "INPUTS" : [ 9 | { 10 | "NAME" : "inputImage", 11 | "TYPE" : "image" 12 | }, 13 | { 14 | "NAME" : "tearPosition", 15 | "TYPE" : "float", 16 | "MAX" : 1, 17 | "DEFAULT" : 0.5, 18 | "MIN" : 0 19 | } 20 | ], 21 | "PASSES" : [ 22 | { 23 | "TARGET" : "oldImage" 24 | }, 25 | { 26 | "TARGET" : "newImage", 27 | "PERSISTENT" : true 28 | }, 29 | { 30 | 31 | } 32 | ], 33 | "CREDIT" : "by VIDVOX" 34 | } 35 | */ 36 | 37 | void main() 38 | { 39 | // write the previous buffer into here 40 | if (PASSINDEX == 0) { 41 | gl_FragColor = IMG_NORM_PIXEL(newImage,isf_FragNormCoord.xy); 42 | } 43 | else if (PASSINDEX == 1) { 44 | gl_FragColor = IMG_NORM_PIXEL(inputImage,isf_FragNormCoord.xy); 45 | } 46 | else if (PASSINDEX == 2) { 47 | vec4 freshPixel = IMG_NORM_PIXEL(inputImage,isf_FragNormCoord.xy); 48 | vec4 stalePixel = IMG_NORM_PIXEL(oldImage,isf_FragNormCoord.xy); 49 | gl_FragColor = (isf_FragNormCoord.y > tearPosition) ? freshPixel : stalePixel; 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /test_files/HSVtoRGB.fs: -------------------------------------------------------------------------------- 1 | /*{ 2 | "CATEGORIES": [ 3 | "Color Effect", 4 | "Utility" 5 | ], 6 | "CREDIT": "by zoidberg", 7 | "DESCRIPTION": "swizzles RGBA to BGRA and vice versa", 8 | "INPUTS": [ 9 | { 10 | "NAME": "inputImage", 11 | "TYPE": "image" 12 | } 13 | ], 14 | "ISFVSN": "2" 15 | } 16 | */ 17 | 18 | 19 | 20 | 21 | vec3 rgb2hsv(vec3 c) { 22 | vec4 K = vec4(0.0, -1.0 / 3.0, 2.0 / 3.0, -1.0); 23 | //vec4 p = mix(vec4(c.bg, K.wz), vec4(c.gb, K.xy), step(c.b, c.g)); 24 | //vec4 q = mix(vec4(p.xyw, c.r), vec4(c.r, p.yzx), step(p.x, c.r)); 25 | vec4 p = c.g < c.b ? vec4(c.bg, K.wz) : vec4(c.gb, K.xy); 26 | vec4 q = c.r < p.x ? vec4(p.xyw, c.r) : vec4(c.r, p.yzx); 27 | 28 | float d = q.x - min(q.w, q.y); 29 | float e = 1.0e-10; 30 | return vec3(abs(q.z + (q.w - q.y) / (6.0 * d + e)), d / (q.x + e), q.x); 31 | } 32 | 33 | vec3 hsv2rgb(vec3 c) { 34 | vec4 K = vec4(1.0, 2.0 / 3.0, 1.0 / 3.0, 3.0); 35 | vec3 p = abs(fract(c.xxx + K.xyz) * 6.0 - K.www); 36 | return c.z * mix(K.xxx, clamp(p - K.xxx, 0.0, 1.0), c.y); 37 | } 38 | 39 | 40 | 41 | 42 | void main() 43 | { 44 | vec4 inColor = IMG_NORM_PIXEL(inputImage, isf_FragNormCoord); 45 | gl_FragColor = vec4(hsv2rgb(inColor.rgb), inColor.a); 46 | } 47 | -------------------------------------------------------------------------------- /test_files/RGBtoHSV.fs: -------------------------------------------------------------------------------- 1 | /*{ 2 | "CATEGORIES": [ 3 | "Color Effect", 4 | "Utility" 5 | ], 6 | "CREDIT": "by zoidberg", 7 | "DESCRIPTION": "swizzles RGBA to BGRA and vice versa", 8 | "INPUTS": [ 9 | { 10 | "NAME": "inputImage", 11 | "TYPE": "image" 12 | } 13 | ], 14 | "ISFVSN": "2" 15 | } 16 | */ 17 | 18 | 19 | 20 | 21 | vec3 rgb2hsv(vec3 c) { 22 | vec4 K = vec4(0.0, -1.0 / 3.0, 2.0 / 3.0, -1.0); 23 | //vec4 p = mix(vec4(c.bg, K.wz), vec4(c.gb, K.xy), step(c.b, c.g)); 24 | //vec4 q = mix(vec4(p.xyw, c.r), vec4(c.r, p.yzx), step(p.x, c.r)); 25 | vec4 p = c.g < c.b ? vec4(c.bg, K.wz) : vec4(c.gb, K.xy); 26 | vec4 q = c.r < p.x ? vec4(p.xyw, c.r) : vec4(c.r, p.yzx); 27 | 28 | float d = q.x - min(q.w, q.y); 29 | float e = 1.0e-10; 30 | return vec3(abs(q.z + (q.w - q.y) / (6.0 * d + e)), d / (q.x + e), q.x); 31 | } 32 | 33 | vec3 hsv2rgb(vec3 c) { 34 | vec4 K = vec4(1.0, 2.0 / 3.0, 1.0 / 3.0, 3.0); 35 | vec3 p = abs(fract(c.xxx + K.xyz) * 6.0 - K.www); 36 | return c.z * mix(K.xxx, clamp(p - K.xxx, 0.0, 1.0), c.y); 37 | } 38 | 39 | 40 | 41 | 42 | void main() 43 | { 44 | vec4 inColor = IMG_NORM_PIXEL(inputImage, isf_FragNormCoord); 45 | gl_FragColor = vec4(rgb2hsv(inColor.rgb), inColor.a); 46 | } 47 | -------------------------------------------------------------------------------- /test_files/Color Monochrome.fs: -------------------------------------------------------------------------------- 1 | /*{ 2 | "CATEGORIES": [ 3 | "Color Effect", 4 | "Retro" 5 | ], 6 | "CREDIT": "by zoidberg", 7 | "INPUTS": [ 8 | { 9 | "NAME": "inputImage", 10 | "TYPE": "image" 11 | }, 12 | { 13 | "DEFAULT": 1, 14 | "MAX": 1, 15 | "MIN": 0, 16 | "NAME": "intensity", 17 | "TYPE": "float" 18 | }, 19 | { 20 | "DEFAULT": [ 21 | 0.6, 22 | 0.45, 23 | 0.3, 24 | 1 25 | ], 26 | "NAME": "color", 27 | "TYPE": "color" 28 | } 29 | ], 30 | "ISFVSN": "2" 31 | } 32 | */ 33 | 34 | 35 | //const vec4 lumcoeff = vec4(0.299, 0.587, 0.114, 0.0); 36 | const vec4 lumcoeff = vec4(0.2126, 0.7152, 0.0722, 0.0); 37 | 38 | void main() { 39 | vec4 srcPixel = IMG_THIS_PIXEL(inputImage); 40 | float luminance = dot(srcPixel,lumcoeff); 41 | //float luminance = (srcPixel.r + srcPixel.g + srcPixel.b)/3.0; 42 | vec4 dstPixel = (luminance >= 0.50) 43 | ? mix(color, vec4(1,1,1,srcPixel.a), (luminance-0.5)*2.0) 44 | : mix(vec4(0,0,0,srcPixel.a), color, luminance*2.0); 45 | gl_FragColor = mix(srcPixel, dstPixel, intensity); 46 | } -------------------------------------------------------------------------------- /test_files/Zoom.fs: -------------------------------------------------------------------------------- 1 | /*{ 2 | "CATEGORIES": [ 3 | "Geometry Adjustment" 4 | ], 5 | "CREDIT": "by VIDVOX", 6 | "INPUTS": [ 7 | { 8 | "NAME": "inputImage", 9 | "TYPE": "image" 10 | }, 11 | { 12 | "DEFAULT": 1, 13 | "MAX": 10, 14 | "MIN": 0.01, 15 | "NAME": "level", 16 | "TYPE": "float" 17 | }, 18 | { 19 | "DEFAULT": [ 20 | 0, 21 | 0 22 | ], 23 | "MAX": [ 24 | 1, 25 | 1 26 | ], 27 | "MIN": [ 28 | 0, 29 | 0 30 | ], 31 | "NAME": "center", 32 | "TYPE": "point2D" 33 | } 34 | ], 35 | "ISFVSN": "2" 36 | } 37 | */ 38 | 39 | void main() { 40 | vec2 loc; 41 | vec2 modifiedCenter; 42 | 43 | loc = isf_FragNormCoord; 44 | modifiedCenter = center; 45 | loc.x = (loc.x - modifiedCenter.x)*(1.0/level) + modifiedCenter.x; 46 | loc.y = (loc.y - modifiedCenter.y)*(1.0/level) + modifiedCenter.y; 47 | if ((loc.x < 0.0)||(loc.y < 0.0)||(loc.x > 1.0)||(loc.y > 1.0)) { 48 | gl_FragColor = vec4(0.0); 49 | } 50 | else { 51 | gl_FragColor = IMG_NORM_PIXEL(inputImage,loc); 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /test_files/Multiply Blend.fs: -------------------------------------------------------------------------------- 1 | /* 2 | { 3 | "ISFVSN" : "2", 4 | "CREDIT": "Automatically converted from https://www.github.com/gl-transitions/gl-transitions/tree/master/multiply_blend.glsl", 5 | "DESCRIPTION": "", 6 | "CATEGORIES" : [ 7 | "Dissolve" 8 | ], 9 | "INPUTS" : [ 10 | { 11 | "NAME" : "startImage", 12 | "TYPE" : "image" 13 | }, 14 | { 15 | "NAME" : "endImage", 16 | "TYPE" : "image" 17 | }, 18 | { 19 | "MAX" : 1, 20 | "DEFAULT" : 0, 21 | "MIN" : 0, 22 | "TYPE" : "float", 23 | "NAME" : "progress" 24 | } 25 | ] 26 | } 27 | */ 28 | 29 | 30 | 31 | vec4 getFromColor(vec2 inUV) { 32 | return IMG_NORM_PIXEL(startImage, inUV); 33 | } 34 | vec4 getToColor(vec2 inUV) { 35 | return IMG_NORM_PIXEL(endImage, inUV); 36 | } 37 | 38 | 39 | 40 | // Author: Fernando Kuteken 41 | // License: MIT 42 | 43 | vec4 blend(vec4 a, vec4 b) { 44 | return a * b; 45 | } 46 | 47 | vec4 transition (vec2 uv) { 48 | 49 | vec4 blended = blend(getFromColor(uv), getToColor(uv)); 50 | 51 | if (progress < 0.5) 52 | return mix(getFromColor(uv), blended, 2.0 * progress); 53 | else 54 | return mix(blended, getToColor(uv), 2.0 * progress - 1.0); 55 | } 56 | 57 | 58 | 59 | 60 | void main() { 61 | gl_FragColor = transition(isf_FragNormCoord.xy); 62 | } -------------------------------------------------------------------------------- /test_files/v002-CRT-Displacement.fs: -------------------------------------------------------------------------------- 1 | /*{ 2 | "CATEGORIES": [ 3 | "Distortion Effect", 4 | "Retro", 5 | "v002" 6 | ], 7 | "CREDIT": "by vade", 8 | "DESCRIPTION": "CRT Displacement, emulating the look of curved CRT Displays", 9 | "INPUTS": [ 10 | { 11 | "NAME": "inputImage", 12 | "TYPE": "image" 13 | }, 14 | { 15 | "DEFAULT": 0.5, 16 | "MAX": 1, 17 | "MIN": 0, 18 | "NAME": "Amount", 19 | "TYPE": "float" 20 | } 21 | ], 22 | "ISFVSN": "2" 23 | } 24 | */ 25 | 26 | void main (void) 27 | { 28 | vec2 t1, t2; 29 | vec2 ctr = RENDERSIZE / 2.0; 30 | 31 | t1 = gl_FragCoord.xy; 32 | 33 | float a = -0.0; 34 | float b = -.1 * Amount; 35 | float c = -.0; 36 | float d = 1.0 - 1.1 * ( a + b + c ); 37 | float r1, r2; 38 | float unit = length(ctr) / 2.0; 39 | 40 | r1 = distance( t1, ctr )/unit; 41 | r2 = r1 *( r1*( r1 * (a*r1 + b) + c) + d ); 42 | float sc = step( 0.0 , r1) * ( r1/(r2 + .000001)) + (1.0 - step( 0.0 , r1)); 43 | 44 | t2 = ctr + ( t1 - ctr) * sc; 45 | 46 | gl_FragColor = IMG_PIXEL(inputImage, t2); 47 | 48 | if ((t2.x < 0.0) 49 | ||(t2.y < 0.0) 50 | ||(t2.x > RENDERSIZE.x) 51 | ||(t2.y > RENDERSIZE.y)) 52 | { 53 | gl_FragColor = vec4(0.0); 54 | } 55 | } -------------------------------------------------------------------------------- /test_files/Mirror Edge.fs: -------------------------------------------------------------------------------- 1 | /*{ 2 | "CATEGORIES": [ 3 | "Tile Effect" 4 | ], 5 | "CREDIT": "by VIDVOX", 6 | "INPUTS": [ 7 | { 8 | "NAME": "inputImage", 9 | "TYPE": "image" 10 | }, 11 | { 12 | "DEFAULT": 0, 13 | "LABEL": "Angle", 14 | "MAX": 1, 15 | "MIN": 0, 16 | "NAME": "angle", 17 | "TYPE": "float" 18 | }, 19 | { 20 | "DEFAULT": [ 21 | 0, 22 | 0.5 23 | ], 24 | "LABEL": "Shift", 25 | "MAX": [ 26 | 1, 27 | 1 28 | ], 29 | "MIN": [ 30 | 0, 31 | 0 32 | ], 33 | "NAME": "shift", 34 | "TYPE": "point2D" 35 | } 36 | ], 37 | "ISFVSN": "2" 38 | } 39 | */ 40 | 41 | #if __VERSION__ <= 120 42 | varying vec2 translated_coord; 43 | #else 44 | in vec2 translated_coord; 45 | #endif 46 | 47 | 48 | void main() { 49 | vec2 loc = translated_coord; 50 | vec2 modifiedCenter = shift; 51 | 52 | loc = mod(loc + modifiedCenter, 1.0); 53 | 54 | // mirror the image so it's repeated 4 times at different reflections 55 | loc = 2.0 * abs(loc - 0.5); 56 | 57 | gl_FragColor = IMG_NORM_PIXEL(inputImage, loc); 58 | } -------------------------------------------------------------------------------- /test_files/Dreamy.fs: -------------------------------------------------------------------------------- 1 | /* 2 | { 3 | "ISFVSN" : "2", 4 | "INPUTS" : [ 5 | { 6 | "TYPE" : "image", 7 | "NAME" : "startImage" 8 | }, 9 | { 10 | "NAME" : "endImage", 11 | "TYPE" : "image" 12 | }, 13 | { 14 | "TYPE" : "float", 15 | "NAME" : "progress", 16 | "MIN" : 0, 17 | "MAX" : 1, 18 | "DEFAULT" : 0 19 | } 20 | ], 21 | "CATEGORIES" : [ 22 | "Distortion" 23 | ], 24 | "CREDIT": "Automatically converted from https://www.github.com/gl-transitions/gl-transitions/tree/master/Dreamy.glsl", 25 | "DESCRIPTION" : "Automatically converted from https://gl-transitions.com/" 26 | } 27 | */ 28 | 29 | 30 | 31 | vec4 getFromColor(vec2 inUV) { 32 | return IMG_NORM_PIXEL(startImage, inUV); 33 | } 34 | vec4 getToColor(vec2 inUV) { 35 | return IMG_NORM_PIXEL(endImage, inUV); 36 | } 37 | 38 | 39 | 40 | // Author: mikolalysenko 41 | // License: MIT 42 | 43 | vec2 offset(float progress, float x, float theta) { 44 | float phase = progress*progress + progress + theta; 45 | float shifty = 0.03*progress*cos(10.0*(progress+x)); 46 | return vec2(0, shifty); 47 | } 48 | vec4 transition(vec2 p) { 49 | return mix(getFromColor(p + offset(progress, p.x, 0.0)), getToColor(p + offset(1.0-progress, p.x, 3.14)), progress); 50 | } 51 | 52 | 53 | 54 | void main() { 55 | gl_FragColor = transition(isf_FragNormCoord.xy); 56 | } -------------------------------------------------------------------------------- /test_files/Test-Sampler.fs: -------------------------------------------------------------------------------- 1 | /*{ 2 | "DESCRIPTION": "demonstrates the use of multiple image-type inputs", 3 | "CREDIT": "by zoidberg", 4 | "ISFVSN": "2.0", 5 | "CATEGORIES": [ 6 | "TEST-GLSL FX" 7 | ], 8 | "INPUTS": [ 9 | { 10 | "NAME": "inputImage", 11 | "TYPE": "image" 12 | }, 13 | { 14 | "NAME": "blendImage", 15 | "TYPE": "image" 16 | } 17 | ] 18 | }*/ 19 | 20 | void main() 21 | { 22 | // these two variable declarations are functionally identical (the only difference is that THIS_PIXEL is a non-dependent texture lookup) 23 | //vec4 srcPixel = IMG_PIXEL(inputImage, gl_FragCoord.xy); // returns a vec4 with the colors of the pixel in sampler "inputImage" at (non-normalized) texture coordinates "srcCoord" 24 | //vec4 srcPixel = IMG_THIS_PIXEL(inputImage); 25 | 26 | // these two variable declarations are also identical. though they behave similarly to the above declarations in this specific filter, NORM and non-NORM pixel lookups are fundamentally different and behave differently under other circumstances. 27 | //vec4 srcPixel = IMG_NORM_PIXEL(inputImage, isf_FragNormCoord); 28 | vec4 srcPixel = IMG_THIS_NORM_PIXEL(inputImage); 29 | 30 | vec4 blendPixel = IMG_THIS_NORM_PIXEL(blendImage); // returns a vec4 with the colors of the pixel in sampler "inputImage" at (normalized) texture coordinates "blendCoord". 31 | gl_FragColor = srcPixel/2.0 + blendPixel/2.0; 32 | } 33 | -------------------------------------------------------------------------------- /test_files/Burn.fs: -------------------------------------------------------------------------------- 1 | /*{ 2 | "CATEGORIES": [ 3 | "Dissolve" 4 | ], 5 | "CREDIT": "Automatically converted from https://www.github.com/gl-transitions/gl-transitions/tree/master/burn.glsl", 6 | "DESCRIPTION": "", 7 | "INPUTS": [ 8 | { 9 | "NAME": "startImage", 10 | "TYPE": "image" 11 | }, 12 | { 13 | "NAME": "endImage", 14 | "TYPE": "image" 15 | }, 16 | { 17 | "DEFAULT": 0, 18 | "MAX": 1, 19 | "MIN": 0, 20 | "NAME": "progress", 21 | "TYPE": "float" 22 | }, 23 | { 24 | "DEFAULT": [ 25 | 1, 26 | 1, 27 | 1, 28 | 1 29 | ], 30 | "NAME": "color", 31 | "TYPE": "color" 32 | } 33 | ], 34 | "ISFVSN": "2" 35 | } 36 | */ 37 | 38 | 39 | 40 | vec4 getFromColor(vec2 inUV) { 41 | return IMG_NORM_PIXEL(startImage, inUV); 42 | } 43 | vec4 getToColor(vec2 inUV) { 44 | return IMG_NORM_PIXEL(endImage, inUV); 45 | } 46 | 47 | 48 | 49 | // author: gre 50 | // License: MIT 51 | vec4 transition (vec2 uv) { 52 | return mix( 53 | getFromColor(uv) + progress*color, 54 | getToColor(uv) + (1.0-progress)*color, 55 | progress 56 | ); 57 | } 58 | 59 | 60 | 61 | void main() { 62 | gl_FragColor = transition(isf_FragNormCoord.xy); 63 | } -------------------------------------------------------------------------------- /test_files/Heart Transition.fs: -------------------------------------------------------------------------------- 1 | /*{ 2 | "CATEGORIES": [ 3 | "Wipe", 4 | "Retro" 5 | ], 6 | "CREDIT": "Automatically converted from https://www.github.com/gl-transitions/gl-transitions/tree/master/heart.glsl", 7 | "DESCRIPTION": "", 8 | "INPUTS": [ 9 | { 10 | "NAME": "startImage", 11 | "TYPE": "image" 12 | }, 13 | { 14 | "NAME": "endImage", 15 | "TYPE": "image" 16 | }, 17 | { 18 | "DEFAULT": 0, 19 | "MAX": 1, 20 | "MIN": 0, 21 | "NAME": "progress", 22 | "TYPE": "float" 23 | } 24 | ], 25 | "ISFVSN": "2" 26 | } 27 | */ 28 | 29 | 30 | 31 | vec4 getFromColor(vec2 inUV) { 32 | return IMG_NORM_PIXEL(startImage, inUV); 33 | } 34 | vec4 getToColor(vec2 inUV) { 35 | return IMG_NORM_PIXEL(endImage, inUV); 36 | } 37 | 38 | 39 | 40 | // Author: gre 41 | // License: MIT 42 | 43 | float inHeart (vec2 p, vec2 center, float size) { 44 | if (size==0.0) return 0.0; 45 | vec2 o = (p-center)/(1.6*size); 46 | float a = o.x*o.x+o.y*o.y-0.3; 47 | return step(a*a*a, o.x*o.x*o.y*o.y*o.y); 48 | } 49 | vec4 transition (vec2 uv) { 50 | return mix( 51 | getFromColor(uv), 52 | getToColor(uv), 53 | inHeart(uv, vec2(0.5, 0.4), progress) 54 | ); 55 | } 56 | 57 | 58 | 59 | void main() { 60 | gl_FragColor = transition(isf_FragNormCoord.xy); 61 | } -------------------------------------------------------------------------------- /test_files/Shake.fs: -------------------------------------------------------------------------------- 1 | /*{ 2 | "CATEGORIES": [ 3 | "Noise", 4 | "Geometry Adjustment" 5 | ], 6 | "CREDIT": "by VIDVOX", 7 | "INPUTS": [ 8 | { 9 | "NAME": "inputImage", 10 | "TYPE": "image" 11 | }, 12 | { 13 | "DEFAULT": 0, 14 | "MAX": 2, 15 | "MIN": 0, 16 | "NAME": "magnitude", 17 | "TYPE": "float" 18 | }, 19 | { 20 | "DEFAULT": 1, 21 | "MAX": 10, 22 | "MIN": 0, 23 | "NAME": "intensity", 24 | "TYPE": "float" 25 | } 26 | ], 27 | "ISFVSN": "2" 28 | } 29 | */ 30 | 31 | 32 | const float pi = 3.14159265359; 33 | 34 | 35 | float rand(vec2 co) { 36 | return fract(sin(dot(co.xy, vec2(12.9898,78.233))) * 43758.5453); 37 | } 38 | 39 | void main(void) { 40 | float offset = 0.1 * magnitude; 41 | vec2 uv = gl_FragCoord.xy / RENDERSIZE.xy; 42 | float rotation = intensity * 2.0 * pi * rand(vec2(magnitude, TIME)); 43 | float yOffset = offset * sin(TIME * 1.0 * cos(TIME * intensity) + rotation) * rand(vec2(magnitude, TIME)); 44 | float xOffset = offset * cos(TIME * 1.0 * cos(TIME * intensity) + rotation) * rand(vec2(1.0-magnitude, TIME));; 45 | 46 | float zoom = 1.0 + offset; 47 | 48 | uv = (uv - 0.5) / zoom + 0.5; 49 | 50 | uv.y += yOffset; 51 | uv.x += xOffset; 52 | 53 | gl_FragColor = IMG_NORM_PIXEL(inputImage, uv); 54 | } -------------------------------------------------------------------------------- /test_files/Vertex Manipulator.fs: -------------------------------------------------------------------------------- 1 | /*{ 2 | "CATEGORIES": [ 3 | "Geometry Adjustment" 4 | ], 5 | "CREDIT": "VIDVOX", 6 | "DESCRIPTION": "Moves the vertex points to the specified locations without correction", 7 | "INPUTS": [ 8 | { 9 | "NAME": "inputImage", 10 | "TYPE": "image" 11 | }, 12 | { 13 | "DEFAULT": [ 14 | 0, 15 | 1 16 | ], 17 | "LABEL": "Top Left", 18 | "NAME": "topleft", 19 | "TYPE": "point2D" 20 | }, 21 | { 22 | "DEFAULT": [ 23 | 0, 24 | 0 25 | ], 26 | "LABEL": "Bottom Left", 27 | "NAME": "bottomleft", 28 | "TYPE": "point2D" 29 | }, 30 | { 31 | "DEFAULT": [ 32 | 1, 33 | 1 34 | ], 35 | "LABEL": "Top Right", 36 | "NAME": "topright", 37 | "TYPE": "point2D" 38 | }, 39 | { 40 | "DEFAULT": [ 41 | 1, 42 | 0 43 | ], 44 | "LABEL": "Bottom Right", 45 | "NAME": "bottomright", 46 | "TYPE": "point2D" 47 | } 48 | ], 49 | "ISFVSN": "2" 50 | } 51 | */ 52 | 53 | 54 | void main() 55 | { 56 | vec4 test = IMG_THIS_PIXEL(inputImage); 57 | gl_FragColor = test; 58 | } 59 | -------------------------------------------------------------------------------- /test_files/v002 Bleach Bypass.fs: -------------------------------------------------------------------------------- 1 | /*{ 2 | "CATEGORIES": [ 3 | "Color Adjustment", 4 | "Film", 5 | "v002" 6 | ], 7 | "CREDIT": "by v002", 8 | "INPUTS": [ 9 | { 10 | "NAME": "inputImage", 11 | "TYPE": "image" 12 | }, 13 | { 14 | "DEFAULT": 0, 15 | "MAX": 1, 16 | "MIN": 0, 17 | "NAME": "amount", 18 | "TYPE": "float" 19 | } 20 | ], 21 | "ISFVSN": "2" 22 | } 23 | */ 24 | 25 | // Based on v002 bleach bypass – https://github.com/v002/v002-Film-Effects/ 26 | 27 | //constant variables. 28 | const vec4 one = vec4(1.0); 29 | const vec4 two = vec4(2.0); 30 | //const vec4 lumcoeff = vec4(0.2125,0.7154,0.0721,0.0); 31 | const vec4 lumcoeff = vec4(0.2126, 0.7152, 0.0722, 0.0); 32 | 33 | 34 | vec4 overlay(vec4 myInput, vec4 previousmix, vec4 amount) 35 | { 36 | float luminance = dot(previousmix,lumcoeff); 37 | float mixamount = clamp((luminance - 0.45) * 10., 0., 1.); 38 | 39 | vec4 branch1 = two * previousmix * myInput; 40 | vec4 branch2 = one - (two * (one - previousmix) * (one - myInput)); 41 | 42 | vec4 result = mix(branch1, branch2, vec4(mixamount) ); 43 | 44 | return mix(previousmix, result, amount); 45 | } 46 | 47 | void main (void) 48 | { 49 | vec4 input0 = IMG_THIS_PIXEL(inputImage); 50 | 51 | vec4 luma = vec4(dot(input0,lumcoeff)); 52 | 53 | gl_FragColor = overlay(luma, input0, vec4(amount)); 54 | 55 | } -------------------------------------------------------------------------------- /test_files/Vibrance.fs: -------------------------------------------------------------------------------- 1 | /*{ 2 | "CREDIT": "by zoidberg", 3 | "ISFVSN": "2", 4 | "CATEGORIES": [ 5 | "Color Adjustment" 6 | ], 7 | "INPUTS": [ 8 | { 9 | "NAME": "inputImage", 10 | "TYPE": "image" 11 | }, 12 | { 13 | "NAME": "vibrance", 14 | "TYPE": "float", 15 | "MIN": -0.25, 16 | "MAX": 0.6, 17 | "DEFAULT": 0.0 18 | } 19 | ] 20 | }*/ 21 | 22 | 23 | vec3 rgb2hsv(vec3 c); 24 | vec3 hsv2rgb(vec3 c); 25 | 26 | void main() { 27 | vec4 tmpColorA = IMG_THIS_PIXEL(inputImage); 28 | vec3 tmpColorB = rgb2hsv(tmpColorA.rgb); 29 | float maxDelta = sqrt(tmpColorB.y) - tmpColorB.y; 30 | tmpColorB.y = (maxDelta * vibrance) + tmpColorB.y; 31 | tmpColorA.rgb = hsv2rgb(tmpColorB.rgb); 32 | gl_FragColor = tmpColorA; 33 | } 34 | 35 | 36 | 37 | 38 | vec3 rgb2hsv(vec3 c) { 39 | vec4 K = vec4(0.0, -1.0 / 3.0, 2.0 / 3.0, -1.0); 40 | //vec4 p = mix(vec4(c.bg, K.wz), vec4(c.gb, K.xy), step(c.b, c.g)); 41 | //vec4 q = mix(vec4(p.xyw, c.r), vec4(c.r, p.yzx), step(p.x, c.r)); 42 | vec4 p = c.g < c.b ? vec4(c.bg, K.wz) : vec4(c.gb, K.xy); 43 | vec4 q = c.r < p.x ? vec4(p.xyw, c.r) : vec4(c.r, p.yzx); 44 | 45 | float d = q.x - min(q.w, q.y); 46 | float e = 1.0e-10; 47 | return vec3(abs(q.z + (q.w - q.y) / (6.0 * d + e)), d / (q.x + e), q.x); 48 | } 49 | 50 | vec3 hsv2rgb(vec3 c) { 51 | vec4 K = vec4(1.0, 2.0 / 3.0, 1.0 / 3.0, 3.0); 52 | vec3 p = abs(fract(c.xxx + K.xyz) * 6.0 - K.www); 53 | return c.z * mix(K.xxx, clamp(p - K.xxx, 0.0, 1.0), c.y); 54 | } -------------------------------------------------------------------------------- /test_files/XYZoom.fs: -------------------------------------------------------------------------------- 1 | /*{ 2 | "CATEGORIES": [ 3 | "Geometry Adjustment" 4 | ], 5 | "CREDIT": "by VIDVOX", 6 | "INPUTS": [ 7 | { 8 | "NAME": "inputImage", 9 | "TYPE": "image" 10 | }, 11 | { 12 | "DEFAULT": 1, 13 | "MAX": 10, 14 | "MIN": 0.01, 15 | "NAME": "levelX", 16 | "TYPE": "float" 17 | }, 18 | { 19 | "DEFAULT": 1, 20 | "MAX": 10, 21 | "MIN": 0.01, 22 | "NAME": "levelY", 23 | "TYPE": "float" 24 | }, 25 | { 26 | "DEFAULT": [ 27 | 0, 28 | 0 29 | ], 30 | "MAX": [ 31 | 1, 32 | 1 33 | ], 34 | "MIN": [ 35 | 0, 36 | 0 37 | ], 38 | "NAME": "center", 39 | "TYPE": "point2D" 40 | } 41 | ], 42 | "ISFVSN": "2" 43 | } 44 | */ 45 | 46 | void main() { 47 | vec2 loc; 48 | vec2 modifiedCenter; 49 | 50 | loc = isf_FragNormCoord; 51 | modifiedCenter = center; 52 | loc.x = (loc.x - modifiedCenter.x)*(1.0/levelX) + modifiedCenter.x; 53 | loc.y = (loc.y - modifiedCenter.y)*(1.0/levelY) + modifiedCenter.y; 54 | if ((loc.x < 0.0)||(loc.y < 0.0)||(loc.x > 1.0)||(loc.y > 1.0)) { 55 | gl_FragColor = vec4(0.0); 56 | } 57 | else { 58 | gl_FragColor = IMG_NORM_PIXEL(inputImage,loc); 59 | } 60 | } 61 | -------------------------------------------------------------------------------- /test_files/Channel Slide.fs: -------------------------------------------------------------------------------- 1 | /*{ 2 | "CREDIT": "by zoidberg", 3 | "ISFVSN": "2", 4 | "CATEGORIES": [ 5 | "Color Effect" 6 | ], 7 | "INPUTS": [ 8 | { 9 | "NAME": "inputImage", 10 | "TYPE": "image" 11 | }, 12 | { 13 | "NAME": "slideAmt", 14 | "LABEL": "slide amount", 15 | "TYPE": "color", 16 | "DEFAULT": [ 17 | 0.0, 18 | 0.0, 19 | 0.0, 20 | 0.0 21 | ] 22 | }, 23 | { 24 | "NAME": "reflection", 25 | "TYPE": "bool", 26 | "DEFAULT": 0.0 27 | } 28 | ] 29 | }*/ 30 | 31 | void main() { 32 | vec4 srcPixel = IMG_THIS_PIXEL(inputImage); 33 | if (reflection == true) { 34 | vec4 outPixel; 35 | outPixel.rgb = srcPixel.rgb - slideAmt.rgb; 36 | outPixel.a = srcPixel.a + slideAmt.a; // alpha behaves the same in both modes (just easier to work with) 37 | gl_FragColor.x = (outPixel.x<0.0) ? outPixel.x+1.0 : outPixel.x; 38 | gl_FragColor.y = (outPixel.y<0.0) ? outPixel.y+1.0 : outPixel.y; 39 | gl_FragColor.z = (outPixel.z<0.0) ? outPixel.z+1.0 : outPixel.z; 40 | //gl_FragColor.a = (outPixel.a<0.0) ? outPixel.a+1.0 : outPixel.a; 41 | gl_FragColor.a = (outPixel.a>1.0) ? outPixel.a-1.0 : outPixel.a; 42 | } 43 | else { 44 | vec4 outPixel = srcPixel+slideAmt; 45 | gl_FragColor.x = (outPixel.x>1.0) ? outPixel.x-1.0 : outPixel.x; 46 | gl_FragColor.y = (outPixel.y>1.0) ? outPixel.y-1.0 : outPixel.y; 47 | gl_FragColor.z = (outPixel.z>1.0) ? outPixel.z-1.0 : outPixel.z; 48 | gl_FragColor.a = (outPixel.a>1.0) ? outPixel.a-1.0 : outPixel.a; 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /test_files/v002 Erode.fs: -------------------------------------------------------------------------------- 1 | /*{ 2 | "DESCRIPTION": "messed up version of v002 erode", 3 | "CREDIT": "by carter rosenberg", 4 | "ISFVSN": "2", 5 | "CATEGORIES": [ 6 | "Blur", "v002" 7 | ], 8 | "INPUTS": [ 9 | { 10 | "NAME": "inputImage", 11 | "TYPE": "image" 12 | }, 13 | { 14 | "NAME": "amount", 15 | "TYPE": "float", 16 | "MIN": 0.0, 17 | "MAX": 0.1, 18 | "DEFAULT": 0.01 19 | } 20 | ] 21 | }*/ 22 | 23 | #if __VERSION__ <= 120 24 | varying vec2 texcoord0; 25 | varying vec2 texcoord1; 26 | varying vec2 texcoord2; 27 | varying vec2 texcoord3; 28 | varying vec2 texcoord4; 29 | varying vec2 texcoord5; 30 | varying vec2 texcoord6; 31 | varying vec2 texcoord7; 32 | #else 33 | in vec2 texcoord0; 34 | in vec2 texcoord1; 35 | in vec2 texcoord2; 36 | in vec2 texcoord3; 37 | in vec2 texcoord4; 38 | in vec2 texcoord5; 39 | in vec2 texcoord6; 40 | in vec2 texcoord7; 41 | #endif 42 | 43 | void main() 44 | { 45 | vec4 erode = IMG_NORM_PIXEL(inputImage, 0.5 * (texcoord3 + texcoord4)); 46 | 47 | erode = min(erode, IMG_NORM_PIXEL(inputImage, texcoord0)); 48 | erode = min(erode, IMG_NORM_PIXEL(inputImage, texcoord1)); 49 | erode = min(erode, IMG_NORM_PIXEL(inputImage, texcoord2)); 50 | erode = min(erode, IMG_NORM_PIXEL(inputImage, texcoord3)); 51 | erode = min(erode, IMG_NORM_PIXEL(inputImage, texcoord4)); 52 | erode = min(erode, IMG_NORM_PIXEL(inputImage, texcoord5)); 53 | erode = min(erode, IMG_NORM_PIXEL(inputImage, texcoord6)); 54 | erode = min(erode, IMG_NORM_PIXEL(inputImage, texcoord7)); 55 | 56 | gl_FragColor = erode; 57 | } -------------------------------------------------------------------------------- /test_files/Pinwheel.fs: -------------------------------------------------------------------------------- 1 | /*{ 2 | "CATEGORIES": [ 3 | "Wipe" 4 | ], 5 | "CREDIT": "Automatically converted from https://www.github.com/gl-transitions/gl-transitions/tree/master/pinwheel.glsl", 6 | "DESCRIPTION": "", 7 | "INPUTS": [ 8 | { 9 | "NAME": "startImage", 10 | "TYPE": "image" 11 | }, 12 | { 13 | "NAME": "endImage", 14 | "TYPE": "image" 15 | }, 16 | { 17 | "DEFAULT": 0, 18 | "MAX": 1, 19 | "MIN": 0, 20 | "NAME": "progress", 21 | "TYPE": "float" 22 | }, 23 | { 24 | "DEFAULT": 2, 25 | "MAX": 10, 26 | "MIN": 0, 27 | "NAME": "speed", 28 | "TYPE": "float" 29 | } 30 | ], 31 | "ISFVSN": "2" 32 | } 33 | */ 34 | 35 | 36 | 37 | vec4 getFromColor(vec2 inUV) { 38 | return IMG_NORM_PIXEL(startImage, inUV); 39 | } 40 | vec4 getToColor(vec2 inUV) { 41 | return IMG_NORM_PIXEL(endImage, inUV); 42 | } 43 | 44 | 45 | 46 | // Author: Mr Speaker 47 | // License: MIT 48 | 49 | 50 | vec4 transition(vec2 uv) { 51 | 52 | vec2 p = uv.xy / vec2(1.0).xy; 53 | 54 | float circPos = atan(p.y - 0.5, p.x - 0.5) + progress * speed; 55 | float modPos = mod(circPos, 3.1415 / 4.); 56 | float signed = sign(progress - modPos); 57 | 58 | return mix(getToColor(p), getFromColor(p), step(signed, 0.5)); 59 | 60 | } 61 | 62 | 63 | 64 | void main() { 65 | gl_FragColor = transition(isf_FragNormCoord.xy); 66 | } -------------------------------------------------------------------------------- /test_files/Radial.fs: -------------------------------------------------------------------------------- 1 | /*{ 2 | "CATEGORIES": [ 3 | "Wipe" 4 | ], 5 | "CREDIT": "Automatically converted from https://www.github.com/gl-transitions/gl-transitions/tree/master/Radial.glsl", 6 | "DESCRIPTION": "", 7 | "INPUTS": [ 8 | { 9 | "NAME": "startImage", 10 | "TYPE": "image" 11 | }, 12 | { 13 | "NAME": "endImage", 14 | "TYPE": "image" 15 | }, 16 | { 17 | "DEFAULT": 0, 18 | "MAX": 1, 19 | "MIN": 0, 20 | "NAME": "progress", 21 | "TYPE": "float" 22 | }, 23 | { 24 | "DEFAULT": 0.5, 25 | "MAX": 1, 26 | "MIN": 0, 27 | "NAME": "smoothness", 28 | "TYPE": "float" 29 | } 30 | ], 31 | "ISFVSN": "2" 32 | } 33 | */ 34 | 35 | 36 | 37 | vec4 getFromColor(vec2 inUV) { 38 | return IMG_NORM_PIXEL(startImage, inUV); 39 | } 40 | vec4 getToColor(vec2 inUV) { 41 | return IMG_NORM_PIXEL(endImage, inUV); 42 | } 43 | 44 | 45 | 46 | // License: MIT 47 | // Author: Xaychru 48 | // ported by gre from https://gist.github.com/Xaychru/ce1d48f0ce00bb379750 49 | 50 | 51 | const float PI = 3.141592653589; 52 | 53 | vec4 transition(vec2 p) { 54 | vec2 rp = p*2.-1.; 55 | return mix( 56 | getToColor(p), 57 | getFromColor(p), 58 | smoothstep(0., smoothness, atan(rp.y,rp.x) - (progress-.5) * PI * 2.5) 59 | ); 60 | } 61 | 62 | 63 | 64 | void main() { 65 | gl_FragColor = transition(isf_FragNormCoord.xy); 66 | } -------------------------------------------------------------------------------- /test_files/Triangle Warp.fs: -------------------------------------------------------------------------------- 1 | /*{ 2 | "CATEGORIES": [ 3 | "Distortion Effect" 4 | ], 5 | "CREDIT": "VIDVOX", 6 | "DESCRIPTION": "Warps an image to fit in a triangle by fitting the height of the image to the height of a triangle", 7 | "INPUTS": [ 8 | { 9 | "NAME": "inputImage", 10 | "TYPE": "image" 11 | }, 12 | { 13 | "DEFAULT": [ 14 | 0.5, 15 | 1 16 | ], 17 | "MAX": [ 18 | 1, 19 | 1 20 | ], 21 | "MIN": [ 22 | 0, 23 | 0 24 | ], 25 | "NAME": "peakPoint", 26 | "TYPE": "point2D" 27 | }, 28 | { 29 | "DEFAULT": 0, 30 | "MAX": 1, 31 | "MIN": 0, 32 | "NAME": "distortX", 33 | "TYPE": "float" 34 | } 35 | ], 36 | "ISFVSN": "2" 37 | } 38 | */ 39 | 40 | void main() { 41 | vec4 inputPixelColor = vec4(0.0); 42 | vec2 pt = isf_FragNormCoord; 43 | float val = 0.0; 44 | 45 | if (pt.x < peakPoint.x) { 46 | pt.x = pt.x * 0.5 / peakPoint.x; 47 | val = 2.0 * pt.x * peakPoint.y; 48 | } 49 | else { 50 | pt.x = 0.5 + 0.5 * (pt.x - peakPoint.x) / (1.0 - peakPoint.x); 51 | val = (2.0 - 2.0 * pt.x) * peakPoint.y; 52 | } 53 | if (pt.y <= val) { 54 | pt.x = mix(isf_FragNormCoord.x,pt.x,distortX); 55 | pt.y /= val; 56 | inputPixelColor = IMG_NORM_PIXEL(inputImage, pt); 57 | } 58 | 59 | gl_FragColor = inputPixelColor; 60 | } 61 | -------------------------------------------------------------------------------- /test_files/v002 Dilate.fs: -------------------------------------------------------------------------------- 1 | /*{ 2 | "DESCRIPTION": "messed up version of v002 dilate", 3 | "CREDIT": "by carter rosenberg", 4 | "ISFVSN": "2", 5 | "CATEGORIES": [ 6 | "Blur", "v002" 7 | ], 8 | "INPUTS": [ 9 | { 10 | "NAME": "inputImage", 11 | "TYPE": "image" 12 | }, 13 | { 14 | "NAME": "amount", 15 | "TYPE": "float", 16 | "MIN": 0.0, 17 | "MAX": 0.1, 18 | "DEFAULT": 0.01 19 | } 20 | ] 21 | }*/ 22 | 23 | #if __VERSION__ <= 120 24 | varying vec2 texcoord0; 25 | varying vec2 texcoord1; 26 | varying vec2 texcoord2; 27 | varying vec2 texcoord3; 28 | varying vec2 texcoord4; 29 | varying vec2 texcoord5; 30 | varying vec2 texcoord6; 31 | varying vec2 texcoord7; 32 | #else 33 | in vec2 texcoord0; 34 | in vec2 texcoord1; 35 | in vec2 texcoord2; 36 | in vec2 texcoord3; 37 | in vec2 texcoord4; 38 | in vec2 texcoord5; 39 | in vec2 texcoord6; 40 | in vec2 texcoord7; 41 | #endif 42 | 43 | void main() 44 | { 45 | 46 | vec4 dilate = IMG_NORM_PIXEL(inputImage, 0.5 * (texcoord3 + texcoord4)); 47 | 48 | dilate = max(dilate, IMG_NORM_PIXEL(inputImage, texcoord0)); 49 | dilate = max(dilate, IMG_NORM_PIXEL(inputImage, texcoord1)); 50 | dilate = max(dilate, IMG_NORM_PIXEL(inputImage, texcoord2)); 51 | dilate = max(dilate, IMG_NORM_PIXEL(inputImage, texcoord3)); 52 | dilate = max(dilate, IMG_NORM_PIXEL(inputImage, texcoord4)); 53 | dilate = max(dilate, IMG_NORM_PIXEL(inputImage, texcoord5)); 54 | dilate = max(dilate, IMG_NORM_PIXEL(inputImage, texcoord6)); 55 | dilate = max(dilate, IMG_NORM_PIXEL(inputImage, texcoord7)); 56 | 57 | gl_FragColor = dilate; 58 | } -------------------------------------------------------------------------------- /test_files/Morph.fs: -------------------------------------------------------------------------------- 1 | /*{ 2 | "CATEGORIES": [ 3 | "Distortion" 4 | ], 5 | "CREDIT": "Automatically converted from https://www.github.com/gl-transitions/gl-transitions/tree/master/morph.glsl", 6 | "DESCRIPTION": "", 7 | "INPUTS": [ 8 | { 9 | "NAME": "startImage", 10 | "TYPE": "image" 11 | }, 12 | { 13 | "NAME": "endImage", 14 | "TYPE": "image" 15 | }, 16 | { 17 | "DEFAULT": 0, 18 | "MAX": 1, 19 | "MIN": 0, 20 | "NAME": "progress", 21 | "TYPE": "float" 22 | }, 23 | { 24 | "DEFAULT": 0.1, 25 | "MAX": 1, 26 | "MIN": 0, 27 | "NAME": "strength", 28 | "TYPE": "float" 29 | } 30 | ], 31 | "ISFVSN": "2" 32 | } 33 | */ 34 | 35 | 36 | 37 | vec4 getFromColor(vec2 inUV) { 38 | return IMG_NORM_PIXEL(startImage, inUV); 39 | } 40 | vec4 getToColor(vec2 inUV) { 41 | return IMG_NORM_PIXEL(endImage, inUV); 42 | } 43 | 44 | 45 | 46 | // Author: paniq 47 | // License: MIT 48 | 49 | vec4 transition(vec2 p) { 50 | vec4 ca = getFromColor(p); 51 | vec4 cb = getToColor(p); 52 | 53 | vec2 oa = (((ca.rg+ca.b)*0.5)*2.0-1.0); 54 | vec2 ob = (((cb.rg+cb.b)*0.5)*2.0-1.0); 55 | vec2 oc = mix(oa,ob,0.5)*strength; 56 | 57 | float w0 = progress; 58 | float w1 = 1.0-w0; 59 | return mix(getFromColor(p+oc*w0), getToColor(p-oc*w1), progress); 60 | } 61 | 62 | 63 | 64 | void main() { 65 | gl_FragColor = transition(isf_FragNormCoord.xy); 66 | } -------------------------------------------------------------------------------- /test_files/Colour Distance.fs: -------------------------------------------------------------------------------- 1 | /*{ 2 | "CATEGORIES": [ 3 | "Dissolve", 4 | "Wipe" 5 | ], 6 | "CREDIT": "Automatically converted from https://www.github.com/gl-transitions/gl-transitions/tree/master/ColourDistance.glsl", 7 | "DESCRIPTION": "", 8 | "INPUTS": [ 9 | { 10 | "NAME": "startImage", 11 | "TYPE": "image" 12 | }, 13 | { 14 | "NAME": "endImage", 15 | "TYPE": "image" 16 | }, 17 | { 18 | "DEFAULT": 0, 19 | "MAX": 1, 20 | "MIN": 0, 21 | "NAME": "progress", 22 | "TYPE": "float" 23 | }, 24 | { 25 | "DEFAULT": 5, 26 | "MAX": 10, 27 | "MIN": 0, 28 | "NAME": "power", 29 | "TYPE": "float" 30 | } 31 | ], 32 | "ISFVSN": "2" 33 | } 34 | */ 35 | 36 | 37 | 38 | vec4 getFromColor(vec2 inUV) { 39 | return IMG_NORM_PIXEL(startImage, inUV); 40 | } 41 | vec4 getToColor(vec2 inUV) { 42 | return IMG_NORM_PIXEL(endImage, inUV); 43 | } 44 | 45 | 46 | 47 | // License: MIT 48 | // Author: P-Seebauer 49 | // ported by gre from https://gist.github.com/P-Seebauer/2a5fa2f77c883dd661f9 50 | 51 | 52 | vec4 transition(vec2 p) { 53 | vec4 fTex = getFromColor(p); 54 | vec4 tTex = getToColor(p); 55 | float m = step(distance(fTex, tTex), progress); 56 | return mix( 57 | mix(fTex, tTex, m), 58 | tTex, 59 | pow(progress, power) 60 | ); 61 | } 62 | 63 | 64 | 65 | void main() { 66 | gl_FragColor = transition(isf_FragNormCoord.xy); 67 | } -------------------------------------------------------------------------------- /test_files/Wind.fs: -------------------------------------------------------------------------------- 1 | /*{ 2 | "CATEGORIES": [ 3 | "Wipe" 4 | ], 5 | "CREDIT": "Automatically converted from https://www.github.com/gl-transitions/gl-transitions/tree/master/wind.glsl", 6 | "DESCRIPTION": "", 7 | "INPUTS": [ 8 | { 9 | "NAME": "startImage", 10 | "TYPE": "image" 11 | }, 12 | { 13 | "NAME": "endImage", 14 | "TYPE": "image" 15 | }, 16 | { 17 | "DEFAULT": 0, 18 | "MAX": 1, 19 | "MIN": 0, 20 | "NAME": "progress", 21 | "TYPE": "float" 22 | }, 23 | { 24 | "DEFAULT": 0.2, 25 | "MAX": 1, 26 | "MIN": 0, 27 | "NAME": "size", 28 | "TYPE": "float" 29 | } 30 | ], 31 | "ISFVSN": "2" 32 | } 33 | */ 34 | 35 | 36 | 37 | vec4 getFromColor(vec2 inUV) { 38 | return IMG_NORM_PIXEL(startImage, inUV); 39 | } 40 | vec4 getToColor(vec2 inUV) { 41 | return IMG_NORM_PIXEL(endImage, inUV); 42 | } 43 | 44 | 45 | 46 | // Author: gre 47 | // License: MIT 48 | 49 | // Custom parameters 50 | 51 | float rand (vec2 co) { 52 | return fract(sin(dot(co.xy ,vec2(12.9898,78.233))) * 43758.5453); 53 | } 54 | 55 | vec4 transition (vec2 uv) { 56 | float r = rand(vec2(0, uv.y)); 57 | float m = smoothstep(0.0, -size, uv.x*(1.0-size) + size*r - (progress * (1.0 + size))); 58 | return mix( 59 | getFromColor(uv), 60 | getToColor(uv), 61 | m 62 | ); 63 | } 64 | 65 | 66 | 67 | void main() { 68 | gl_FragColor = transition(isf_FragNormCoord.xy); 69 | } -------------------------------------------------------------------------------- /test_files/Long Exposure.fs: -------------------------------------------------------------------------------- 1 | /* 2 | { 3 | "CATEGORIES" : [ 4 | "Color Effect", "Feedback", "Film" 5 | ], 6 | "DESCRIPTION" : "Bright objects burn in and optionally decay", 7 | "ISFVSN" : "2", 8 | "INPUTS" : [ 9 | { 10 | "NAME" : "inputImage", 11 | "TYPE" : "image" 12 | }, 13 | { 14 | "NAME" : "absorptionRate", 15 | "TYPE" : "float", 16 | "MAX" : 1, 17 | "DEFAULT" : 0.5, 18 | "MIN" : -1, 19 | "LABEL" : "Absorption Rate" 20 | }, 21 | { 22 | "NAME" : "dischargeRate", 23 | "TYPE" : "float", 24 | "MAX" : 1, 25 | "DEFAULT" : 0.25, 26 | "MIN" : 0, 27 | "LABEL" : "Discharge Rate" 28 | } 29 | ], 30 | "PASSES" : [ 31 | { 32 | "TARGET" : "feedbackBuffer", 33 | "PERSISTENT" : true, 34 | "FLOAT" : true 35 | }, 36 | { 37 | 38 | } 39 | ], 40 | "CREDIT" : "VIDVOX" 41 | } 42 | */ 43 | 44 | void main() 45 | { 46 | vec4 freshPixel = IMG_PIXEL(inputImage,gl_FragCoord.xy); 47 | vec4 stalePixel = IMG_PIXEL(feedbackBuffer,gl_FragCoord.xy); 48 | vec4 resultPixel = vec4(0.0); 49 | 50 | // absorb and discharge 51 | if (PASSINDEX==0) { 52 | // start with the old pixel amount 53 | resultPixel = stalePixel; 54 | // discharge from previous pass 55 | resultPixel *= (1.0 - dischargeRate); 56 | // add this pass 57 | resultPixel += (freshPixel * absorptionRate); 58 | resultPixel = clamp(resultPixel,0.0,1.0); 59 | } 60 | // composite 61 | else if (PASSINDEX==1) { 62 | resultPixel = freshPixel + stalePixel; 63 | } 64 | 65 | gl_FragColor = resultPixel; 66 | } 67 | -------------------------------------------------------------------------------- /test_files/Simple Zoom Transition.fs: -------------------------------------------------------------------------------- 1 | /*{ 2 | "CATEGORIES": [ 3 | "Distortion", 4 | "Dissolve" 5 | ], 6 | "CREDIT": "Automatically converted from https://www.github.com/gl-transitions/gl-transitions/tree/master/SimpleZoom.glsl", 7 | "DESCRIPTION": "", 8 | "INPUTS": [ 9 | { 10 | "NAME": "startImage", 11 | "TYPE": "image" 12 | }, 13 | { 14 | "NAME": "endImage", 15 | "TYPE": "image" 16 | }, 17 | { 18 | "DEFAULT": 0, 19 | "MAX": 1, 20 | "MIN": 0, 21 | "NAME": "progress", 22 | "TYPE": "float" 23 | }, 24 | { 25 | "DEFAULT": 0.8, 26 | "MAX": 1, 27 | "MIN": 0, 28 | "NAME": "zoom_quickness", 29 | "TYPE": "float" 30 | } 31 | ], 32 | "ISFVSN": "2" 33 | } 34 | */ 35 | 36 | 37 | 38 | vec4 getFromColor(vec2 inUV) { 39 | return IMG_NORM_PIXEL(startImage, inUV); 40 | } 41 | vec4 getToColor(vec2 inUV) { 42 | return IMG_NORM_PIXEL(endImage, inUV); 43 | } 44 | 45 | 46 | 47 | // Author: 0gust1 48 | // License: MIT 49 | 50 | float nQuick = clamp(zoom_quickness,0.2,1.0); 51 | 52 | vec2 zoom(vec2 uv, float amount) { 53 | return 0.5 + ((uv - 0.5) * (1.0-amount)); 54 | } 55 | 56 | vec4 transition (vec2 uv) { 57 | return mix( 58 | getFromColor(zoom(uv, smoothstep(0.0, nQuick, progress))), 59 | getToColor(uv), 60 | smoothstep(nQuick-0.2, 1.0, progress) 61 | ); 62 | } 63 | 64 | 65 | 66 | void main() { 67 | gl_FragColor = transition(isf_FragNormCoord.xy); 68 | } -------------------------------------------------------------------------------- /test_files/Window Slice.fs: -------------------------------------------------------------------------------- 1 | /*{ 2 | "CATEGORIES": [ 3 | "Wipe" 4 | ], 5 | "CREDIT": "Automatically converted from https://www.github.com/gl-transitions/gl-transitions/tree/master/windowslice.glsl", 6 | "DESCRIPTION": "", 7 | "INPUTS": [ 8 | { 9 | "NAME": "startImage", 10 | "TYPE": "image" 11 | }, 12 | { 13 | "NAME": "endImage", 14 | "TYPE": "image" 15 | }, 16 | { 17 | "DEFAULT": 0, 18 | "MAX": 1, 19 | "MIN": 0, 20 | "NAME": "progress", 21 | "TYPE": "float" 22 | }, 23 | { 24 | "DEFAULT": 10, 25 | "MAX": 100, 26 | "MIN": 0, 27 | "NAME": "count", 28 | "TYPE": "float" 29 | }, 30 | { 31 | "DEFAULT": 0.5, 32 | "MAX": 1, 33 | "MIN": 0, 34 | "NAME": "smoothness", 35 | "TYPE": "float" 36 | } 37 | ], 38 | "ISFVSN": "2" 39 | } 40 | */ 41 | 42 | 43 | 44 | vec4 getFromColor(vec2 inUV) { 45 | return IMG_NORM_PIXEL(startImage, inUV); 46 | } 47 | vec4 getToColor(vec2 inUV) { 48 | return IMG_NORM_PIXEL(endImage, inUV); 49 | } 50 | 51 | 52 | 53 | // Author: gre 54 | // License: MIT 55 | 56 | 57 | vec4 transition (vec2 p) { 58 | float pr = smoothstep(-smoothness, 0.0, p.x - progress * (1.0 + smoothness)); 59 | float s = step(pr, fract(count * p.x)); 60 | return mix(getFromColor(p), getToColor(p), s); 61 | } 62 | 63 | 64 | 65 | void main() { 66 | gl_FragColor = transition(isf_FragNormCoord.xy); 67 | } -------------------------------------------------------------------------------- /test_files/Squeeze.fs: -------------------------------------------------------------------------------- 1 | /*{ 2 | "CATEGORIES": [ 3 | "Wipe" 4 | ], 5 | "CREDIT": "Automatically converted from https://www.github.com/gl-transitions/gl-transitions/tree/master/squeeze.glsl", 6 | "DESCRIPTION": "", 7 | "INPUTS": [ 8 | { 9 | "NAME": "startImage", 10 | "TYPE": "image" 11 | }, 12 | { 13 | "NAME": "endImage", 14 | "TYPE": "image" 15 | }, 16 | { 17 | "DEFAULT": 0, 18 | "MAX": 1, 19 | "MIN": 0, 20 | "NAME": "progress", 21 | "TYPE": "float" 22 | }, 23 | { 24 | "DEFAULT": 0.04, 25 | "MAX": 1, 26 | "MIN": 0, 27 | "NAME": "colorSeparation", 28 | "TYPE": "float" 29 | } 30 | ], 31 | "ISFVSN": "2" 32 | } 33 | */ 34 | 35 | 36 | 37 | vec4 getFromColor(vec2 inUV) { 38 | return IMG_NORM_PIXEL(startImage, inUV); 39 | } 40 | vec4 getToColor(vec2 inUV) { 41 | return IMG_NORM_PIXEL(endImage, inUV); 42 | } 43 | 44 | 45 | 46 | // Author: gre 47 | // License: MIT 48 | 49 | 50 | vec4 transition (vec2 uv) { 51 | float y = 0.5 + (uv.y-0.5) / (1.0-progress); 52 | if (y < 0.0 || y > 1.0) { 53 | return getToColor(uv); 54 | } 55 | else { 56 | vec2 fp = vec2(uv.x, y); 57 | vec2 off = progress * vec2(0.0, colorSeparation); 58 | vec4 c = getFromColor(fp); 59 | vec4 cn = getFromColor(fp - off); 60 | vec4 cp = getFromColor(fp + off); 61 | return vec4(cn.r, c.g, cp.b, c.a); 62 | } 63 | } 64 | 65 | 66 | 67 | void main() { 68 | gl_FragColor = transition(isf_FragNormCoord.xy); 69 | } -------------------------------------------------------------------------------- /test_files/Fade Gray Scale.fs: -------------------------------------------------------------------------------- 1 | /*{ 2 | "CATEGORIES": [ 3 | "Dissolve" 4 | ], 5 | "CREDIT": "Automatically converted from https://www.github.com/gl-transitions/gl-transitions/tree/master/fadegrayscale.glsl", 6 | "DESCRIPTION": "", 7 | "INPUTS": [ 8 | { 9 | "NAME": "startImage", 10 | "TYPE": "image" 11 | }, 12 | { 13 | "NAME": "endImage", 14 | "TYPE": "image" 15 | }, 16 | { 17 | "DEFAULT": 0, 18 | "MAX": 1, 19 | "MIN": 0, 20 | "NAME": "progress", 21 | "TYPE": "float" 22 | }, 23 | { 24 | "DEFAULT": 0.3, 25 | "MAX": 1, 26 | "MIN": 0, 27 | "NAME": "intensity", 28 | "TYPE": "float" 29 | } 30 | ], 31 | "ISFVSN": "2" 32 | } 33 | */ 34 | 35 | 36 | 37 | vec4 getFromColor(vec2 inUV) { 38 | return IMG_NORM_PIXEL(startImage, inUV); 39 | } 40 | vec4 getToColor(vec2 inUV) { 41 | return IMG_NORM_PIXEL(endImage, inUV); 42 | } 43 | 44 | 45 | 46 | // Author: gre 47 | // License: MIT 48 | 49 | 50 | vec3 grayscale (vec3 color) { 51 | return vec3(0.2126*color.r + 0.7152*color.g + 0.0722*color.b); 52 | } 53 | 54 | vec4 transition (vec2 uv) { 55 | vec4 fc = getFromColor(uv); 56 | vec4 tc = getToColor(uv); 57 | return mix( 58 | mix(vec4(grayscale(fc.rgb), 1.0), fc, smoothstep(1.0-intensity, 0.0, progress)), 59 | mix(vec4(grayscale(tc.rgb), 1.0), tc, smoothstep( intensity, 1.0, progress)), 60 | progress); 61 | } 62 | 63 | 64 | 65 | void main() { 66 | gl_FragColor = transition(isf_FragNormCoord.xy); 67 | } -------------------------------------------------------------------------------- /test_files/Angular.fs: -------------------------------------------------------------------------------- 1 | /*{ 2 | "CATEGORIES": [ 3 | "Wipe" 4 | ], 5 | "CREDIT": "Automatically converted from https://www.github.com/gl-transitions/gl-transitions/tree/master/angular.glsl", 6 | "DESCRIPTION": "", 7 | "INPUTS": [ 8 | { 9 | "NAME": "startImage", 10 | "TYPE": "image" 11 | }, 12 | { 13 | "NAME": "endImage", 14 | "TYPE": "image" 15 | }, 16 | { 17 | "DEFAULT": 0, 18 | "MAX": 1, 19 | "MIN": 0, 20 | "NAME": "progress", 21 | "TYPE": "float" 22 | }, 23 | { 24 | "DEFAULT": 90, 25 | "MAX": 360, 26 | "MIN": 0, 27 | "NAME": "startingAngle", 28 | "TYPE": "float" 29 | } 30 | ], 31 | "ISFVSN": "2" 32 | } 33 | */ 34 | 35 | 36 | 37 | vec4 getFromColor(vec2 inUV) { 38 | return IMG_NORM_PIXEL(startImage, inUV); 39 | } 40 | vec4 getToColor(vec2 inUV) { 41 | return IMG_NORM_PIXEL(endImage, inUV); 42 | } 43 | 44 | 45 | 46 | // Author: Fernando Kuteken 47 | // License: MIT 48 | 49 | #define PI 3.141592653589 50 | 51 | 52 | vec4 transition (vec2 uv) { 53 | 54 | float offset = startingAngle * PI / 180.0; 55 | float angle = atan(uv.y - 0.5, uv.x - 0.5) + offset; 56 | float normalizedAngle = (angle + PI) / (2.0 * PI); 57 | 58 | normalizedAngle = normalizedAngle - floor(normalizedAngle); 59 | 60 | return mix( 61 | getFromColor(uv), 62 | getToColor(uv), 63 | step(normalizedAngle, progress) 64 | ); 65 | } 66 | 67 | 68 | 69 | void main() { 70 | gl_FragColor = transition(isf_FragNormCoord.xy); 71 | } -------------------------------------------------------------------------------- /test_files/Circle Open.fs: -------------------------------------------------------------------------------- 1 | /*{ 2 | "CATEGORIES": [ 3 | "Wipe" 4 | ], 5 | "CREDIT": "Automatically converted from https://www.github.com/gl-transitions/gl-transitions/tree/master/circleopen.glsl", 6 | "DESCRIPTION": "", 7 | "INPUTS": [ 8 | { 9 | "NAME": "startImage", 10 | "TYPE": "image" 11 | }, 12 | { 13 | "NAME": "endImage", 14 | "TYPE": "image" 15 | }, 16 | { 17 | "DEFAULT": 0, 18 | "MAX": 1, 19 | "MIN": 0, 20 | "NAME": "progress", 21 | "TYPE": "float" 22 | }, 23 | { 24 | "DEFAULT": 0.3, 25 | "MAX": 1, 26 | "MIN": 0, 27 | "NAME": "smoothness", 28 | "TYPE": "float" 29 | }, 30 | { 31 | "DEFAULT": true, 32 | "NAME": "opening", 33 | "TYPE": "bool" 34 | } 35 | ], 36 | "ISFVSN": "2" 37 | } 38 | */ 39 | 40 | 41 | 42 | vec4 getFromColor(vec2 inUV) { 43 | return IMG_NORM_PIXEL(startImage, inUV); 44 | } 45 | vec4 getToColor(vec2 inUV) { 46 | return IMG_NORM_PIXEL(endImage, inUV); 47 | } 48 | 49 | 50 | 51 | // author: gre 52 | // License: MIT 53 | 54 | const vec2 center = vec2(0.5, 0.5); 55 | const float SQRT_2 = 1.414213562373; 56 | 57 | vec4 transition (vec2 uv) { 58 | float x = opening ? progress : 1.-progress; 59 | float m = smoothstep(-smoothness, 0.0, SQRT_2*distance(center, uv) - x*(1.+smoothness)); 60 | return mix(getFromColor(uv), getToColor(uv), opening ? 1.-m : m); 61 | } 62 | 63 | 64 | 65 | void main() { 66 | gl_FragColor = transition(isf_FragNormCoord.xy); 67 | } -------------------------------------------------------------------------------- /test_files/Fade Color.fs: -------------------------------------------------------------------------------- 1 | /*{ 2 | "CATEGORIES": [ 3 | "Dissolve" 4 | ], 5 | "CREDIT": "Automatically converted from https://www.github.com/gl-transitions/gl-transitions/tree/master/fadecolor.glsl", 6 | "DESCRIPTION": "", 7 | "INPUTS": [ 8 | { 9 | "NAME": "startImage", 10 | "TYPE": "image" 11 | }, 12 | { 13 | "NAME": "endImage", 14 | "TYPE": "image" 15 | }, 16 | { 17 | "DEFAULT": 0, 18 | "MAX": 1, 19 | "MIN": 0, 20 | "NAME": "progress", 21 | "TYPE": "float" 22 | }, 23 | { 24 | "DEFAULT": 0.25, 25 | "MAX": 1, 26 | "MIN": 0, 27 | "NAME": "colorPhase", 28 | "TYPE": "float" 29 | }, 30 | { 31 | "DEFAULT": [ 32 | 0, 33 | 0, 34 | 0, 35 | 1 36 | ], 37 | "NAME": "color", 38 | "TYPE": "color" 39 | } 40 | ], 41 | "ISFVSN": "2" 42 | } 43 | */ 44 | 45 | 46 | 47 | vec4 getFromColor(vec2 inUV) { 48 | return IMG_NORM_PIXEL(startImage, inUV); 49 | } 50 | vec4 getToColor(vec2 inUV) { 51 | return IMG_NORM_PIXEL(endImage, inUV); 52 | } 53 | 54 | 55 | 56 | // author: gre 57 | // License: MIT 58 | vec4 transition (vec2 uv) { 59 | return mix( 60 | mix(color, getFromColor(uv), smoothstep(1.0-colorPhase, 0.0, progress)), 61 | mix(color, getToColor(uv), smoothstep( colorPhase, 1.0, progress)), 62 | progress); 63 | } 64 | 65 | 66 | 67 | void main() { 68 | gl_FragColor = transition(isf_FragNormCoord.xy); 69 | } -------------------------------------------------------------------------------- /test_files/Glitch Memories.fs: -------------------------------------------------------------------------------- 1 | /*{ 2 | "CATEGORIES": [ 3 | "Distortion", 4 | "Glitch" 5 | ], 6 | "CREDIT": "Automatically converted from https://www.github.com/gl-transitions/gl-transitions/tree/master/GlitchMemories.glsl", 7 | "DESCRIPTION": "", 8 | "INPUTS": [ 9 | { 10 | "NAME": "startImage", 11 | "TYPE": "image" 12 | }, 13 | { 14 | "NAME": "endImage", 15 | "TYPE": "image" 16 | }, 17 | { 18 | "DEFAULT": 0, 19 | "MAX": 1, 20 | "MIN": 0, 21 | "NAME": "progress", 22 | "TYPE": "float" 23 | } 24 | ], 25 | "ISFVSN": "2" 26 | } 27 | */ 28 | 29 | 30 | 31 | vec4 getFromColor(vec2 inUV) { 32 | return IMG_NORM_PIXEL(startImage, inUV); 33 | } 34 | vec4 getToColor(vec2 inUV) { 35 | return IMG_NORM_PIXEL(endImage, inUV); 36 | } 37 | 38 | 39 | 40 | // author: Gunnar Roth 41 | // based on work from natewave 42 | // license: MIT 43 | vec4 transition(vec2 p) { 44 | vec2 block = floor(p.xy / vec2(16)); 45 | vec2 uv_noise = block / vec2(64); 46 | uv_noise += floor(vec2(progress) * vec2(1200.0, 3500.0)) / vec2(64); 47 | vec2 dist = progress > 0.0 ? (fract(uv_noise) - 0.5) * 0.3 *(1.0 -progress) : vec2(0.0); 48 | vec2 red = p + dist * 0.2; 49 | vec2 green = p + dist * .3; 50 | vec2 blue = p + dist * .5; 51 | 52 | return vec4(mix(getFromColor(red), getToColor(red), progress).r,mix(getFromColor(green), getToColor(green), progress).g,mix(getFromColor(blue), getToColor(blue), progress).b,1.0); 53 | } 54 | 55 | 56 | 57 | 58 | void main() { 59 | gl_FragColor = transition(isf_FragNormCoord.xy); 60 | } -------------------------------------------------------------------------------- /test_files/Unsharp Mask.fs: -------------------------------------------------------------------------------- 1 | /*{ 2 | "CREDIT": "by VIDVOX", 3 | "ISFVSN": "2", 4 | "CATEGORIES": [ 5 | "Sharpen" 6 | ], 7 | "INPUTS": [ 8 | { 9 | "NAME": "inputImage", 10 | "TYPE": "image" 11 | }, 12 | { 13 | "NAME": "intensity", 14 | "TYPE": "float", 15 | "MIN": 0.0, 16 | "MAX": 10.0, 17 | "DEFAULT": 1.0 18 | } 19 | ] 20 | }*/ 21 | 22 | #if __VERSION__ <= 120 23 | varying vec2 left_coord; 24 | varying vec2 right_coord; 25 | varying vec2 above_coord; 26 | varying vec2 below_coord; 27 | 28 | varying vec2 lefta_coord; 29 | varying vec2 righta_coord; 30 | varying vec2 leftb_coord; 31 | varying vec2 rightb_coord; 32 | #else 33 | in vec2 left_coord; 34 | in vec2 right_coord; 35 | in vec2 above_coord; 36 | in vec2 below_coord; 37 | 38 | in vec2 lefta_coord; 39 | in vec2 righta_coord; 40 | in vec2 leftb_coord; 41 | in vec2 rightb_coord; 42 | #endif 43 | 44 | float gray(vec4 n) 45 | { 46 | return (n.r + n.g + n.b)/3.0; 47 | } 48 | 49 | void main() 50 | { 51 | 52 | vec4 color = IMG_THIS_PIXEL(inputImage); 53 | vec4 colorL = IMG_NORM_PIXEL(inputImage, left_coord); 54 | vec4 colorR = IMG_NORM_PIXEL(inputImage, right_coord); 55 | vec4 colorA = IMG_NORM_PIXEL(inputImage, above_coord); 56 | vec4 colorB = IMG_NORM_PIXEL(inputImage, below_coord); 57 | 58 | vec4 colorLA = IMG_NORM_PIXEL(inputImage, lefta_coord); 59 | vec4 colorRA = IMG_NORM_PIXEL(inputImage, righta_coord); 60 | vec4 colorLB = IMG_NORM_PIXEL(inputImage, leftb_coord); 61 | vec4 colorRB = IMG_NORM_PIXEL(inputImage, rightb_coord); 62 | 63 | vec4 final = color + intensity * (8.0*color - colorL - colorR - colorA - colorB - colorLA - colorRA - colorLB - colorRB); 64 | 65 | gl_FragColor = final; 66 | } -------------------------------------------------------------------------------- /test_files/Directional.fs: -------------------------------------------------------------------------------- 1 | /*{ 2 | "CATEGORIES": [ 3 | "Wipe" 4 | ], 5 | "CREDIT": "Automatically converted from https://www.github.com/gl-transitions/gl-transitions/tree/master/Directional.glsl", 6 | "DESCRIPTION": "", 7 | "INPUTS": [ 8 | { 9 | "NAME": "startImage", 10 | "TYPE": "image" 11 | }, 12 | { 13 | "NAME": "endImage", 14 | "TYPE": "image" 15 | }, 16 | { 17 | "DEFAULT": 0, 18 | "MAX": 1, 19 | "MIN": 0, 20 | "NAME": "progress", 21 | "TYPE": "float" 22 | }, 23 | { 24 | "DEFAULT": [ 25 | 0, 26 | 1 27 | ], 28 | "MAX": [ 29 | 1, 30 | 1 31 | ], 32 | "MIN": [ 33 | -1, 34 | -1 35 | ], 36 | "NAME": "direction", 37 | "TYPE": "point2D" 38 | } 39 | ], 40 | "ISFVSN": "2" 41 | } 42 | */ 43 | 44 | 45 | 46 | vec4 getFromColor(vec2 inUV) { 47 | return IMG_NORM_PIXEL(startImage, inUV); 48 | } 49 | vec4 getToColor(vec2 inUV) { 50 | return IMG_NORM_PIXEL(endImage, inUV); 51 | } 52 | 53 | 54 | 55 | // Author: Gaëtan Renaudeau 56 | // License: MIT 57 | 58 | 59 | vec4 transition (vec2 uv) { 60 | vec2 p = uv + progress * sign(direction); 61 | vec2 f = fract(p); 62 | return mix( 63 | getToColor(f), 64 | getFromColor(f), 65 | step(0.0, p.y) * step(p.y, 1.0) * step(0.0, p.x) * step(p.x, 1.0) 66 | ); 67 | } 68 | 69 | 70 | 71 | void main() { 72 | gl_FragColor = transition(isf_FragNormCoord.xy); 73 | } -------------------------------------------------------------------------------- /test_files/Polar Function.fs: -------------------------------------------------------------------------------- 1 | /*{ 2 | "CATEGORIES": [ 3 | "Wipe" 4 | ], 5 | "CREDIT": "Automatically converted from https://www.github.com/gl-transitions/gl-transitions/tree/master/polar_function.glsl", 6 | "DESCRIPTION": "", 7 | "INPUTS": [ 8 | { 9 | "NAME": "startImage", 10 | "TYPE": "image" 11 | }, 12 | { 13 | "NAME": "endImage", 14 | "TYPE": "image" 15 | }, 16 | { 17 | "DEFAULT": 0, 18 | "MAX": 1, 19 | "MIN": 0, 20 | "NAME": "progress", 21 | "TYPE": "float" 22 | }, 23 | { 24 | "DEFAULT": 5, 25 | "MAX": 10, 26 | "MIN": 0, 27 | "NAME": "segments", 28 | "TYPE": "float" 29 | } 30 | ], 31 | "ISFVSN": "2" 32 | } 33 | */ 34 | 35 | 36 | 37 | vec4 getFromColor(vec2 inUV) { 38 | return IMG_NORM_PIXEL(startImage, inUV); 39 | } 40 | vec4 getToColor(vec2 inUV) { 41 | return IMG_NORM_PIXEL(endImage, inUV); 42 | } 43 | 44 | 45 | 46 | // Author: Fernando Kuteken 47 | // License: MIT 48 | 49 | #define PI 3.14159265359 50 | 51 | 52 | vec4 transition (vec2 uv) { 53 | 54 | float angle = atan(uv.y - 0.5, uv.x - 0.5) - 0.5 * PI; 55 | float normalized = (angle + 1.5 * PI) * (2.0 * PI); 56 | 57 | float radius = (cos(float(segments) * angle) + 4.0) / 4.0; 58 | float difference = length(uv - vec2(0.5, 0.5)); 59 | 60 | if (difference > radius * progress) 61 | return getFromColor(uv); 62 | else 63 | return getToColor(uv); 64 | } 65 | 66 | 67 | 68 | void main() { 69 | gl_FragColor = transition(isf_FragNormCoord.xy); 70 | } -------------------------------------------------------------------------------- /test_files/Trapezoid Distortion.fs: -------------------------------------------------------------------------------- 1 | /*{ 2 | "CATEGORIES": [ 3 | "Distortion Effect" 4 | ], 5 | "CREDIT": "VIDVOX", 6 | "DESCRIPTION": "Warps the video into a trapezoid shape", 7 | "INPUTS": [ 8 | { 9 | "NAME": "inputImage", 10 | "TYPE": "image" 11 | }, 12 | { 13 | "DEFAULT": 1, 14 | "LABEL": "Top Width", 15 | "MAX": 1, 16 | "MIN": 0, 17 | "NAME": "topWidth", 18 | "TYPE": "float" 19 | }, 20 | { 21 | "DEFAULT": 1, 22 | "LABEL": "Bottom Width", 23 | "MAX": 1, 24 | "MIN": 0, 25 | "NAME": "bottomWidth", 26 | "TYPE": "float" 27 | }, 28 | { 29 | "DEFAULT": 1, 30 | "LABEL": "Height", 31 | "MAX": 1, 32 | "MIN": 0, 33 | "NAME": "heightScale", 34 | "TYPE": "float" 35 | } 36 | ], 37 | "ISFVSN": "2" 38 | } 39 | */ 40 | 41 | void main() { 42 | vec4 inputPixelColor = vec4(0.0); 43 | vec2 loc = isf_FragNormCoord.xy; 44 | if (heightScale > 0.0) { 45 | float heightDivisor = 1.0 / heightScale; 46 | loc.y = loc.y * heightDivisor + (1.0 - heightDivisor) / 2.0; 47 | float currentLineWidth = mix(bottomWidth,topWidth,loc.y); 48 | if (currentLineWidth > 0.0) { 49 | float lwDivisor = 1.0 / currentLineWidth; 50 | loc.x = loc.x * lwDivisor + (1.0 - lwDivisor) / 2.0; 51 | 52 | if ((loc.x >= 0.0)&&(loc.x <= 1.0)&&(loc.y >= 0.0)&&(loc.y <= 1.0)) { 53 | inputPixelColor = IMG_NORM_PIXEL(inputImage,loc); 54 | } 55 | } 56 | } 57 | gl_FragColor = inputPixelColor; 58 | } 59 | -------------------------------------------------------------------------------- /test_files/Stripes.fs: -------------------------------------------------------------------------------- 1 | /*{ 2 | "CATEGORIES": [ 3 | "Geometry" 4 | ], 5 | "CREDIT": "VIDVOX", 6 | "INPUTS": [ 7 | { 8 | "DEFAULT": 0.25, 9 | "NAME": "width", 10 | "TYPE": "float" 11 | }, 12 | { 13 | "DEFAULT": 0, 14 | "NAME": "offset", 15 | "TYPE": "float" 16 | }, 17 | { 18 | "DEFAULT": 0, 19 | "NAME": "vertical", 20 | "TYPE": "bool" 21 | }, 22 | { 23 | "DEFAULT": [ 24 | 1, 25 | 1, 26 | 1, 27 | 1 28 | ], 29 | "NAME": "color1", 30 | "TYPE": "color" 31 | }, 32 | { 33 | "DEFAULT": [ 34 | 0, 35 | 0, 36 | 0, 37 | 1 38 | ], 39 | "NAME": "color2", 40 | "TYPE": "color" 41 | }, 42 | { 43 | "DEFAULT": 0.5, 44 | "MAX": 1, 45 | "MIN": 0, 46 | "NAME": "splitPos", 47 | "TYPE": "float" 48 | } 49 | ], 50 | "ISFVSN": "2" 51 | } 52 | */ 53 | 54 | 55 | 56 | void main() { 57 | // determine if we are on an even or odd line 58 | // math goes like.. 59 | // mod(((coord+offset) / width),2) 60 | 61 | 62 | vec4 out_color = color2; 63 | float coord = isf_FragNormCoord[0]; 64 | 65 | if (vertical) { 66 | coord = isf_FragNormCoord[1]; 67 | } 68 | if (width == 0.0) { 69 | out_color = color1; 70 | } 71 | else if(mod(((coord+offset) / width),2.0) < 2.0 * splitPos) { 72 | out_color = color1; 73 | } 74 | 75 | gl_FragColor = out_color; 76 | } -------------------------------------------------------------------------------- /test_files/Emboss.fs: -------------------------------------------------------------------------------- 1 | /*{ 2 | "CREDIT": "by VIDVOX", 3 | "ISFVSN": "2", 4 | "CATEGORIES": [ 5 | "Stylize" 6 | ], 7 | "INPUTS": [ 8 | { 9 | "NAME": "inputImage", 10 | "TYPE": "image" 11 | }, 12 | { 13 | "NAME": "intensity", 14 | "TYPE": "float", 15 | "MIN": 0.0, 16 | "MAX": 10.0, 17 | "DEFAULT": 2.0 18 | }, 19 | { 20 | "NAME": "colorize", 21 | "TYPE": "float", 22 | "MIN": 0.0, 23 | "MAX": 1.0, 24 | "DEFAULT": 1.0 25 | }, 26 | { 27 | "NAME": "brightness", 28 | "TYPE": "float", 29 | "MIN": 0.25, 30 | "MAX": 0.75, 31 | "DEFAULT": 0.5 32 | } 33 | ] 34 | }*/ 35 | 36 | #if __VERSION__ <= 120 37 | varying vec2 left_coord; 38 | varying vec2 right_coord; 39 | varying vec2 above_coord; 40 | varying vec2 below_coord; 41 | 42 | varying vec2 lefta_coord; 43 | varying vec2 rightb_coord; 44 | #else 45 | in vec2 left_coord; 46 | in vec2 right_coord; 47 | in vec2 above_coord; 48 | in vec2 below_coord; 49 | 50 | in vec2 lefta_coord; 51 | in vec2 rightb_coord; 52 | #endif 53 | 54 | float gray(vec4 n) 55 | { 56 | return (n.r + n.g + n.b)/3.0; 57 | } 58 | 59 | void main() 60 | { 61 | 62 | vec4 colorL = IMG_NORM_PIXEL(inputImage, left_coord); 63 | vec4 colorR = IMG_NORM_PIXEL(inputImage, right_coord); 64 | vec4 colorA = IMG_NORM_PIXEL(inputImage, above_coord); 65 | vec4 colorB = IMG_NORM_PIXEL(inputImage, below_coord); 66 | 67 | vec4 colorLA = IMG_NORM_PIXEL(inputImage, lefta_coord); 68 | vec4 colorRB = IMG_NORM_PIXEL(inputImage, rightb_coord); 69 | 70 | vec4 final = intensity * (colorR + colorB + colorRB - colorL - colorA - colorLA) + brightness; 71 | float grayscale = gray(final); 72 | final = mix(vec4(grayscale,grayscale,grayscale,final.a),final,colorize); 73 | gl_FragColor = final; 74 | } -------------------------------------------------------------------------------- /test_files/Luminance Posterize.fs: -------------------------------------------------------------------------------- 1 | /*{ 2 | "CATEGORIES": [ 3 | "Color Effect", 4 | "Retro" 5 | ], 6 | "CREDIT": "by zoidberg", 7 | "INPUTS": [ 8 | { 9 | "NAME": "inputImage", 10 | "TYPE": "image" 11 | }, 12 | { 13 | "DEFAULT": 30, 14 | "MAX": 30, 15 | "MIN": 2, 16 | "NAME": "levels", 17 | "TYPE": "float" 18 | } 19 | ], 20 | "ISFVSN": "2" 21 | } 22 | */ 23 | 24 | vec3 rgb2hsv(vec3 c); 25 | vec3 hsv2rgb(vec3 c); 26 | 27 | void main() { 28 | // get the src pixel, convert to HSL, posterize the 'L', convert back to RGB 29 | 30 | vec4 srcPixel = IMG_THIS_PIXEL(inputImage); 31 | vec4 tmpColor; 32 | tmpColor.xyz = rgb2hsv(srcPixel.rgb); 33 | float amountPerLevel = 1.0/(levels); 34 | float numOfLevels = floor(tmpColor.z/amountPerLevel); 35 | tmpColor.z = numOfLevels*(1.0/(levels-1.0)); 36 | gl_FragColor.rgb = hsv2rgb(tmpColor.xyz); 37 | gl_FragColor.a = srcPixel.a; 38 | 39 | } 40 | 41 | 42 | vec3 rgb2hsv(vec3 c) { 43 | vec4 K = vec4(0.0, -1.0 / 3.0, 2.0 / 3.0, -1.0); 44 | //vec4 p = mix(vec4(c.bg, K.wz), vec4(c.gb, K.xy), step(c.b, c.g)); 45 | //vec4 q = mix(vec4(p.xyw, c.r), vec4(c.r, p.yzx), step(p.x, c.r)); 46 | vec4 p = c.g < c.b ? vec4(c.bg, K.wz) : vec4(c.gb, K.xy); 47 | vec4 q = c.r < p.x ? vec4(p.xyw, c.r) : vec4(c.r, p.yzx); 48 | 49 | float d = q.x - min(q.w, q.y); 50 | float e = 1.0e-10; 51 | return vec3(abs(q.z + (q.w - q.y) / (6.0 * d + e)), d / (q.x + e), q.x); 52 | } 53 | 54 | vec3 hsv2rgb(vec3 c) { 55 | vec4 K = vec4(1.0, 2.0 / 3.0, 1.0 / 3.0, 3.0); 56 | vec3 p = abs(fract(c.xxx + K.xyz) * 6.0 - K.www); 57 | return c.z * mix(K.xxx, clamp(p - K.xxx, 0.0, 1.0), c.y); 58 | } -------------------------------------------------------------------------------- /test_files/Ripple Transition.fs: -------------------------------------------------------------------------------- 1 | /*{ 2 | "CATEGORIES": [ 3 | "Distortion", 4 | "Dissolve" 5 | ], 6 | "CREDIT": "Automatically converted from https://www.github.com/gl-transitions/gl-transitions/tree/master/ripple.glsl", 7 | "DESCRIPTION": "", 8 | "INPUTS": [ 9 | { 10 | "NAME": "startImage", 11 | "TYPE": "image" 12 | }, 13 | { 14 | "NAME": "endImage", 15 | "TYPE": "image" 16 | }, 17 | { 18 | "DEFAULT": 0, 19 | "MAX": 1, 20 | "MIN": 0, 21 | "NAME": "progress", 22 | "TYPE": "float" 23 | }, 24 | { 25 | "DEFAULT": 100, 26 | "MAX": 100, 27 | "MIN": 0, 28 | "NAME": "amplitude", 29 | "TYPE": "float" 30 | }, 31 | { 32 | "DEFAULT": 50, 33 | "MAX": 100, 34 | "MIN": 0, 35 | "NAME": "speed", 36 | "TYPE": "float" 37 | } 38 | ], 39 | "ISFVSN": "2" 40 | } 41 | */ 42 | 43 | 44 | 45 | vec4 getFromColor(vec2 inUV) { 46 | return IMG_NORM_PIXEL(startImage, inUV); 47 | } 48 | vec4 getToColor(vec2 inUV) { 49 | return IMG_NORM_PIXEL(endImage, inUV); 50 | } 51 | 52 | 53 | 54 | // Author: gre 55 | // License: MIT 56 | 57 | vec4 transition (vec2 uv) { 58 | vec2 dir = uv - vec2(.5); 59 | float dist = length(dir); 60 | vec2 offset = dir * (sin(progress * dist * amplitude - progress * speed) + .5) / 30.; 61 | return mix( 62 | getFromColor(uv + offset), 63 | getToColor(uv), 64 | smoothstep(0.2, 1.0, progress) 65 | ); 66 | } 67 | 68 | 69 | 70 | void main() { 71 | gl_FragColor = transition(isf_FragNormCoord.xy); 72 | } -------------------------------------------------------------------------------- /test_files/Night Vision.fs: -------------------------------------------------------------------------------- 1 | /*{ 2 | "CREDIT": "by VIDVOX", 3 | "ISFVSN": "2", 4 | "CATEGORIES": [ 5 | "Stylize" 6 | ], 7 | "INPUTS": [ 8 | { 9 | "NAME": "inputImage", 10 | "TYPE": "image" 11 | }, 12 | { 13 | "NAME": "luminanceThreshold", 14 | "TYPE": "float", 15 | "MIN": 0.0, 16 | "MAX": 1.0, 17 | "DEFAULT": 0.2 18 | }, 19 | { 20 | "NAME": "colorAmplification", 21 | "TYPE": "float", 22 | "MIN": 0.0, 23 | "MAX": 10.0, 24 | "DEFAULT": 4.0 25 | }, 26 | { 27 | "NAME": "noiseLevel", 28 | "TYPE": "float", 29 | "MIN": 0.0, 30 | "MAX": 1.0, 31 | "DEFAULT": 0.1 32 | }, 33 | { 34 | "NAME": "visionColor", 35 | "TYPE": "color", 36 | "DEFAULT": [ 37 | 0.1, 38 | 0.95, 39 | 0.2, 40 | 1.0 41 | ] 42 | } 43 | ], 44 | "IMPORTED": { 45 | "noiseTex": { 46 | "PATH": "noise2d.png" 47 | } 48 | } 49 | }*/ 50 | 51 | 52 | 53 | void main () { 54 | vec2 normSrcCoord; 55 | 56 | normSrcCoord.x = isf_FragNormCoord[0]; 57 | normSrcCoord.y = isf_FragNormCoord[1]; 58 | 59 | vec4 finalColor; 60 | 61 | // Set effectCoverage to 1.0 for normal use. 62 | 63 | vec2 uv; 64 | uv.x = 0.4*sin(TIME*50.0); 65 | uv.y = 0.4*cos(TIME*50.0); 66 | vec3 n = IMG_NORM_PIXEL(noiseTex,mod(normSrcCoord.xy*3.5 + uv,1.0)).rgb; 67 | vec3 c = IMG_THIS_PIXEL(inputImage).rgb + n.rgb * noiseLevel; 68 | 69 | const vec4 lumacoeff = vec4(0.2126, 0.7152, 0.0722, 0.0); 70 | float lum = dot(vec4(c,1.), lumacoeff); 71 | if (lum < luminanceThreshold) { 72 | c *= colorAmplification; 73 | } 74 | finalColor.rgb = (c + (n*0.2)) * visionColor.rgb; 75 | 76 | gl_FragColor.rgb = finalColor.rgb; 77 | gl_FragColor.a = 1.0; 78 | } -------------------------------------------------------------------------------- /test_files/Sharpen Luminance.fs: -------------------------------------------------------------------------------- 1 | /*{ 2 | "CREDIT": "by VIDVOX", 3 | "ISFVSN": "2", 4 | "CATEGORIES": [ 5 | "Sharpen" 6 | ], 7 | "INPUTS": [ 8 | { 9 | "NAME": "inputImage", 10 | "TYPE": "image" 11 | }, 12 | { 13 | "NAME": "intensity", 14 | "TYPE": "float", 15 | "MIN": 0.0, 16 | "MAX": 2.0, 17 | "DEFAULT": 1.0 18 | } 19 | ] 20 | }*/ 21 | 22 | #if __VERSION__ <= 120 23 | varying vec2 left_coord; 24 | varying vec2 right_coord; 25 | varying vec2 above_coord; 26 | varying vec2 below_coord; 27 | 28 | varying vec2 lefta_coord; 29 | varying vec2 righta_coord; 30 | varying vec2 leftb_coord; 31 | varying vec2 rightb_coord; 32 | #else 33 | in vec2 left_coord; 34 | in vec2 right_coord; 35 | in vec2 above_coord; 36 | in vec2 below_coord; 37 | 38 | in vec2 lefta_coord; 39 | in vec2 righta_coord; 40 | in vec2 leftb_coord; 41 | in vec2 rightb_coord; 42 | #endif 43 | 44 | float gray(vec4 n) 45 | { 46 | return (n.r + n.g + n.b)/3.0; 47 | } 48 | 49 | void main() 50 | { 51 | 52 | vec4 color = IMG_THIS_PIXEL(inputImage); 53 | float colorL = gray(IMG_NORM_PIXEL(inputImage, left_coord)); 54 | float colorR = gray(IMG_NORM_PIXEL(inputImage, right_coord)); 55 | float colorA = gray(IMG_NORM_PIXEL(inputImage, above_coord)); 56 | float colorB = gray(IMG_NORM_PIXEL(inputImage, below_coord)); 57 | 58 | float colorLA = gray(IMG_NORM_PIXEL(inputImage, lefta_coord)); 59 | float colorRA = gray(IMG_NORM_PIXEL(inputImage, righta_coord)); 60 | float colorLB = gray(IMG_NORM_PIXEL(inputImage, leftb_coord)); 61 | float colorRB = gray(IMG_NORM_PIXEL(inputImage, rightb_coord)); 62 | 63 | vec4 final = color + color * intensity * (8.0*gray(color) - colorL - colorR - colorA - colorB - colorLA - colorRA - colorLB - colorRB); 64 | 65 | gl_FragColor = final; 66 | } -------------------------------------------------------------------------------- /test_files/Diagonal Blur.fs: -------------------------------------------------------------------------------- 1 | /*{ 2 | "CREDIT": "by VIDVOX", 3 | "ISFVSN": "2", 4 | "CATEGORIES": [ 5 | "Blur" 6 | ], 7 | "INPUTS": [ 8 | { 9 | "NAME": "inputImage", 10 | "TYPE": "image" 11 | }, 12 | { 13 | "NAME": "width", 14 | "LABEL": "Width", 15 | "TYPE": "float", 16 | "MIN": 0.0, 17 | "MAX": 1.0, 18 | "DEFAULT": 0.0 19 | }, 20 | { 21 | "NAME": "angle", 22 | "LABEL": "Angle", 23 | "TYPE": "float", 24 | "MIN": -1.0, 25 | "MAX": 1.0, 26 | "DEFAULT": 0.125 27 | }, 28 | { 29 | "NAME": "quality", 30 | "LABEL": "Quality", 31 | "VALUES": [ 32 | 12, 33 | 8, 34 | 4, 35 | 2 36 | ], 37 | "LABELS": [ 38 | "Low", 39 | "Mid", 40 | "High", 41 | "Best" 42 | ], 43 | "DEFAULT": 4, 44 | "TYPE": "long" 45 | } 46 | ] 47 | }*/ 48 | 49 | 50 | const float pi = 3.14159265359; 51 | 52 | 53 | void main() { 54 | vec2 loc = isf_FragNormCoord * RENDERSIZE; 55 | 56 | vec2 p1 = vec2(0.0); 57 | vec2 p2 = vec2(1.0); 58 | vec2 vector = vec2(cos(pi * angle),sin(pi * angle)); 59 | 60 | vec4 returnMe; 61 | 62 | if (width > 0.0) { 63 | p1 = loc - width * RENDERSIZE * vector; 64 | p2 = loc + width * RENDERSIZE * vector; 65 | 66 | // now we have the two points to smear between, 67 | //float i; 68 | float count = clamp(width * max(RENDERSIZE.x,RENDERSIZE.y) / float(quality), 5.0, 125.0); 69 | //float count = 10.0; 70 | vec2 diff = p2 - p1; 71 | for (float i = 0.0; i < 125.0; ++i) { 72 | if (i > float(count)) 73 | break; 74 | float tmp = (i / (count - 1.0)); 75 | returnMe = returnMe + IMG_PIXEL(inputImage, p1 + diff * tmp) / count; 76 | } 77 | } 78 | else { 79 | returnMe = IMG_THIS_PIXEL(inputImage); 80 | } 81 | gl_FragColor = returnMe; 82 | } -------------------------------------------------------------------------------- /test_files/Water Drop.fs: -------------------------------------------------------------------------------- 1 | /*{ 2 | "CATEGORIES": [ 3 | "Distortion" 4 | ], 5 | "CREDIT": "Automatically converted from https://www.github.com/gl-transitions/gl-transitions/tree/master/WaterDrop.glsl", 6 | "DESCRIPTION": "", 7 | "INPUTS": [ 8 | { 9 | "NAME": "startImage", 10 | "TYPE": "image" 11 | }, 12 | { 13 | "NAME": "endImage", 14 | "TYPE": "image" 15 | }, 16 | { 17 | "DEFAULT": 0, 18 | "MAX": 1, 19 | "MIN": 0, 20 | "NAME": "progress", 21 | "TYPE": "float" 22 | }, 23 | { 24 | "DEFAULT": 30, 25 | "MAX": 100, 26 | "MIN": 0, 27 | "NAME": "speed", 28 | "TYPE": "float" 29 | }, 30 | { 31 | "DEFAULT": 30, 32 | "MAX": 100, 33 | "MIN": 0, 34 | "NAME": "amplitude", 35 | "TYPE": "float" 36 | } 37 | ], 38 | "ISFVSN": "2" 39 | } 40 | */ 41 | 42 | 43 | 44 | vec4 getFromColor(vec2 inUV) { 45 | return IMG_NORM_PIXEL(startImage, inUV); 46 | } 47 | vec4 getToColor(vec2 inUV) { 48 | return IMG_NORM_PIXEL(endImage, inUV); 49 | } 50 | 51 | 52 | 53 | // author: Paweł Płóciennik 54 | // license: MIT 55 | 56 | vec4 transition(vec2 p) { 57 | vec2 dir = p - vec2(.5); 58 | float dist = length(dir); 59 | 60 | if (dist > progress) { 61 | return mix(getFromColor( p), getToColor( p), progress); 62 | } else { 63 | vec2 offset = dir * sin(dist * amplitude - progress * speed); 64 | return mix(getFromColor( p + offset), getToColor( p), progress); 65 | } 66 | } 67 | 68 | 69 | 70 | void main() { 71 | gl_FragColor = transition(isf_FragNormCoord.xy); 72 | } -------------------------------------------------------------------------------- /test_files/Circle Crop.fs: -------------------------------------------------------------------------------- 1 | /*{ 2 | "CATEGORIES": [ 3 | "Wipe" 4 | ], 5 | "CREDIT": "Automatically converted from https://www.github.com/gl-transitions/gl-transitions/tree/master/CircleCrop.glsl", 6 | "DESCRIPTION": "", 7 | "INPUTS": [ 8 | { 9 | "NAME": "startImage", 10 | "TYPE": "image" 11 | }, 12 | { 13 | "NAME": "endImage", 14 | "TYPE": "image" 15 | }, 16 | { 17 | "DEFAULT": 0, 18 | "MAX": 1, 19 | "MIN": 0, 20 | "NAME": "progress", 21 | "TYPE": "float" 22 | }, 23 | { 24 | "DEFAULT": [ 25 | 0, 26 | 0, 27 | 0, 28 | 1 29 | ], 30 | "NAME": "bgcolor", 31 | "TYPE": "color" 32 | } 33 | ], 34 | "ISFVSN": "2" 35 | } 36 | */ 37 | 38 | 39 | 40 | vec4 getFromColor(vec2 inUV) { 41 | return IMG_NORM_PIXEL(startImage, inUV); 42 | } 43 | vec4 getToColor(vec2 inUV) { 44 | return IMG_NORM_PIXEL(endImage, inUV); 45 | } 46 | 47 | 48 | 49 | // License: MIT 50 | // Author: fkuteken 51 | // ported by gre from https://gist.github.com/fkuteken/f63e3009c1143950dee9063c3b83fb88 52 | 53 | float ratio = RENDERSIZE.x/RENDERSIZE.y; 54 | vec2 ratio2 = vec2(1.0, 1.0 / ratio); 55 | float s = pow(2.0 * abs(progress - 0.5), 3.0); 56 | 57 | vec4 transition(vec2 p) { 58 | float dist = length((vec2(p) - 0.5) * ratio2); 59 | return mix( 60 | progress < 0.5 ? getFromColor(p) : getToColor(p), // branching is ok here as we statically depend on progress uniform (branching won't change over pixels) 61 | bgcolor, 62 | step(s, dist) 63 | ); 64 | } 65 | 66 | 67 | 68 | void main() { 69 | gl_FragColor = transition(isf_FragNormCoord.xy); 70 | } -------------------------------------------------------------------------------- /test_files/Swirl.fs: -------------------------------------------------------------------------------- 1 | /*{ 2 | "CATEGORIES": [ 3 | "Distortion" 4 | ], 5 | "CREDIT": "Automatically converted from https://www.github.com/gl-transitions/gl-transitions/tree/master/Swirl.glsl", 6 | "DESCRIPTION": "", 7 | "INPUTS": [ 8 | { 9 | "NAME": "startImage", 10 | "TYPE": "image" 11 | }, 12 | { 13 | "NAME": "endImage", 14 | "TYPE": "image" 15 | }, 16 | { 17 | "DEFAULT": 0, 18 | "MAX": 1, 19 | "MIN": 0, 20 | "NAME": "progress", 21 | "TYPE": "float" 22 | } 23 | ], 24 | "ISFVSN": "2" 25 | } 26 | */ 27 | 28 | 29 | 30 | vec4 getFromColor(vec2 inUV) { 31 | return IMG_NORM_PIXEL(startImage, inUV); 32 | } 33 | vec4 getToColor(vec2 inUV) { 34 | return IMG_NORM_PIXEL(endImage, inUV); 35 | } 36 | 37 | 38 | 39 | // License: MIT 40 | // Author: Sergey Kosarevsky 41 | // ( http://www.linderdaum.com ) 42 | // ported by gre from https://gist.github.com/corporateshark/cacfedb8cca0f5ce3f7c 43 | 44 | vec4 transition(vec2 UV) 45 | { 46 | float Radius = 1.0; 47 | 48 | float T = progress; 49 | 50 | UV -= vec2( 0.5, 0.5 ); 51 | 52 | float Dist = length(UV); 53 | 54 | if ( Dist < Radius ) 55 | { 56 | float Percent = (Radius - Dist) / Radius; 57 | float A = ( T <= 0.5 ) ? mix( 0.0, 1.0, T/0.5 ) : mix( 1.0, 0.0, (T-0.5)/0.5 ); 58 | float Theta = Percent * Percent * A * 8.0 * 3.14159; 59 | float S = sin( Theta ); 60 | float C = cos( Theta ); 61 | UV = vec2( dot(UV, vec2(C, -S)), dot(UV, vec2(S, C)) ); 62 | } 63 | UV += vec2( 0.5, 0.5 ); 64 | 65 | vec4 C0 = getFromColor(UV); 66 | vec4 C1 = getToColor(UV); 67 | 68 | return mix( C0, C1, T ); 69 | } 70 | 71 | 72 | 73 | void main() { 74 | gl_FragColor = transition(isf_FragNormCoord.xy); 75 | } -------------------------------------------------------------------------------- /test_files/Displacement.fs: -------------------------------------------------------------------------------- 1 | /*{ 2 | "CATEGORIES": [ 3 | "Distortion" 4 | ], 5 | "CREDIT": "Automatically converted from https://www.github.com/gl-transitions/gl-transitions/tree/master/displacement.glsl", 6 | "DESCRIPTION": "", 7 | "INPUTS": [ 8 | { 9 | "NAME": "startImage", 10 | "TYPE": "image" 11 | }, 12 | { 13 | "NAME": "endImage", 14 | "TYPE": "image" 15 | }, 16 | { 17 | "DEFAULT": 0, 18 | "MAX": 1, 19 | "MIN": 0, 20 | "NAME": "progress", 21 | "TYPE": "float" 22 | }, 23 | { 24 | "NAME": "displacementMap", 25 | "TYPE": "image" 26 | }, 27 | { 28 | "DEFAULT": 0.5, 29 | "MAX": 1, 30 | "MIN": 0, 31 | "NAME": "strength", 32 | "TYPE": "float" 33 | } 34 | ], 35 | "ISFVSN": "2" 36 | } 37 | */ 38 | 39 | 40 | 41 | vec4 getFromColor(vec2 inUV) { 42 | return IMG_NORM_PIXEL(startImage, inUV); 43 | } 44 | vec4 getToColor(vec2 inUV) { 45 | return IMG_NORM_PIXEL(endImage, inUV); 46 | } 47 | 48 | 49 | 50 | // Author: Travis Fischer 51 | // License: MIT 52 | // 53 | // Adapted from a Codrops article by Robin Delaporte 54 | // https://tympanus.net/Development/DistortionHoverEffect 55 | 56 | 57 | 58 | vec4 transition (vec2 uv) { 59 | float displacement = IMG_NORM_PIXEL(displacementMap, uv).r * strength; 60 | 61 | vec2 uvFrom = vec2(uv.x + progress * displacement, uv.y); 62 | vec2 uvTo = vec2(uv.x - (1.0 - progress) * displacement, uv.y); 63 | 64 | return mix( 65 | getFromColor(uvFrom), 66 | getToColor(uvTo), 67 | progress 68 | ); 69 | } 70 | 71 | 72 | 73 | void main() { 74 | gl_FragColor = transition(isf_FragNormCoord.xy); 75 | } -------------------------------------------------------------------------------- /test_files/Polka Dots Curtain.fs: -------------------------------------------------------------------------------- 1 | /*{ 2 | "CATEGORIES": [ 3 | "Wipe" 4 | ], 5 | "CREDIT": "Automatically converted from https://www.github.com/gl-transitions/gl-transitions/tree/master/PolkaDotsCurtain.glsl", 6 | "DESCRIPTION": "", 7 | "INPUTS": [ 8 | { 9 | "NAME": "startImage", 10 | "TYPE": "image" 11 | }, 12 | { 13 | "NAME": "endImage", 14 | "TYPE": "image" 15 | }, 16 | { 17 | "DEFAULT": 0, 18 | "MAX": 1, 19 | "MIN": 0, 20 | "NAME": "progress", 21 | "TYPE": "float" 22 | }, 23 | { 24 | "DEFAULT": 20, 25 | "MAX": 100, 26 | "MIN": 0, 27 | "NAME": "dots", 28 | "TYPE": "float" 29 | }, 30 | { 31 | "DEFAULT": [ 32 | 0, 33 | 0 34 | ], 35 | "MAX": [ 36 | 1, 37 | 1 38 | ], 39 | "MIN": [ 40 | 0, 41 | 0 42 | ], 43 | "NAME": "center", 44 | "TYPE": "point2D" 45 | } 46 | ], 47 | "ISFVSN": "2" 48 | } 49 | */ 50 | 51 | 52 | 53 | vec4 getFromColor(vec2 inUV) { 54 | return IMG_NORM_PIXEL(startImage, inUV); 55 | } 56 | vec4 getToColor(vec2 inUV) { 57 | return IMG_NORM_PIXEL(endImage, inUV); 58 | } 59 | 60 | 61 | 62 | // author: bobylito 63 | // license: MIT 64 | const float SQRT_2 = 1.414213562373; 65 | 66 | vec4 transition(vec2 uv) { 67 | bool nextImage = distance(fract(uv * dots), vec2(0.5, 0.5)) < ( progress / distance(uv, center)); 68 | return nextImage ? getToColor(uv) : getFromColor(uv); 69 | } 70 | 71 | 72 | 73 | void main() { 74 | gl_FragColor = transition(isf_FragNormCoord.xy); 75 | } -------------------------------------------------------------------------------- /test_files/Color Phase.fs: -------------------------------------------------------------------------------- 1 | /*{ 2 | "CATEGORIES": [ 3 | "Dissolve" 4 | ], 5 | "CREDIT": "Automatically converted from https://www.github.com/gl-transitions/gl-transitions/tree/master/colorphase.glsl", 6 | "DESCRIPTION": "", 7 | "INPUTS": [ 8 | { 9 | "NAME": "startImage", 10 | "TYPE": "image" 11 | }, 12 | { 13 | "NAME": "endImage", 14 | "TYPE": "image" 15 | }, 16 | { 17 | "DEFAULT": 0, 18 | "MAX": 1, 19 | "MIN": 0, 20 | "NAME": "progress", 21 | "TYPE": "float" 22 | }, 23 | { 24 | "DEFAULT": [ 25 | 0, 26 | 0.19607843137254902, 27 | 0.39215686274509803, 28 | 0 29 | ], 30 | "NAME": "fromStep", 31 | "TYPE": "color" 32 | }, 33 | { 34 | "DEFAULT": [ 35 | 0.6, 36 | 0.8, 37 | 1, 38 | 1 39 | ], 40 | "NAME": "toStep", 41 | "TYPE": "color" 42 | } 43 | ], 44 | "ISFVSN": "2" 45 | } 46 | */ 47 | 48 | 49 | 50 | vec4 getFromColor(vec2 inUV) { 51 | return IMG_NORM_PIXEL(startImage, inUV); 52 | } 53 | vec4 getToColor(vec2 inUV) { 54 | return IMG_NORM_PIXEL(endImage, inUV); 55 | } 56 | 57 | 58 | 59 | // Author: gre 60 | // License: MIT 61 | 62 | // Usage: fromStep and toStep must be in [0.0, 1.0] range 63 | // and all(fromStep) must be < all(toStep) 64 | 65 | 66 | vec4 transition (vec2 uv) { 67 | vec4 a = getFromColor(uv); 68 | vec4 b = getToColor(uv); 69 | return mix(a, b, smoothstep(fromStep, toStep, vec4(progress))); 70 | } 71 | 72 | 73 | 74 | void main() { 75 | gl_FragColor = transition(isf_FragNormCoord.xy); 76 | } -------------------------------------------------------------------------------- /test_files/HorizVertHold.fs: -------------------------------------------------------------------------------- 1 | /*{ 2 | "DESCRIPTION": "", 3 | "CREDIT": "by zoidberg", 4 | "ISFVSN": "2", 5 | "CATEGORIES": [ 6 | "Geometry Adjustment" 7 | ], 8 | "INPUTS": [ 9 | { 10 | "NAME": "inputImage", 11 | "TYPE": "image" 12 | }, 13 | { 14 | "NAME": "hHold", 15 | "LABEL": "Horiz. Hold", 16 | "TYPE": "float", 17 | "MIN": -0.45, 18 | "MAX": 0.45, 19 | "DEFAULT": 0.0 20 | }, 21 | { 22 | "NAME": "vHold", 23 | "LABEL": "Vert. Hold", 24 | "TYPE": "float", 25 | "MIN": -0.45, 26 | "MAX": 0.45, 27 | "DEFAULT": 0.0 28 | }, 29 | { 30 | "NAME": "flashEvent", 31 | "TYPE": "event" 32 | } 33 | ], 34 | "PASSES": [ 35 | { 36 | "TARGET":"lastPosition", 37 | "WIDTH": 1, 38 | "HEIGHT": 1, 39 | "FLOAT": true, 40 | "PERSISTENT": true, 41 | "DESCRIPTION": "this buffer stores the last frame's x/y offset in the first two components of its only pixel- note that it's requesting a FLOAT target buffer..." 42 | }, 43 | { 44 | 45 | } 46 | ] 47 | 48 | }*/ 49 | 50 | void main() 51 | { 52 | // if this is the first pass, i'm going to read the position from the "lastPosition" image, and write a new position based on this and the hold variables 53 | if (PASSINDEX == 0) { 54 | vec4 srcPixel = IMG_PIXEL(lastPosition,vec2(0.5)); 55 | // i'm only using the X and Y components, which are the X and Y offset (normalized) for the frame 56 | srcPixel.xy = (flashEvent) ? vec2(0.0) : (srcPixel.xy - vec2(hHold,vHold)); 57 | gl_FragColor = mod(srcPixel,1.0); 58 | } 59 | // else this isn't the first pass- read the position value from the buffer which stores it 60 | else { 61 | vec4 lastPosVector = IMG_PIXEL(lastPosition,vec2(0.5)); 62 | vec2 normPixelCoord = mod((isf_FragNormCoord.xy + lastPosVector.xy), 1.0); 63 | gl_FragColor = IMG_NORM_PIXEL(inputImage,normPixelCoord); 64 | } 65 | } 66 | -------------------------------------------------------------------------------- /test_files/VU Meter.fs: -------------------------------------------------------------------------------- 1 | /*{ 2 | "CATEGORIES": [ 3 | "Geometry" 4 | ], 5 | "CREDIT": "VIDVOX", 6 | "DESCRIPTION": "", 7 | "INPUTS": [ 8 | { 9 | "DEFAULT": 1, 10 | "MAX": 1, 11 | "MIN": 0, 12 | "NAME": "audioLevel", 13 | "TYPE": "float" 14 | }, 15 | { 16 | "DEFAULT": [ 17 | 0, 18 | 1, 19 | 0, 20 | 1 21 | ], 22 | "NAME": "color1", 23 | "TYPE": "color" 24 | }, 25 | { 26 | "DEFAULT": [ 27 | 1, 28 | 1, 29 | 0, 30 | 1 31 | ], 32 | "NAME": "color2", 33 | "TYPE": "color" 34 | }, 35 | { 36 | "DEFAULT": [ 37 | 1, 38 | 0, 39 | 0, 40 | 1 41 | ], 42 | "NAME": "color3", 43 | "TYPE": "color" 44 | } 45 | ], 46 | "ISFVSN": "2" 47 | } 48 | */ 49 | 50 | 51 | const float divisionCount = 5.0; 52 | 53 | float round(float val) { 54 | if (fract(val) <= 0.5) 55 | return floor(val); 56 | else 57 | return ceil(val); 58 | } 59 | 60 | void main() { 61 | vec4 inputPixelColor = vec4(0.0); 62 | vec2 loc = isf_FragNormCoord; 63 | 64 | float div = floor(divisionCount * audioLevel); 65 | float thisDiv = floor(loc.x * divisionCount); 66 | float nearestDiv = round(loc.x * divisionCount); 67 | 68 | if (loc.x < div / divisionCount) { 69 | if (thisDiv <= divisionCount * 0.5) 70 | inputPixelColor = color1; 71 | else if (thisDiv <= divisionCount - 2.0) 72 | inputPixelColor = color2; 73 | else 74 | inputPixelColor = color3; 75 | } 76 | 77 | gl_FragColor = inputPixelColor; 78 | } 79 | -------------------------------------------------------------------------------- /test_files/Cubic Warp.fs: -------------------------------------------------------------------------------- 1 | /*{ 2 | "CREDIT": "by carter rosenberg", 3 | "CATEGORIES": [ 4 | "Distortion Effect" 5 | ], 6 | "INPUTS": [ 7 | { 8 | "NAME": "inputImage", 9 | "TYPE": "image" 10 | }, 11 | { 12 | "NAME": "level", 13 | "TYPE": "float", 14 | "MIN": 0, 15 | "MAX": 100, 16 | "DEFAULT": 1 17 | }, 18 | { 19 | "NAME" : "center", 20 | "TYPE" : "point2D", 21 | "MAX" : [ 22 | 1, 23 | 1 24 | ], 25 | "DEFAULT" : [ 26 | 0.5, 27 | 0.5 28 | ], 29 | "MIN" : [ 30 | 0, 31 | 0 32 | ] 33 | } 34 | ] 35 | }*/ 36 | 37 | const float pi = 3.14159265359; 38 | 39 | 40 | #ifndef GL_ES 41 | float distance (vec2 center, vec2 pt) 42 | { 43 | float tmp = pow(center.x-pt.x,2.0)+pow(center.y-pt.y,2.0); 44 | return pow(tmp,0.5); 45 | } 46 | #endif 47 | 48 | 49 | void main() { 50 | vec2 loc; 51 | vec2 modifiedCenter; 52 | 53 | loc = isf_FragNormCoord; 54 | modifiedCenter = center; 55 | 56 | // lens distortion coefficient 57 | float k = -0.15; 58 | 59 | float r2 = (loc.x-modifiedCenter.x) * (loc.x-modifiedCenter.x) + (loc.y-modifiedCenter.y) * (loc.y-modifiedCenter.y); 60 | float f = 0.0; 61 | 62 | //only compute the cubic distortion if necessary 63 | if(level == 0.0){ 64 | f = 1.0 + r2 * k; 65 | } 66 | else { 67 | f = 1.0 + r2 * (k + level * sqrt(r2)); 68 | }; 69 | 70 | float zoom = max(sqrt(level),1.0); 71 | 72 | // get the right pixel for the current position 73 | loc.x = f*(loc.x-modifiedCenter.x)/zoom+modifiedCenter.x; 74 | loc.y = f*(loc.y-modifiedCenter.y)/zoom+modifiedCenter.y; 75 | 76 | if ((loc.x < 0.0)||(loc.y < 0.0)||(loc.x > 1.0)||(loc.y > 1.0)) { 77 | gl_FragColor = vec4(0.0); 78 | } 79 | else { 80 | gl_FragColor = IMG_NORM_PIXEL(inputImage,loc); 81 | } 82 | } 83 | -------------------------------------------------------------------------------- /test_files/Interlace.fs: -------------------------------------------------------------------------------- 1 | /*{ 2 | "CATEGORIES": [ 3 | "Glitch", 4 | "Retro" 5 | ], 6 | "CREDIT": "by Carter Rosenberg", 7 | "DESCRIPTION": "", 8 | "INPUTS": [ 9 | { 10 | "NAME": "inputImage", 11 | "TYPE": "image" 12 | }, 13 | { 14 | "DEFAULT": 4, 15 | "LABEL": "Line Size", 16 | "MAX": 50, 17 | "MIN": 1, 18 | "NAME": "lineSize", 19 | "TYPE": "float" 20 | } 21 | ], 22 | "ISFVSN": "2", 23 | "PASSES": [ 24 | { 25 | "DESCRIPTION": "this buffer stores the last frame's odd / even state", 26 | "HEIGHT": "1", 27 | "PERSISTENT": true, 28 | "TARGET": "lastRow", 29 | "WIDTH": "1" 30 | }, 31 | { 32 | "PERSISTENT": true, 33 | "TARGET": "lastFrame" 34 | } 35 | ] 36 | } 37 | */ 38 | 39 | void main() 40 | { 41 | // if this is the first pass, i'm going to read the position from the "lastRow" image, and write a new position based on this and the hold variables 42 | if (PASSINDEX == 0) { 43 | vec4 srcPixel = IMG_PIXEL(lastRow,vec2(0.5)); 44 | // i'm only using the X and Y components, which are the X and Y offset (normalized) for the frame 45 | srcPixel.x = (srcPixel.x) > 0.5 ? 0.0 : 1.0; 46 | gl_FragColor = srcPixel; 47 | } 48 | // else this isn't the first pass- read the position value from the buffer which stores it 49 | else { 50 | vec4 lastRow = IMG_PIXEL(lastRow,vec2(0.5)); 51 | vec2 pixelCoord = isf_FragNormCoord * RENDERSIZE; 52 | 53 | if (mod(floor(pixelCoord.y),2.0 * lineSize) < lineSize + lineSize * lastRow.x) 54 | gl_FragColor = IMG_NORM_PIXEL(inputImage,isf_FragNormCoord); 55 | else 56 | gl_FragColor = IMG_NORM_PIXEL(lastFrame,isf_FragNormCoord); 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /test_files/Echo Trace.fs: -------------------------------------------------------------------------------- 1 | /*{ 2 | "CATEGORIES": [ 3 | "Feedback" 4 | ], 5 | "CREDIT": "by VIDVOX", 6 | "DESCRIPTION": "Pixel with brightness levels below the threshold do not update.", 7 | "INPUTS": [ 8 | { 9 | "NAME": "inputImage", 10 | "TYPE": "image" 11 | }, 12 | { 13 | "DEFAULT": 0, 14 | "LABEL": "Threshold", 15 | "MAX": 1, 16 | "MIN": 0, 17 | "NAME": "thresh", 18 | "TYPE": "float" 19 | }, 20 | { 21 | "DEFAULT": 1, 22 | "LABEL": "Gain", 23 | "MAX": 2, 24 | "MIN": 0, 25 | "NAME": "gain", 26 | "TYPE": "float" 27 | }, 28 | { 29 | "DEFAULT": true, 30 | "LABEL": "Hard Cutoff", 31 | "NAME": "hardCutoff", 32 | "TYPE": "bool" 33 | }, 34 | { 35 | "DEFAULT": false, 36 | "LABEL": "Invert", 37 | "NAME": "invert", 38 | "TYPE": "bool" 39 | } 40 | ], 41 | "ISFVSN": "2", 42 | "PASSES": [ 43 | { 44 | "FLOAT": true, 45 | "PERSISTENT": true, 46 | "TARGET": "bufferVariableNameA" 47 | }, 48 | { 49 | } 50 | ] 51 | } 52 | */ 53 | 54 | void main() 55 | { 56 | vec4 freshPixel = IMG_PIXEL(inputImage,gl_FragCoord.xy); 57 | vec4 stalePixel = IMG_PIXEL(bufferVariableNameA,gl_FragCoord.xy); 58 | float brightLevel = (freshPixel.r + freshPixel.b + freshPixel.g) / 3.0; 59 | if (invert) 60 | brightLevel = 1.0 - brightLevel; 61 | brightLevel = brightLevel * gain; 62 | if (hardCutoff) { 63 | if (brightLevel < thresh) 64 | brightLevel = 1.0; 65 | else 66 | brightLevel = 0.0; 67 | } 68 | gl_FragColor = mix(freshPixel,stalePixel, brightLevel); 69 | } 70 | -------------------------------------------------------------------------------- /test_files/v002 Vignette.fs: -------------------------------------------------------------------------------- 1 | /*{ 2 | "CATEGORIES": [ 3 | "Film", 4 | "v002" 5 | ], 6 | "CREDIT": "by v002", 7 | "INPUTS": [ 8 | { 9 | "NAME": "inputImage", 10 | "TYPE": "image" 11 | }, 12 | { 13 | "DEFAULT": 0.5, 14 | "MAX": 1, 15 | "MIN": 0, 16 | "NAME": "vignette", 17 | "TYPE": "float" 18 | }, 19 | { 20 | "DEFAULT": 0, 21 | "MAX": 1, 22 | "MIN": 0, 23 | "NAME": "vignetteEdge", 24 | "TYPE": "float" 25 | }, 26 | { 27 | "DEFAULT": 0, 28 | "MAX": 1, 29 | "MIN": 0, 30 | "NAME": "vignetteMix", 31 | "TYPE": "float" 32 | } 33 | ], 34 | "ISFVSN": "2" 35 | } 36 | */ 37 | 38 | 39 | // Based on v002 vignette – https://github.com/v002/v002-Film-Effects/ 40 | 41 | 42 | 43 | // create a black and white oval about the center of our image for our vignette 44 | vec4 vignetteFucntion(vec2 normalizedTexcoord, float vignetteedge, float vignetteMix) 45 | { 46 | normalizedTexcoord = 2.0 * normalizedTexcoord - 1.0; // - 1.0 to 1.0 47 | float r = length(normalizedTexcoord); 48 | vec4 vignette = (vec4(smoothstep(0.0, 1.0, pow(clamp(r - vignetteMix, 0.0, 1.0), 1.0 + vignetteedge * 10.0)))); 49 | return clamp(1.0 - vignette, 0.0, 1.0); 50 | } 51 | 52 | 53 | 54 | void main (void) 55 | { 56 | vec2 normcoord = vec2(isf_FragNormCoord[0],isf_FragNormCoord[1]); 57 | 58 | 59 | // make a vignette around our borders. 60 | vec4 vignetteResult = vignetteFucntion(normcoord, vignetteEdge, vignetteMix); 61 | 62 | // sharpen via unsharp mask (subtract image from blured image) 63 | vec4 input0 = IMG_THIS_PIXEL(inputImage); 64 | 65 | gl_FragColor = mix(input0,vignetteResult * input0, vignette); 66 | } -------------------------------------------------------------------------------- /test_files/Radial Gradient.fs: -------------------------------------------------------------------------------- 1 | /*{ 2 | "CATEGORIES": [ 3 | "Color" 4 | ], 5 | "CREDIT": "by Carter Rosenberg", 6 | "INPUTS": [ 7 | { 8 | "DEFAULT": 0.1, 9 | "NAME": "radius1", 10 | "TYPE": "float" 11 | }, 12 | { 13 | "DEFAULT": 0.25, 14 | "NAME": "radius2", 15 | "TYPE": "float" 16 | }, 17 | { 18 | "DEFAULT": [ 19 | 1, 20 | 0.75, 21 | 0, 22 | 1 23 | ], 24 | "NAME": "startColor", 25 | "TYPE": "color" 26 | }, 27 | { 28 | "DEFAULT": [ 29 | 0, 30 | 0.25, 31 | 0.75, 32 | 1 33 | ], 34 | "NAME": "endColor", 35 | "TYPE": "color" 36 | }, 37 | { 38 | "DEFAULT": [ 39 | 0.5, 40 | 0.5 41 | ], 42 | "MAX": [ 43 | 1, 44 | 1 45 | ], 46 | "MIN": [ 47 | 0, 48 | 0 49 | ], 50 | "NAME": "location", 51 | "TYPE": "point2D" 52 | } 53 | ], 54 | "ISFVSN": "2" 55 | } 56 | */ 57 | 58 | 59 | 60 | void main() { 61 | vec2 tmpPt = location; 62 | float mixOffset = distance(tmpPt * RENDERSIZE.x / RENDERSIZE.y, isf_FragNormCoord * RENDERSIZE.x / RENDERSIZE.y); 63 | float tmpRadius = radius1 + radius2; 64 | if (mixOffset <= radius1) { 65 | gl_FragColor = startColor; 66 | } 67 | else if (mixOffset > tmpRadius) { 68 | gl_FragColor = endColor; 69 | } 70 | else if (radius1 == tmpRadius) { 71 | gl_FragColor = endColor; 72 | } 73 | else { 74 | gl_FragColor = mix(startColor,endColor,(mixOffset-radius1)/(tmpRadius-radius1)); 75 | } 76 | } -------------------------------------------------------------------------------- /test_files/TV Static.fs: -------------------------------------------------------------------------------- 1 | /*{ 2 | "CATEGORIES": [ 3 | "Wipe" 4 | ], 5 | "CREDIT": "Automatically converted from https://www.github.com/gl-transitions/gl-transitions/tree/master/TVStatic.glsl", 6 | "DESCRIPTION": "", 7 | "INPUTS": [ 8 | { 9 | "NAME": "startImage", 10 | "TYPE": "image" 11 | }, 12 | { 13 | "NAME": "endImage", 14 | "TYPE": "image" 15 | }, 16 | { 17 | "DEFAULT": 0, 18 | "MAX": 1, 19 | "MIN": 0, 20 | "NAME": "progress", 21 | "TYPE": "float" 22 | }, 23 | { 24 | "DEFAULT": 0.05, 25 | "MAX": 1, 26 | "MIN": 0, 27 | "NAME": "offset", 28 | "TYPE": "float" 29 | } 30 | ], 31 | "ISFVSN": "2" 32 | } 33 | */ 34 | 35 | 36 | 37 | vec4 getFromColor(vec2 inUV) { 38 | return IMG_NORM_PIXEL(startImage, inUV); 39 | } 40 | vec4 getToColor(vec2 inUV) { 41 | return IMG_NORM_PIXEL(endImage, inUV); 42 | } 43 | 44 | 45 | 46 | // author: Brandon Anzaldi 47 | // license: MIT 48 | 49 | // Pseudo-random noise function 50 | // http://byteblacksmith.com/improvements-to-the-canonical-one-liner-glsl-rand-for-opengl-es-2-0/ 51 | highp float noise(vec2 co) 52 | { 53 | highp float a = 12.9898; 54 | highp float b = 78.233; 55 | highp float c = 43758.5453; 56 | highp float dt= dot(co.xy * progress, vec2(a, b)); 57 | highp float sn= mod(dt,3.14); 58 | return fract(sin(sn) * c); 59 | } 60 | 61 | vec4 transition(vec2 p) { 62 | if (progress < offset) { 63 | return getFromColor(p); 64 | } else if (progress > (1.0 - offset)) { 65 | return getToColor(p); 66 | } else { 67 | return vec4(vec3(noise(p)), 1.0); 68 | } 69 | } 70 | 71 | 72 | 73 | void main() { 74 | gl_FragColor = transition(isf_FragNormCoord.xy); 75 | } -------------------------------------------------------------------------------- /test_files/Directional Warp.fs: -------------------------------------------------------------------------------- 1 | /*{ 2 | "CATEGORIES": [ 3 | "Distortion" 4 | ], 5 | "CREDIT": "Automatically converted from https://www.github.com/gl-transitions/gl-transitions/tree/master/directionalwarp.glsl", 6 | "DESCRIPTION": "", 7 | "INPUTS": [ 8 | { 9 | "NAME": "startImage", 10 | "TYPE": "image" 11 | }, 12 | { 13 | "NAME": "endImage", 14 | "TYPE": "image" 15 | }, 16 | { 17 | "DEFAULT": 0, 18 | "MAX": 1, 19 | "MIN": 0, 20 | "NAME": "progress", 21 | "TYPE": "float" 22 | }, 23 | { 24 | "DEFAULT": [ 25 | -1, 26 | 1 27 | ], 28 | "MAX": [ 29 | 1, 30 | 1 31 | ], 32 | "MIN": [ 33 | -1, 34 | -1 35 | ], 36 | "NAME": "direction", 37 | "TYPE": "point2D" 38 | } 39 | ], 40 | "ISFVSN": "2" 41 | } 42 | */ 43 | 44 | 45 | 46 | vec4 getFromColor(vec2 inUV) { 47 | return IMG_NORM_PIXEL(startImage, inUV); 48 | } 49 | vec4 getToColor(vec2 inUV) { 50 | return IMG_NORM_PIXEL(endImage, inUV); 51 | } 52 | 53 | 54 | 55 | // Author: pschroen 56 | // License: MIT 57 | 58 | 59 | const float smoothness = 0.5; 60 | const vec2 center = vec2(0.5, 0.5); 61 | 62 | vec4 transition (vec2 uv) { 63 | vec2 v = normalize(direction); 64 | v /= abs(v.x) + abs(v.y); 65 | float d = v.x * center.x + v.y * center.y; 66 | float m = 1.0 - smoothstep(-smoothness, 0.0, v.x * uv.x + v.y * uv.y - (d - 0.5 + progress * (1.0 + smoothness))); 67 | return mix(getFromColor((uv - 0.5) * (1.0 - m) + 0.5), getToColor((uv - 0.5) * m + 0.5), m); 68 | } 69 | 70 | 71 | 72 | void main() { 73 | gl_FragColor = transition(isf_FragNormCoord.xy); 74 | } -------------------------------------------------------------------------------- /test_files/Linear Blur.fs: -------------------------------------------------------------------------------- 1 | /*{ 2 | "CATEGORIES": [ 3 | "Dissolve" 4 | ], 5 | "CREDIT": "Automatically converted from https://www.github.com/gl-transitions/gl-transitions/tree/master/LinearBlur.glsl", 6 | "DESCRIPTION": "", 7 | "INPUTS": [ 8 | { 9 | "NAME": "startImage", 10 | "TYPE": "image" 11 | }, 12 | { 13 | "NAME": "endImage", 14 | "TYPE": "image" 15 | }, 16 | { 17 | "DEFAULT": 0, 18 | "MAX": 1, 19 | "MIN": 0, 20 | "NAME": "progress", 21 | "TYPE": "float" 22 | }, 23 | { 24 | "DEFAULT": 0.1, 25 | "MAX": 1, 26 | "MIN": 0, 27 | "NAME": "intensity", 28 | "TYPE": "float" 29 | } 30 | ], 31 | "ISFVSN": "2" 32 | } 33 | */ 34 | 35 | 36 | 37 | vec4 getFromColor(vec2 inUV) { 38 | return IMG_NORM_PIXEL(startImage, inUV); 39 | } 40 | vec4 getToColor(vec2 inUV) { 41 | return IMG_NORM_PIXEL(endImage, inUV); 42 | } 43 | 44 | 45 | 46 | // author: gre 47 | // license: MIT 48 | const int passes = 6; 49 | 50 | vec4 transition(vec2 uv) { 51 | vec4 c1 = vec4(0.0); 52 | vec4 c2 = vec4(0.0); 53 | 54 | float disp = intensity*(0.5-distance(0.5, progress)); 55 | for (int xi=0; xi 1.0)||(loc.y > 1.0)) { 70 | gl_FragColor = vec4(0.0); 71 | } 72 | else { 73 | gl_FragColor = color; 74 | } 75 | } -------------------------------------------------------------------------------- /test_files/Linear Gradient.fs: -------------------------------------------------------------------------------- 1 | /*{ 2 | "CREDIT": "by Carter Rosenberg", 3 | "ISFVSN": "2", 4 | "CATEGORIES": [ 5 | "Color" 6 | ], 7 | "INPUTS": [ 8 | { 9 | "NAME": "offset", 10 | "TYPE": "float", 11 | "DEFAULT": 0.5 12 | }, 13 | { 14 | "NAME": "frequency", 15 | "TYPE": "float", 16 | "MAX": 16.0, 17 | "MIN": 1.0, 18 | "DEFAULT": 1.0 19 | }, 20 | { 21 | "NAME": "curve", 22 | "TYPE": "long", 23 | "VALUES": [ 24 | 0, 25 | 1, 26 | 2 27 | ], 28 | "LABELS": [ 29 | "Linear", 30 | "Sine", 31 | "Exponential" 32 | ], 33 | "DEFAULT": 0 34 | }, 35 | { 36 | "NAME": "vertical", 37 | "TYPE": "bool", 38 | "DEFAULT": 0.0 39 | }, 40 | { 41 | "NAME": "startColor", 42 | "TYPE": "color", 43 | "DEFAULT": [ 44 | 1.0, 45 | 0.75, 46 | 0.0, 47 | 1.0 48 | ] 49 | }, 50 | { 51 | "NAME": "endColor", 52 | "TYPE": "color", 53 | "DEFAULT": [ 54 | 0.0, 55 | 0.25, 56 | 0.75, 57 | 1.0 58 | ] 59 | } 60 | ] 61 | }*/ 62 | 63 | 64 | 65 | const float pi = 3.14159265359; 66 | const float e = 2.71828182846; 67 | 68 | 69 | 70 | void main() { 71 | float mixAmount = 0.0; 72 | float phase = offset; 73 | 74 | if (vertical) { 75 | mixAmount = phase + frequency * isf_FragNormCoord[1]; 76 | } 77 | else { 78 | mixAmount = phase + frequency * isf_FragNormCoord[0]; 79 | } 80 | 81 | if (curve == 0) { 82 | mixAmount = mod(2.0 * mixAmount,2.0); 83 | mixAmount = (mixAmount < 1.0) ? mixAmount : 1.0 - (mixAmount - floor(mixAmount)); 84 | } 85 | else if (curve == 1) { 86 | mixAmount = sin(mixAmount * pi * 2.0 - pi / 2.0) * 0.5 + 0.5; 87 | } 88 | else if (curve == 2) { 89 | mixAmount = mod(2.0 * mixAmount, 2.0); 90 | mixAmount = (mixAmount < 1.0) ? mixAmount : 1.0 - (mixAmount - floor(mixAmount)); 91 | mixAmount = pow(mixAmount, 2.0); 92 | } 93 | 94 | gl_FragColor = mix(startColor,endColor,mixAmount); 95 | } -------------------------------------------------------------------------------- /test_files/Random Squares.fs: -------------------------------------------------------------------------------- 1 | /*{ 2 | "CATEGORIES": [ 3 | "Dissolve" 4 | ], 5 | "CREDIT": "Automatically converted from https://www.github.com/gl-transitions/gl-transitions/tree/master/randomsquares.glsl", 6 | "DESCRIPTION": "", 7 | "INPUTS": [ 8 | { 9 | "NAME": "startImage", 10 | "TYPE": "image" 11 | }, 12 | { 13 | "NAME": "endImage", 14 | "TYPE": "image" 15 | }, 16 | { 17 | "DEFAULT": 0, 18 | "MAX": 1, 19 | "MIN": 0, 20 | "NAME": "progress", 21 | "TYPE": "float" 22 | }, 23 | { 24 | "DEFAULT": 0.5, 25 | "MAX": 1, 26 | "MIN": 0, 27 | "NAME": "smoothness", 28 | "TYPE": "float" 29 | }, 30 | { 31 | "DEFAULT": [ 32 | 10, 33 | 10 34 | ], 35 | "MAX": [ 36 | 100, 37 | 100 38 | ], 39 | "MIN": [ 40 | 0, 41 | 0 42 | ], 43 | "NAME": "size", 44 | "TYPE": "point2D" 45 | } 46 | ], 47 | "ISFVSN": "2" 48 | } 49 | */ 50 | 51 | 52 | 53 | vec4 getFromColor(vec2 inUV) { 54 | return IMG_NORM_PIXEL(startImage, inUV); 55 | } 56 | vec4 getToColor(vec2 inUV) { 57 | return IMG_NORM_PIXEL(endImage, inUV); 58 | } 59 | 60 | 61 | 62 | // Author: gre 63 | // License: MIT 64 | 65 | 66 | float rand (vec2 co) { 67 | return fract(sin(dot(co.xy ,vec2(12.9898,78.233))) * 43758.5453); 68 | } 69 | 70 | vec4 transition(vec2 p) { 71 | float r = rand(floor(vec2(size) * p)); 72 | float m = smoothstep(0.0, -smoothness, r - (progress * (1.0 + smoothness))); 73 | return mix(getFromColor(p), getToColor(p), m); 74 | } 75 | 76 | 77 | 78 | void main() { 79 | gl_FragColor = transition(isf_FragNormCoord.xy); 80 | } -------------------------------------------------------------------------------- /test_files/Color History.fs: -------------------------------------------------------------------------------- 1 | /* 2 | { 3 | "CATEGORIES" : [ 4 | "Color" 5 | ], 6 | "DESCRIPTION" : "Displays Data Over Time", 7 | "ISFVSN" : "2", 8 | "INPUTS" : [ 9 | { 10 | "LABELS" : [ 11 | "Color", 12 | "Lines" 13 | ], 14 | "NAME" : "displayMode", 15 | "TYPE" : "long", 16 | "DEFAULT" : 0, 17 | "VALUES" : [ 18 | 0, 19 | 1 20 | ] 21 | }, 22 | { 23 | "NAME" : "data", 24 | "TYPE" : "color", 25 | "DEFAULT" : [ 26 | 0.95, 27 | 0.25, 28 | 0, 29 | 1 30 | ] 31 | } 32 | ], 33 | "PASSES" : [ 34 | { 35 | "PERSISTENT" : true, 36 | "WIDTH" : "$WIDTH", 37 | "HEIGHT" : "1", 38 | "TARGET" : "dataHistory", 39 | "FLOAT" : true 40 | }, 41 | { 42 | 43 | } 44 | ], 45 | "CREDIT" : "VIDVOX" 46 | } 47 | */ 48 | 49 | void main() { 50 | vec4 inputPixelColor = vec4(0.0); 51 | if (PASSINDEX == 0) { 52 | vec2 loc = gl_FragCoord.xy; 53 | if (floor(loc.x) == 0.0) { 54 | inputPixelColor = data; 55 | } 56 | else { 57 | loc.x = loc.x - 1.0; 58 | inputPixelColor = IMG_PIXEL(dataHistory,loc); 59 | } 60 | } 61 | else { 62 | vec2 loc = gl_FragCoord.xy; 63 | vec4 val = IMG_PIXEL(dataHistory,loc); 64 | if (displayMode == 0) { 65 | inputPixelColor = val; 66 | } 67 | else if (displayMode == 1) { 68 | float tmp = floor(val.r * RENDERSIZE.y); 69 | inputPixelColor.a = val.a; 70 | if (floor(loc.y) == tmp) { 71 | inputPixelColor.r = 1.0; 72 | inputPixelColor.a = 1.0; 73 | } 74 | tmp = floor(val.g * RENDERSIZE.y); 75 | if (floor(loc.y) == tmp) { 76 | inputPixelColor.g = 1.0; 77 | inputPixelColor.a = 1.0; 78 | } 79 | tmp = floor(val.b * RENDERSIZE.y); 80 | if (floor(loc.y) == tmp) { 81 | inputPixelColor.b = 1.0; 82 | inputPixelColor.a = 1.0; 83 | } 84 | } 85 | 86 | } 87 | gl_FragColor = inputPixelColor; 88 | } 89 | -------------------------------------------------------------------------------- /test_files/Test-AudioFFT.fs: -------------------------------------------------------------------------------- 1 | /*{ 2 | "DESCRIPTION": "Visualizes an FFT analysis image with custom set colors for frequency domain", 3 | "CREDIT": "by VIDVOX", 4 | "ISFVSN": "2", 5 | "CATEGORIES": [ 6 | "Generator" 7 | ], 8 | "INPUTS": [ 9 | { 10 | "NAME": "fftImage", 11 | "TYPE": "audioFFT" 12 | }, 13 | { 14 | "NAME": "strokeSize", 15 | "TYPE": "float", 16 | "MIN": 0.0, 17 | "MAX": 0.25, 18 | "DEFAULT": 0.01 19 | }, 20 | { 21 | "NAME": "gain", 22 | "TYPE": "float", 23 | "MIN": 1.0, 24 | "MAX": 5.0, 25 | "DEFAULT": 1.0 26 | }, 27 | { 28 | "NAME": "minRange", 29 | "TYPE": "float", 30 | "MIN": 0.0, 31 | "MAX": 1.0, 32 | "DEFAULT": 0.0 33 | }, 34 | { 35 | "NAME": "maxRange", 36 | "TYPE": "float", 37 | "MIN": 0.0, 38 | "MAX": 1.0, 39 | "DEFAULT": 0.9 40 | }, 41 | { 42 | "NAME": "topColor", 43 | "TYPE": "color", 44 | "DEFAULT": [ 45 | 0.0, 46 | 0.0, 47 | 0.0, 48 | 0.0 49 | ] 50 | }, 51 | { 52 | "NAME": "bottomColor", 53 | "TYPE": "color", 54 | "DEFAULT": [ 55 | 0.0, 56 | 0.5, 57 | 0.9, 58 | 1.0 59 | ] 60 | }, 61 | { 62 | "NAME": "strokeColor", 63 | "TYPE": "color", 64 | "DEFAULT": [ 65 | 0.25, 66 | 0.25, 67 | 0.25, 68 | 1.0 69 | ] 70 | } 71 | ] 72 | }*/ 73 | 74 | 75 | 76 | void main() { 77 | 78 | vec2 loc = isf_FragNormCoord; 79 | 80 | // the fftImage is 256 steps 81 | loc.x = loc.x * abs(maxRange - minRange) + minRange; 82 | 83 | vec4 fft = IMG_NORM_PIXEL(fftImage, vec2(loc.x,0.5)); 84 | float fftVal = gain * (fft.r + fft.g + fft.b) / 3.0; 85 | if (loc.y > fftVal) 86 | fft = topColor; 87 | else 88 | fft = bottomColor; 89 | if ((strokeSize > 0.0) && (abs(fftVal - loc.y) < strokeSize)) { 90 | fft = mix(strokeColor, fft, abs(fftVal - loc.y) / strokeSize); 91 | } 92 | 93 | //(smoothstep(0.0, stroke, abs(fftVal - loc.y))) * strokeColor); 94 | gl_FragColor = fft; 95 | } -------------------------------------------------------------------------------- /test_files/Sphere Map.fs: -------------------------------------------------------------------------------- 1 | /*{ 2 | "CATEGORIES": [ 3 | "Distortion Effect" 4 | ], 5 | "CREDIT": "VIDVOX", 6 | "DESCRIPTION": "Maps video onto a sphere", 7 | "INPUTS": [ 8 | { 9 | "NAME": "inputImage", 10 | "TYPE": "image" 11 | }, 12 | { 13 | "DEFAULT": 0.5, 14 | "LABEL": "Image Scale", 15 | "MAX": 1, 16 | "MIN": 0.125, 17 | "NAME": "imageScale", 18 | "TYPE": "float" 19 | }, 20 | { 21 | "DEFAULT": 1, 22 | "LABEL": "Radius Scale", 23 | "MAX": 1.999, 24 | "MIN": 0, 25 | "NAME": "radiusScale", 26 | "TYPE": "float" 27 | }, 28 | { 29 | "DEFAULT": [ 30 | 0, 31 | 0 32 | ], 33 | "LABEL": "Rotate", 34 | "MAX": [ 35 | 1, 36 | 1 37 | ], 38 | "MIN": [ 39 | 0, 40 | 0 41 | ], 42 | "NAME": "pointInput", 43 | "TYPE": "point2D" 44 | } 45 | ], 46 | "ISFVSN": "2" 47 | } 48 | */ 49 | 50 | 51 | 52 | const float pi = 3.14159265359; 53 | 54 | 55 | void main() { 56 | vec4 inputPixelColor = vec4(0.0); 57 | vec2 rotate = pointInput; 58 | vec2 p = 2.0 * isf_FragNormCoord.xy - 1.0; 59 | float aspect = RENDERSIZE.x / RENDERSIZE.y; 60 | p.x = p.x * aspect; 61 | 62 | float r = sqrt(dot(p,p)) * (2.0-radiusScale); 63 | if (r < 1.0) { 64 | vec2 uv; 65 | float f = imageScale * (1.0-sqrt(1.0-r))/(r); 66 | uv.x = mod(p.x*f + rotate.x,1.0); 67 | uv.y = mod(p.y*f + rotate.y,1.0); 68 | inputPixelColor = IMG_NORM_PIXEL(inputImage, uv); 69 | } 70 | 71 | 72 | // both of these are also the same 73 | //inputPixelColor = IMG_NORM_PIXEL(inputImage, loc); 74 | 75 | gl_FragColor = inputPixelColor; 76 | } 77 | -------------------------------------------------------------------------------- /test_files/Checkerboard.fs: -------------------------------------------------------------------------------- 1 | /* 2 | { 3 | "CATEGORIES" : [ 4 | "Pattern", "Color" 5 | ], 6 | "ISFVSN" : "2", 7 | "INPUTS" : [ 8 | { 9 | "NAME" : "width", 10 | "TYPE" : "float", 11 | "DEFAULT" : 0.25 12 | }, 13 | { 14 | "NAME" : "offset", 15 | "TYPE" : "point2D", 16 | "DEFAULT" : [ 17 | 0, 18 | 0 19 | ], 20 | "MIN" : [ 21 | 0, 22 | 0 23 | ], 24 | "MAX" : [ 25 | 1, 26 | 1 27 | ] 28 | }, 29 | { 30 | "NAME" : "color1", 31 | "TYPE" : "color", 32 | "DEFAULT" : [ 33 | 1, 34 | 1, 35 | 1, 36 | 1 37 | ] 38 | }, 39 | { 40 | "NAME" : "color2", 41 | "TYPE" : "color", 42 | "DEFAULT" : [ 43 | 0, 44 | 0, 45 | 0, 46 | 1 47 | ] 48 | }, 49 | { 50 | "NAME" : "splitPos", 51 | "TYPE" : "point2D", 52 | "MAX" : [ 53 | 1, 54 | 1 55 | ], 56 | "DEFAULT" : [ 57 | 0.5, 58 | 0.5 59 | ], 60 | "MIN" : [ 61 | 0, 62 | 0 63 | ] 64 | } 65 | ], 66 | "CREDIT" : "by VIDVOX" 67 | } 68 | */ 69 | 70 | 71 | 72 | void main() { 73 | // determine if we are on an even or odd line 74 | // math goes like.. 75 | // mod(((coord+offset) / width),2) 76 | 77 | 78 | vec4 out_color = color2; 79 | float size = width * RENDERSIZE.x; 80 | 81 | if (size == 0.0) { 82 | out_color = color1; 83 | } 84 | else if ((mod(((gl_FragCoord.x+(offset.x*RENDERSIZE.x)) / size),2.0) < 2.0 * splitPos.x)&&(mod(((gl_FragCoord.y+(offset.y*RENDERSIZE.y)) / size),2.0) > 2.0 * splitPos.y)) { 85 | out_color = color1; 86 | } 87 | else if ((mod(((gl_FragCoord.x+(offset.x*RENDERSIZE.x)) / size),2.0) > 2.0 * splitPos.x)&&(mod(((gl_FragCoord.y+(offset.y*RENDERSIZE.y)) / size),2.0) < 2.0 * splitPos.y)) { 88 | out_color = color1; 89 | } 90 | 91 | gl_FragColor = out_color; 92 | } -------------------------------------------------------------------------------- /test_files/FFT Filled Waveform.fs: -------------------------------------------------------------------------------- 1 | /*{ 2 | "DESCRIPTION": "Visualizes an FFT analysis image with custom set colors for frequency domain", 3 | "CREDIT": "by VIDVOX", 4 | "ISFVSN": "2", 5 | "CATEGORIES": [ 6 | "Audio Visualizer" 7 | ], 8 | "INPUTS": [ 9 | { 10 | "NAME": "fftImage", 11 | "TYPE": "audioFFT" 12 | }, 13 | { 14 | "NAME": "strokeSize", 15 | "TYPE": "float", 16 | "MIN": 0.0, 17 | "MAX": 0.25, 18 | "DEFAULT": 0.1 19 | }, 20 | { 21 | "NAME": "gain", 22 | "TYPE": "float", 23 | "MIN": 1.0, 24 | "MAX": 5.0, 25 | "DEFAULT": 1.0 26 | }, 27 | { 28 | "NAME": "minRange", 29 | "TYPE": "float", 30 | "MIN": 0.0, 31 | "MAX": 1.0, 32 | "DEFAULT": 0.1 33 | }, 34 | { 35 | "NAME": "maxRange", 36 | "TYPE": "float", 37 | "MIN": 0.0, 38 | "MAX": 1.0, 39 | "DEFAULT": 0.9 40 | }, 41 | { 42 | "NAME": "topColor", 43 | "TYPE": "color", 44 | "DEFAULT": [ 45 | 0.0, 46 | 0.0, 47 | 0.0, 48 | 0.0 49 | ] 50 | }, 51 | { 52 | "NAME": "bottomColor", 53 | "TYPE": "color", 54 | "DEFAULT": [ 55 | 0.0, 56 | 0.5, 57 | 0.9, 58 | 1.0 59 | ] 60 | }, 61 | { 62 | "NAME": "strokeColor", 63 | "TYPE": "color", 64 | "DEFAULT": [ 65 | 0.25, 66 | 0.25, 67 | 0.25, 68 | 1.0 69 | ] 70 | } 71 | ] 72 | }*/ 73 | 74 | 75 | 76 | void main() { 77 | 78 | vec2 loc = isf_FragNormCoord; 79 | 80 | // the fftImage is 256 steps 81 | loc.x = loc.x * abs(maxRange - minRange) + minRange; 82 | 83 | vec4 fft = IMG_NORM_PIXEL(fftImage, vec2(loc.x,0.5)); 84 | float fftVal = gain * (fft.r + fft.g + fft.b) / 3.0; 85 | if (loc.y > fftVal) 86 | fft = topColor; 87 | else 88 | fft = bottomColor; 89 | if ((strokeSize > 0.0) && (abs(fftVal - loc.y) < strokeSize)) { 90 | fft = mix(strokeColor, fft, abs(fftVal - loc.y) / strokeSize); 91 | } 92 | 93 | //(smoothstep(0.0, stroke, abs(fftVal - loc.y))) * strokeColor); 94 | gl_FragColor = fft; 95 | } -------------------------------------------------------------------------------- /test_files/Shockwave.fs: -------------------------------------------------------------------------------- 1 | /*{ 2 | "DESCRIPTION": "", 3 | "CREDIT": "by VIDVOX", 4 | "CATEGORIES": [ 5 | "Distortion Effect" 6 | ], 7 | "INPUTS": [ 8 | { 9 | "NAME": "inputImage", 10 | "TYPE": "image" 11 | }, 12 | { 13 | "NAME": "positionVal", 14 | "TYPE": "float", 15 | "MIN": 0, 16 | "MAX": 1, 17 | "DEFAULT": 0 18 | }, 19 | { 20 | "NAME": "distortion", 21 | "TYPE": "float", 22 | "MIN": 1, 23 | "MAX": 20, 24 | "DEFAULT": 10 25 | }, 26 | { 27 | "NAME": "magnitude", 28 | "TYPE": "float", 29 | "MIN": 0, 30 | "MAX": 0.2, 31 | "DEFAULT": 0.08 32 | }, 33 | { 34 | "NAME" : "center", 35 | "TYPE" : "point2D", 36 | "MAX" : [ 37 | 1, 38 | 1 39 | ], 40 | "DEFAULT" : [ 41 | 0.5, 42 | 0.5 43 | ], 44 | "MIN" : [ 45 | 0, 46 | 0 47 | ] 48 | }, 49 | { 50 | "NAME": "background", 51 | "TYPE": "bool", 52 | "DEFAULT": 1 53 | } 54 | ] 55 | }*/ 56 | 57 | 58 | 59 | void main() 60 | { 61 | // do this junk so that the ripple starts from nothing 62 | vec2 uv = isf_FragNormCoord.xy; 63 | vec2 texCoord = uv; 64 | vec2 mod_center = center; 65 | vec4 color = vec4(0.0); 66 | float dist = distance(uv, mod_center); 67 | float adjustedTime = (positionVal * RENDERSIZE.x/RENDERSIZE.y - magnitude)/(1.0 - magnitude); 68 | 69 | if ( (dist <= (adjustedTime + magnitude)) && (dist >= (adjustedTime - magnitude)) ) { 70 | float diff = (dist - adjustedTime); 71 | float powDiff = 1.0 - pow(abs(diff*distortion), 72 | 0.8); 73 | float diffTime = diff * powDiff; 74 | vec2 diffUV = normalize(uv - mod_center); 75 | texCoord = uv + (diffUV * diffTime); 76 | color = IMG_NORM_PIXEL(inputImage, texCoord); 77 | } 78 | else if (background) { 79 | color = IMG_NORM_PIXEL(inputImage, texCoord); 80 | } 81 | gl_FragColor = color; 82 | } 83 | -------------------------------------------------------------------------------- /test_files/Waveform Displace.fs: -------------------------------------------------------------------------------- 1 | /*{ 2 | "CATEGORIES": [ 3 | "Audio Visualizer", 4 | "Distortion Effect" 5 | ], 6 | "CREDIT": "icalvin102 (calvin@icalvin.de)", 7 | "DESCRIPTION": "Displaces image with audio waveform", 8 | "INPUTS": [ 9 | { 10 | "NAME": "inputImage", 11 | "TYPE": "image" 12 | }, 13 | { 14 | "LABEL": "Audio Waveform", 15 | "NAME": "audio", 16 | "TYPE": "audio" 17 | }, 18 | { 19 | "DEFAULT": 0.1, 20 | "LABEL": "Displace X", 21 | "MAX": 1, 22 | "MIN": 0, 23 | "NAME": "displaceX", 24 | "TYPE": "float" 25 | }, 26 | { 27 | "DEFAULT": 0.1, 28 | "LABEL": "Displace Y", 29 | "MAX": 1, 30 | "MIN": 0, 31 | "NAME": "displaceY", 32 | "TYPE": "float" 33 | }, 34 | { 35 | "DEFAULT": 0.5, 36 | "LABEL": "Detail X", 37 | "MAX": 1, 38 | "MIN": 0, 39 | "NAME": "detailX", 40 | "TYPE": "float" 41 | }, 42 | { 43 | "DEFAULT": 0.5, 44 | "LABEL": "Detail Y", 45 | "MAX": 1, 46 | "MIN": 0, 47 | "NAME": "detailY", 48 | "TYPE": "float" 49 | } 50 | ], 51 | "ISFVSN": "2", 52 | "PASSES": [ 53 | { 54 | "DESCRIPTION": "Renderpass 0" 55 | } 56 | ] 57 | } 58 | */ 59 | 60 | void main() { 61 | 62 | vec4 inputPixelColor; 63 | vec2 uv = isf_FragNormCoord.xy; 64 | vec2 waveLoc = fract((uv)*vec2(detailX, detailY)); 65 | 66 | vec2 wave = vec2(IMG_NORM_PIXEL(audio, vec2(waveLoc.x, 0.0)).r, IMG_NORM_PIXEL(audio, vec2(waveLoc.y, 1.0)).r)-.5; 67 | wave *= vec2(displaceY, displaceX); 68 | 69 | inputPixelColor = IMG_NORM_PIXEL(inputImage, uv + wave.yx); 70 | 71 | gl_FragColor = inputPixelColor; 72 | } 73 | --------------------------------------------------------------------------------