├── .gitignore ├── README.md ├── bower.json ├── chromavore.jpg ├── index.html ├── lib └── Seriously.js │ ├── .bower.json │ ├── AUTHORS │ ├── CONTRIBUTING.md │ ├── LICENSE │ ├── README.md │ ├── effects │ ├── seriously.accumulator.js │ ├── seriously.ascii.js │ ├── seriously.bleach-bypass.js │ ├── seriously.blend.js │ ├── seriously.blur.js │ ├── seriously.brightness-contrast.js │ ├── seriously.channels.js │ ├── seriously.checkerboard.js │ ├── seriously.chroma.js │ ├── seriously.color-select.js │ ├── seriously.color.js │ ├── seriously.colorcomplements.js │ ├── seriously.colorcube.js │ ├── seriously.crop.js │ ├── seriously.daltonize.js │ ├── seriously.directionblur.js │ ├── seriously.displacement.js │ ├── seriously.dither.js │ ├── seriously.edge.js │ ├── seriously.emboss.js │ ├── seriously.exposure.js │ ├── seriously.expression.js │ ├── seriously.fader.js │ ├── seriously.falsecolor.js │ ├── seriously.filmgrain.js │ ├── seriously.freeze.js │ ├── seriously.fxaa.js │ ├── seriously.gradientwipe.js │ ├── seriously.hex.js │ ├── seriously.highlights-shadows.js │ ├── seriously.hue-saturation.js │ ├── seriously.invert.js │ ├── seriously.kaleidoscope.js │ ├── seriously.layers.js │ ├── seriously.linear-transfer.js │ ├── seriously.lumakey.js │ ├── seriously.lut.js │ ├── seriously.mirror.js │ ├── seriously.nightvision.js │ ├── seriously.noise.js │ ├── seriously.panorama.js │ ├── seriously.pixelate.js │ ├── seriously.polar.js │ ├── seriously.repeat.js │ ├── seriously.ripple.js │ ├── seriously.scanlines.js │ ├── seriously.select.js │ ├── seriously.sepia.js │ ├── seriously.simplex.js │ ├── seriously.sketch.js │ ├── seriously.split.js │ ├── seriously.temperature.js │ ├── seriously.throttle.js │ ├── seriously.tone.js │ ├── seriously.tvglitch.js │ ├── seriously.vibrance.js │ ├── seriously.vignette.js │ └── seriously.whitebalance.js │ ├── examples │ ├── accumulator │ │ └── index.html │ ├── amd │ │ └── index.html │ ├── animate │ │ └── index.html │ ├── blend │ │ └── index.html │ ├── blur │ │ ├── blur.html │ │ ├── directionblur.html │ │ └── whip.html │ ├── camera │ │ ├── camera-source.html │ │ └── index.html │ ├── channels │ │ └── index.html │ ├── color │ │ ├── color.html │ │ ├── linear-transfer.html │ │ └── lut.html │ ├── crop.html │ ├── demo │ │ ├── drunk.html │ │ ├── fog.html │ │ ├── panorama.html │ │ ├── select.html │ │ ├── threejs-source.html │ │ └── threejs-target.html │ ├── displace │ │ └── index.html │ ├── gradientwipe.html │ ├── images │ │ ├── README.md │ │ ├── colorbars.png │ │ ├── field.jpg │ │ ├── lut_cyanspike.png │ │ ├── lut_lockstock.png │ │ ├── lut_supervivid.png │ │ ├── monochromebars.png │ │ ├── panorama.jpg │ │ ├── pencils.jpg │ │ ├── robot.jpg │ │ ├── table.jpg │ │ └── xbcontroller.jpg │ ├── index.html │ ├── mirror │ │ ├── camera.html │ │ └── index.html │ ├── rStats.css │ ├── target │ │ └── multi-target.html │ ├── transform │ │ ├── camerashake.html │ │ └── reformat.html │ └── tutorial │ │ ├── tutorial01-datauri.html │ │ └── tutorial01.html │ ├── index.html │ ├── lib │ ├── rStats.js │ ├── require.js │ ├── three.js │ └── webgl-debug.js │ ├── seriously.js │ ├── sources │ ├── seriously.array.js │ ├── seriously.camera.js │ ├── seriously.depth.js │ ├── seriously.imagedata.js │ └── seriously.three.js │ ├── targets │ └── seriously.three.js │ ├── test │ ├── index.html │ ├── media │ │ ├── tiny.mp4 │ │ └── tiny.webm │ ├── qunit │ │ ├── qunit.css │ │ └── qunit.js │ ├── seriously.unit.js │ └── seriously.unit.setup.js │ ├── transforms │ ├── seriously.camerashake.js │ └── seriously.transform3d.js │ └── util │ └── medialoader.js ├── package-lock.json ├── package.json └── videos ├── KOLL-HD.mp4 ├── bilousby-HD.mp4 ├── built.ee-HD.mp4 ├── crystmounts-HD.mp4 ├── multi-turbs-HD.mp4 └── smoke-four-HD.mp4 /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # chromavore 2 | Generative painting thing 3 | 4 | Live demo: http://positlabs.github.io/chromavore/ 5 | 6 | [![chromavore title image](http://positlabs.github.io/chromavore/chromavore.jpg)](http://positlabs.github.io/chromavore/) 7 | 8 | [Gallery on imgur](http://imgur.com/gallery/3Qkp3#42guVtR) 9 | 10 | To save a snapshot, right-click > save as. 11 | 12 | Install dependencies with `bower install`. 13 | 14 | Videos by @beeple http://beeple-crap.com 15 | 16 | Powered by SeriouslyJS https://github.com/brianchirls/Seriously.js/ 17 | 18 | -------------------------------------------------------------------------------- /bower.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "chromavore", 3 | "version": "0.0.1", 4 | "homepage": "https://github.com/positlabs/chromavore", 5 | "authors": [ 6 | "Josh Beckwith " 7 | ], 8 | "description": "generative painting thing", 9 | "main": "index.html", 10 | "license": "MIT", 11 | "ignore": [ 12 | "**/.*", 13 | "node_modules", 14 | "bower_components", 15 | "test", 16 | "tests" 17 | ], 18 | "dependencies": { 19 | "Seriously.js": "git@github.com:brianchirls/Seriously.js.git#develop" 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /chromavore.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/positlabs/chromavore/a7c994e42b67dd17b09ca459f854d2f0abc8405e/chromavore.jpg -------------------------------------------------------------------------------- /lib/Seriously.js/.bower.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "Seriously.js", 3 | "homepage": "https://github.com/brianchirls/Seriously.js", 4 | "_release": "62532b4456", 5 | "_resolution": { 6 | "type": "branch", 7 | "branch": "develop", 8 | "commit": "62532b4456baf06b7f8a33d51f1c73cdf23de587" 9 | }, 10 | "_source": "git@github.com:brianchirls/Seriously.js.git", 11 | "_target": "develop", 12 | "_originalSource": "git@github.com:brianchirls/Seriously.js.git" 13 | } -------------------------------------------------------------------------------- /lib/Seriously.js/AUTHORS: -------------------------------------------------------------------------------- 1 | Brian Chirls 2 | -------------------------------------------------------------------------------- /lib/Seriously.js/CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # Contributing to Seriously.js # 2 | 3 | Contributions are welcome, whether new core features, effects, bug fixes or examples. Please follow these guidelines. 4 | 5 | ## Workflow ## 6 | * All contributions should be based off the latest `develop` branch, and pull requests must be submitted to `develop`. Any pull requests to `master` will be rejected. 7 | * Create a separate branch for each patch or feature 8 | * Any modifications to the core script must pass unit tests. Whenever possible, especially for new features, please add a test. 9 | * New features or effects should have an example. 10 | * Any copied assets (e.g. images, shaders or code) should have the appropriate license and credit allowing for their use in this repository. 11 | * When refactoring existing code, make sure all relevant examples still work or are updated to work. 12 | * If a patch is relevant to a [GitHub issue](https://github.com/brianchirls/Seriously.js/issues?state=open), please reference the issue number with a hash in the commit message. 13 | * All Javascript code should follow the style guide below 14 | 15 | ## Code Style ## 16 | * Indent with tabs, not spaces 17 | * No trailing spaces 18 | * Single quotes for strings 19 | * Spaces around binary operators (e.g. `a + b`, not `a+b`), but not unary ones 20 | * `if`, `while`, `try`, etc. must all have braces and span multiple lines. 21 | * All local variables should be declared in one `var` statement at the top of each function 22 | * functions should be declared after `var` but before any other statements. 23 | * Lots of comments please, but put them on the line before the code, not at the end of the line. 24 | * When in doubt, refer to existing code. 25 | 26 | ## Best Practices ## 27 | * Prioritize speed for code that runs in render loops, but prioritize readability, simplicity and usability for everything else. 28 | * Publicly accessible methods should be simple to use and forgiving of mistakes whenever possible. Assume they're being used by inexperienced programmers. 29 | * Observe [WebGL best practices](https://developer.mozilla.org/en-US/docs/Web/WebGL/WebGL_best_practices) 30 | * Private or protected code may assume more advanced users, to prioritize speed and power. 31 | * Minimize impact on the global environment. No unnecessary global variables, and shim when necessary but don't polyfill. 32 | * All plugins must support either AMD or global declarations (see [UMD](https://github.com/umdjs/umd/blob/master/returnExportsGlobal.js)). Examples may use AMD, but it's not required. 33 | * Check all Javascript code with jshint or jslint, but use your brain. The following options are recommended: 34 | ` devel: true, bitwise: true, browser: true, white: true, nomen: true, plusplus: true, maxerr: 50, indent: 4, todo: true` -------------------------------------------------------------------------------- /lib/Seriously.js/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2012-2014 Brian Chirls 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining 4 | a copy of this software and associated documentation files (the 5 | "Software"), to deal in the Software without restriction, including 6 | without limitation the rights to use, copy, modify, merge, publish, 7 | distribute, sublicense, and/or sell copies of the Software, and to 8 | permit persons to whom the Software is furnished to do so, subject to 9 | the following conditions: 10 | 11 | The above copyright notice and this permission notice shall be 12 | included in all copies or substantial portions of the Software. 13 | 14 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 15 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 16 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 17 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 18 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 19 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 20 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 | -------------------------------------------------------------------------------- /lib/Seriously.js/README.md: -------------------------------------------------------------------------------- 1 | # Seriously.js 2 | 3 | Seriously.js is a real-time, node-based video compositor for the web. 4 | Inspired by professional software such as After Effects and Nuke, 5 | Seriously.js renders high-quality video effects, but allows them to be 6 | dynamic and interactive. 7 | 8 | ## Getting Started 9 | 10 | Full documentation is in progress at the [wiki](https://github.com/brianchirls/Seriously.js/wiki). Start with the 11 | [Tutorial](https://github.com/brianchirls/Seriously.js/wiki/Tutorial) and 12 | [FAQ](https://github.com/brianchirls/Seriously.js/wiki/Frequently-Asked-Questions). 13 | 14 | ## Features 15 | 16 | - Optimized rendering path and GPU accelerated up to 60 frames per second 17 | - Accept image input from varied sources: video, image, canvas, array, webcam, Three.js 18 | - Effect parameters accept multiple formats and can monitor HTML form inputs 19 | - Basic 2D transforms (translate, rotate, scale, skew) on effect nodes 20 | - Plugin architecture for adding new effects, sources and targets 21 | - Read pixel array from any node 22 | - Load with [AMD](http://requirejs.org/docs/whyamd.html#amd)/[RequireJS](http://www.requirejs.org/) 23 | 24 | ### Included Effects 25 | - Accumulator 26 | - Ascii Text 27 | - Bleach Bypass 28 | - Blend 29 | - Brightness/Contrast 30 | - Channel Mapping 31 | - Checkerboard Generator 32 | - Chroma Key 33 | - Color Complements 34 | - Color Generator 35 | - [Color Cube](http://www.youtube.com/watch?v=rfQ8rKGTVlg&t=24m30s) 36 | - Color Select 37 | - Color Temperature 38 | - Crop 39 | - [Daltonize](http://www.daltonize.org/p/about.html) 40 | - Directional Blur 41 | - Displacement Map 42 | - Dither 43 | - Edge Detect 44 | - Emboss 45 | - Exposure Adjust 46 | - Expressions 47 | - Fader 48 | - False Color 49 | - Fast Approximate Anti-Aliasing 50 | - Film Grain 51 | - Freeze Frame 52 | - Gaussian Blur 53 | - Hex Tiles 54 | - Highlights/Shadows 55 | - Hue/Saturation Adjust 56 | - Invert 57 | - Kaleidoscope 58 | - Layers 59 | - Linear Transfer 60 | - Luma Key 61 | - Mirror 62 | - Night Vision 63 | - Panorama 64 | - Pixelate 65 | - Polar Coordinates 66 | - Ripple 67 | - Scanlines 68 | - Sepia tone 69 | - Simplex Noise 70 | - Sketch 71 | - Split 72 | - Throttle Frame Rate 73 | - Tone Adjust 74 | - TV Glitch 75 | - Vibrance 76 | - Vignette 77 | - White Balance 78 | 79 | ### Requirements 80 | 81 | #### WebGL 82 | 83 | Seriously.js requires a browser that supports [WebGL](http://en.wikipedia.org/wiki/Webgl). 84 | Development is targeted to and tested in Firefox (4.0+), Google Chrome (9+), Internet Explorer (11+) and Opera (18+). Safari is [expected to support WebGL](http://caniuse.com/#search=webgl) 85 | in the near future. 86 | 87 | Even though a browser may support WebGL, the ability to run it depends 88 | on the system's graphics card. Seriously.js is heavily optimized, so most 89 | modern desktops and notebooks should be sufficient. Older systems may 90 | run slower, especially when using high-resolution videos. 91 | 92 | Mobile browser support for WebGL has improved. Mobile Firefox, Chrome and Safari have decent 93 | support, but they can be slower than desktop versions due to limited system resources. 94 | 95 | Seriously.js provides a method to detect browser support and offer 96 | descriptive error messages wherever possible. 97 | 98 | #### Cross-Origin Videos and Images 99 | 100 | Due to security limitations of WebGL, Seriously.js can only process video 101 | or images that are served from the same domain, unless they are served 102 | with [CORS headers](http://hacks.mozilla.org/2011/11/using-cors-to-load-webgl-textures-from-cross-domain-images/). 103 | Firefox, Chrome and Opera support CORS for video, but Safari and Internet Explorer do not, and videos served with CORS are rare. So for now, it is best to host your own video files. 104 | 105 | ## Contributing 106 | 107 | Bug fixes, new features, effects and examples are welcome and appreciated. Please follow the [Contributing Guidelines](https://github.com/brianchirls/Seriously.js/wiki/Contributing). 108 | 109 | ## License 110 | Seriously.js is made available under the [MIT License](http://www.opensource.org/licenses/mit-license.php). 111 | 112 | Individual plugins may be licensed differently. Check source code comments. 113 | 114 | ## Credits 115 | 116 | Seriously.js is created and maintained by [Brian Chirls](http://chirls.com) -------------------------------------------------------------------------------- /lib/Seriously.js/effects/seriously.bleach-bypass.js: -------------------------------------------------------------------------------- 1 | /* global define, require */ 2 | (function (root, factory) { 3 | 'use strict'; 4 | 5 | if (typeof define === 'function' && define.amd) { 6 | // AMD. Register as an anonymous module. 7 | define(['seriously'], factory); 8 | } else if (typeof exports === 'object') { 9 | // Node/CommonJS 10 | factory(require('seriously')); 11 | } else { 12 | if (!root.Seriously) { 13 | root.Seriously = { plugin: function (name, opt) { this[name] = opt; } }; 14 | } 15 | factory(root.Seriously); 16 | } 17 | }(window, function (Seriously) { 18 | 'use strict'; 19 | 20 | /* 21 | Shader code: 22 | * Copyright vade - Anton Marini 23 | * Creative Commons, Attribution - Non Commercial - Share Alike 3.0 24 | 25 | http://v002.info/?page_id=34 26 | 27 | Modified to keep alpha channel constant 28 | */ 29 | 30 | Seriously.plugin('bleach-bypass', { 31 | commonShader: true, 32 | shader: function (inputs, shaderSource) { 33 | shaderSource.fragment = [ 34 | 'precision mediump float;', 35 | 36 | 'varying vec2 vTexCoord;', 37 | 38 | 'uniform sampler2D source;', 39 | 40 | 'uniform float amount;', 41 | 42 | //constants 43 | 'const vec4 one = vec4(1.0);', 44 | 'const vec4 two = vec4(2.0);', 45 | 'const vec4 lumcoeff = vec4(0.2125,0.7154,0.0721,0.0);', 46 | 47 | 'vec4 overlay(vec4 myInput, vec4 previousmix, vec4 amount) {', 48 | ' float luminance = dot(previousmix,lumcoeff);', 49 | ' float mixamount = clamp((luminance - 0.45) * 10.0, 0.0, 1.0);', 50 | 51 | ' vec4 branch1 = two * previousmix * myInput;', 52 | ' vec4 branch2 = one - (two * (one - previousmix) * (one - myInput));', 53 | 54 | ' vec4 result = mix(branch1, branch2, vec4(mixamount) );', 55 | 56 | ' return mix(previousmix, result, amount);', 57 | '}', 58 | 59 | 'void main (void) {', 60 | ' vec4 pixel = texture2D(source, vTexCoord);', 61 | ' vec4 luma = vec4(vec3(dot(pixel,lumcoeff)), pixel.a);', 62 | ' gl_FragColor = overlay(luma, pixel, vec4(amount));', 63 | '}' 64 | ].join('\n'); 65 | return shaderSource; 66 | }, 67 | inPlace: true, 68 | inputs: { 69 | source: { 70 | type: 'image', 71 | uniform: 'source', 72 | shaderDirty: false 73 | }, 74 | amount: { 75 | type: 'number', 76 | uniform: 'amount', 77 | defaultValue: 1, 78 | min: 0, 79 | max: 1 80 | } 81 | }, 82 | title: 'Bleach Bypass', 83 | categories: ['film'], 84 | description: [ 85 | 'Bleach Bypass film treatment', 86 | 'http://en.wikipedia.org/wiki/Bleach_bypass', 87 | 'see: "Saving Private Ryan", "Minority Report"' 88 | ].join('\n') 89 | }); 90 | })); 91 | -------------------------------------------------------------------------------- /lib/Seriously.js/effects/seriously.brightness-contrast.js: -------------------------------------------------------------------------------- 1 | /* global define, require */ 2 | (function (root, factory) { 3 | 'use strict'; 4 | 5 | if (typeof define === 'function' && define.amd) { 6 | // AMD. Register as an anonymous module. 7 | define(['seriously'], factory); 8 | } else if (typeof exports === 'object') { 9 | // Node/CommonJS 10 | factory(require('seriously')); 11 | } else { 12 | if (!root.Seriously) { 13 | root.Seriously = { plugin: function (name, opt) { this[name] = opt; } }; 14 | } 15 | factory(root.Seriously); 16 | } 17 | }(window, function (Seriously) { 18 | 'use strict'; 19 | 20 | Seriously.plugin('brightness-contrast', { 21 | commonShader: true, 22 | shader: function (inputs, shaderSource) { 23 | shaderSource.fragment = [ 24 | 'precision mediump float;', 25 | 26 | 'varying vec2 vTexCoord;', 27 | 28 | 'uniform sampler2D source;', 29 | 'uniform float brightness;', 30 | 'uniform float saturation;', 31 | 'uniform float contrast;', 32 | 33 | 'const vec3 half3 = vec3(0.5);', 34 | 35 | 'void main(void) {', 36 | ' vec4 pixel = texture2D(source, vTexCoord);', 37 | 38 | //adjust brightness 39 | ' vec3 color = pixel.rgb * brightness;', 40 | 41 | //adjust contrast 42 | ' color = (color - half3) * contrast + half3;', 43 | 44 | //keep alpha the same 45 | ' gl_FragColor = vec4(color, pixel.a);', 46 | '}' 47 | ].join('\n'); 48 | return shaderSource; 49 | }, 50 | inPlace: true, 51 | inputs: { 52 | source: { 53 | type: 'image', 54 | uniform: 'source' 55 | }, 56 | brightness: { 57 | type: 'number', 58 | uniform: 'brightness', 59 | defaultValue: 1, 60 | min: 0 61 | }, 62 | contrast: { 63 | type: 'number', 64 | uniform: 'contrast', 65 | defaultValue: 1, 66 | min: 0 67 | } 68 | }, 69 | title: 'Brightness/Contrast', 70 | description: 'Multiply brightness and contrast values. Works the same as CSS filters.' 71 | }); 72 | })); 73 | -------------------------------------------------------------------------------- /lib/Seriously.js/effects/seriously.checkerboard.js: -------------------------------------------------------------------------------- 1 | /* global define, require */ 2 | (function (root, factory) { 3 | 'use strict'; 4 | 5 | if (typeof define === 'function' && define.amd) { 6 | // AMD. Register as an anonymous module. 7 | define(['seriously'], factory); 8 | } else if (typeof exports === 'object') { 9 | // Node/CommonJS 10 | factory(require('seriously')); 11 | } else { 12 | if (!root.Seriously) { 13 | root.Seriously = { plugin: function (name, opt) { this[name] = opt; } }; 14 | } 15 | factory(root.Seriously); 16 | } 17 | }(window, function (Seriously) { 18 | 'use strict'; 19 | 20 | Seriously.plugin('checkerboard', function () { 21 | var me = this; 22 | 23 | function resize() { 24 | me.resize(); 25 | } 26 | 27 | return { 28 | initialize: function (initialize) { 29 | initialize(); 30 | resize(); 31 | }, 32 | shader: function (inputs, shaderSource) { 33 | shaderSource.vertex = [ 34 | 'precision mediump float;', 35 | 36 | 'attribute vec4 position;', 37 | 'attribute vec2 texCoord;', 38 | 39 | 'uniform vec2 resolution;', 40 | 'uniform mat4 transform;', 41 | 42 | 'uniform vec2 size;', 43 | 'uniform vec2 anchor;', 44 | 45 | 'vec2 pixelCoord;', //based in center 46 | 'varying vec2 vGridCoord;', //based in center 47 | 48 | 'void main(void) {', 49 | // first convert to screen space 50 | ' vec4 screenPosition = vec4(position.xy * resolution / 2.0, position.z, position.w);', 51 | ' screenPosition = transform * screenPosition;', 52 | 53 | // convert back to OpenGL coords 54 | ' gl_Position.xy = screenPosition.xy * 2.0 / resolution;', 55 | ' gl_Position.z = screenPosition.z * 2.0 / (resolution.x / resolution.y);', 56 | ' gl_Position.w = screenPosition.w;', 57 | 58 | ' pixelCoord = resolution * (texCoord - 0.5) / 2.0;', 59 | ' vGridCoord = (pixelCoord - anchor) / size;', 60 | '}\n' 61 | ].join('\n'); 62 | shaderSource.fragment = [ 63 | 'precision mediump float;', 64 | 65 | 'varying vec2 vTexCoord;', 66 | 'varying vec2 vPixelCoord;', 67 | 'varying vec2 vGridCoord;', 68 | 69 | 'uniform vec2 resolution;', 70 | 'uniform vec2 anchor;', 71 | 'uniform vec2 size;', 72 | 'uniform vec4 color1;', 73 | 'uniform vec4 color2;', 74 | 75 | 76 | 'void main(void) {', 77 | ' vec2 modGridCoord = floor(mod(vGridCoord, 2.0));', 78 | ' if (modGridCoord.x == modGridCoord.y) {', 79 | ' gl_FragColor = color1;', 80 | ' } else {', 81 | ' gl_FragColor = color2;', 82 | ' }', 83 | '}' 84 | ].join('\n'); 85 | return shaderSource; 86 | }, 87 | inPlace: true, 88 | inputs: { 89 | anchor: { 90 | type: 'vector', 91 | uniform: 'anchor', 92 | dimensions: 2, 93 | defaultValue: [0, 0] 94 | }, 95 | size: { 96 | type: 'vector', 97 | uniform: 'size', 98 | dimensions: 2, 99 | defaultValue: [4, 4] 100 | }, 101 | color1: { 102 | type: 'color', 103 | uniform: 'color1', 104 | defaultValue: [1, 1, 1, 1] 105 | }, 106 | color2: { 107 | type: 'color', 108 | uniform: 'color2', 109 | defaultValue: [187 / 255, 187 / 255, 187 / 255, 1] 110 | }, 111 | width: { 112 | type: 'number', 113 | min: 0, 114 | step: 1, 115 | update: resize, 116 | defaultValue: 640 117 | }, 118 | height: { 119 | type: 'number', 120 | min: 0, 121 | step: 1, 122 | update: resize, 123 | defaultValue: 360 124 | } 125 | }, 126 | }; 127 | }, { 128 | commonShader: true, 129 | title: 'Checkerboard', 130 | categories: ['generator'] 131 | }); 132 | })); 133 | -------------------------------------------------------------------------------- /lib/Seriously.js/effects/seriously.color.js: -------------------------------------------------------------------------------- 1 | /* global define, require */ 2 | (function (root, factory) { 3 | 'use strict'; 4 | 5 | if (typeof define === 'function' && define.amd) { 6 | // AMD. Register as an anonymous module. 7 | define(['seriously'], factory); 8 | } else if (typeof exports === 'object') { 9 | // Node/CommonJS 10 | factory(require('seriously')); 11 | } else { 12 | if (!root.Seriously) { 13 | root.Seriously = { plugin: function (name, opt) { this[name] = opt; } }; 14 | } 15 | factory(root.Seriously); 16 | } 17 | }(window, function (Seriously) { 18 | 'use strict'; 19 | 20 | Seriously.plugin('color', function () { 21 | var me = this, 22 | drawOpts = { 23 | width: 1, 24 | height: 1 25 | }, 26 | colorDirty = true; 27 | 28 | function resize() { 29 | me.resize(); 30 | } 31 | 32 | /* 33 | Similar to the EffectNode prototype resize method, but does not resize the FrameBuffer 34 | */ 35 | this.resize = function () { 36 | var width, 37 | height, 38 | i, 39 | target; 40 | 41 | if (this.inputs && this.inputs.width) { 42 | width = this.inputs.width; 43 | height = this.inputs.height || width; 44 | } else if (this.inputs && this.inputs.height) { 45 | width = height = this.inputs.height; 46 | } else { 47 | width = 1; 48 | height = 1; 49 | } 50 | 51 | width = Math.floor(width); 52 | height = Math.floor(height); 53 | 54 | if (this.width !== width || this.height !== height) { 55 | this.width = width; 56 | this.height = height; 57 | 58 | this.emit('resize'); 59 | this.setDirty(); 60 | } 61 | 62 | for (i = 0; i < this.targets.length; i++) { 63 | target = this.targets[i]; 64 | target.resize(); 65 | if (target.setTransformDirty) { 66 | target.setTransformDirty(); 67 | } 68 | } 69 | }; 70 | 71 | return { 72 | initialize: function (initialize) { 73 | /* 74 | No reason to use anything bigger than 1x1, since it's a single color. 75 | This should make look-ups on this texture very fast 76 | */ 77 | this.frameBuffer = new Seriously.util.FrameBuffer(this.gl, 1, 1); 78 | resize(); 79 | colorDirty = true; 80 | }, 81 | commonShader: true, 82 | shader: function(inputs, shaderSource) { 83 | shaderSource.vertex = [ 84 | 'precision mediump float;', 85 | 86 | 'attribute vec4 position;', 87 | 88 | 'void main(void) {', 89 | ' gl_Position = position;', 90 | '}\n' 91 | ].join('\n'); 92 | shaderSource.fragment = [ 93 | 'precision mediump float;\n', 94 | 95 | 'uniform vec4 color;', 96 | 97 | 'void main(void) {', 98 | ' gl_FragColor = color;', 99 | '}' 100 | ].join('\n'); 101 | return shaderSource; 102 | }, 103 | draw: function (shader, model, uniforms, frameBuffer, draw) { 104 | /* 105 | Node will be dirty if size changes, but we only need to redraw if 106 | the color changes...not that it matters much, since we're only drawing 107 | a single pixel. 108 | */ 109 | if (colorDirty) { 110 | draw(shader, model, uniforms, frameBuffer, null, drawOpts); 111 | colorDirty = false; 112 | } 113 | }, 114 | inPlace: true, 115 | inputs: { 116 | color: { 117 | type: 'color', 118 | uniform: 'color', 119 | defaultValue: [0, 0, 0, 1], 120 | update: function () { 121 | colorDirty = true; 122 | } 123 | }, 124 | width: { 125 | type: 'number', 126 | min: 0, 127 | step: 1, 128 | update: resize, 129 | defaultValue: 640 130 | }, 131 | height: { 132 | type: 'number', 133 | min: 0, 134 | step: 1, 135 | update: resize, 136 | defaultValue: 360 137 | } 138 | }, 139 | }; 140 | }, { 141 | title: 'Color', 142 | description: 'Generate color', 143 | categories: ['generator'] 144 | }); 145 | })); 146 | -------------------------------------------------------------------------------- /lib/Seriously.js/effects/seriously.colorcomplements.js: -------------------------------------------------------------------------------- 1 | /* global define, require */ 2 | (function (root, factory) { 3 | 'use strict'; 4 | 5 | if (typeof define === 'function' && define.amd) { 6 | // AMD. Register as an anonymous module. 7 | define(['seriously'], factory); 8 | } else if (typeof exports === 'object') { 9 | // Node/CommonJS 10 | factory(require('seriously')); 11 | } else { 12 | if (!root.Seriously) { 13 | root.Seriously = { plugin: function (name, opt) { this[name] = opt; } }; 14 | } 15 | factory(root.Seriously); 16 | } 17 | }(window, function (Seriously) { 18 | 'use strict'; 19 | 20 | Seriously.plugin('colorcomplements', { 21 | commonShader: true, 22 | shader: function (inputs, shaderSource) { 23 | shaderSource.fragment = [ 24 | 'precision mediump float;', 25 | 26 | 'varying vec2 vTexCoord;', 27 | 28 | 'uniform sampler2D source;', 29 | 'uniform vec4 guideColor;', 30 | 'uniform float correlation;', 31 | 'uniform float amount;', 32 | 'uniform float concentration;', 33 | 34 | 'float hueLerp(float h1, float h2, float v) {', 35 | ' float d = abs(h1 - h2);', 36 | ' if (d <= 0.5) {', 37 | ' return mix(h1, h2, v);', 38 | ' } else if (h1 < h2) {', 39 | ' return fract(mix((h1 + 1.0), h2, v));', 40 | ' } else {', 41 | ' return fract(mix(h1, (h2 + 1.0), v));', 42 | ' }', 43 | '}', 44 | 45 | //conversion functions borrowed from http://lolengine.net/blog/2013/07/27/rgb-to-hsv-in-glsl 46 | 'vec3 rgbToHsv(vec3 c) {', 47 | ' vec4 K = vec4(0.0, -1.0 / 3.0, 2.0 / 3.0, -1.0);', 48 | ' vec4 p = c.g < c.b ? vec4(c.bg, K.wz) : vec4(c.gb, K.xy);', 49 | ' vec4 q = c.r < p.x ? vec4(p.xyw, c.r) : vec4(c.r, p.yzx);', 50 | 51 | ' float d = q.x - min(q.w, q.y);', 52 | ' float e = 1.0e-10;', 53 | ' return vec3(abs(q.z + (q.w - q.y) / (6.0 * d + e)), d / (q.x + e), q.x);', 54 | '}', 55 | 56 | 'vec3 hsvToRgb(vec3 c) {', 57 | ' vec4 K = vec4(1.0, 2.0 / 3.0, 1.0 / 3.0, 3.0);', 58 | ' vec3 p = abs(fract(c.xxx + K.xyz) * 6.0 - K.www);', 59 | ' return c.z * mix(K.xxx, clamp(p - K.xxx, 0.0, 1.0), c.y);', 60 | '}', 61 | 62 | 'vec3 hsvComplement(vec3 hsv) {', 63 | ' vec3 compl = hsv;', 64 | ' compl.x = mod(compl.x - 0.5, 1.0);', 65 | ' return compl;', 66 | '}', 67 | 68 | 'void main(void) {', 69 | ' vec4 pixel = texture2D(source, vTexCoord);', 70 | ' vec3 hsv = rgbToHsv(pixel.rgb);', 71 | ' vec3 hsvPole1 = rgbToHsv(guideColor.rgb);', 72 | ' vec3 hsvPole2 = hsvPole1;', 73 | ' hsvPole2 = hsvComplement(hsvPole1);', 74 | ' float dist1 = abs(hsv.x - hsvPole1.x);', 75 | ' dist1 = dist1 > 0.5 ? 1.0 - dist1 : dist1;', 76 | ' float dist2 = abs(hsv.x - hsvPole2.x);', 77 | ' dist2 = dist2 > 0.5 ? 1.0 - dist2 : dist2;', 78 | 79 | ' float descent = smoothstep(0.0, correlation, hsv.y);', 80 | ' vec3 outputHsv = hsv;', 81 | ' vec3 pole = dist1 < dist2 ? hsvPole1 : hsvPole2;', 82 | ' float dist = min(dist1, dist2);', 83 | ' float c = descent * amount * (1.0 - pow((dist * 2.0), 1.0 / concentration));', 84 | ' outputHsv.x = hueLerp(hsv.x, pole.x, c);', 85 | ' outputHsv.y = mix(hsv.y, pole.y, c);', 86 | 87 | ' gl_FragColor = vec4(hsvToRgb(outputHsv), pixel.a);', 88 | '}' 89 | ].join('\n'); 90 | return shaderSource; 91 | }, 92 | inPlace: true, 93 | inputs: { 94 | source: { 95 | type: 'image', 96 | uniform: 'source' 97 | }, 98 | amount: { 99 | type: 'number', 100 | uniform: 'amount', 101 | min: 0, 102 | max: 1, 103 | defaultValue: 0.8 104 | }, 105 | concentration: { 106 | type: 'number', 107 | uniform: 'concentration', 108 | min: 0.1, 109 | max: 4, 110 | defaultValue: 2 111 | }, 112 | correlation: { 113 | type: 'number', 114 | uniform: 'correlation', 115 | min: 0, 116 | max: 1, 117 | defaultValue: 0.5 118 | }, 119 | guideColor: { 120 | type: 'color', 121 | uniform: 'guideColor', 122 | defaultValue: [1, 0.5, 0, 1] 123 | } 124 | }, 125 | title: 'Color Complements', 126 | categories: ['color'], 127 | description: 'http://theabyssgazes.blogspot.com/2010/03/teal-and-orange-hollywood-please-stop.html' 128 | }); 129 | })); 130 | -------------------------------------------------------------------------------- /lib/Seriously.js/effects/seriously.colorcube.js: -------------------------------------------------------------------------------- 1 | /* global define, require */ 2 | (function (root, factory) { 3 | 'use strict'; 4 | 5 | if (typeof define === 'function' && define.amd) { 6 | // AMD. Register as an anonymous module. 7 | define(['seriously'], factory); 8 | } else if (typeof exports === 'object') { 9 | // Node/CommonJS 10 | factory(require('seriously')); 11 | } else { 12 | if (!root.Seriously) { 13 | root.Seriously = { plugin: function (name, opt) { this[name] = opt; } }; 14 | } 15 | factory(root.Seriously); 16 | } 17 | }(window, function (Seriously) { 18 | 'use strict'; 19 | 20 | // based on tutorial by to Gregg Tavares 21 | // http://www.youtube.com/watch?v=rfQ8rKGTVlg&t=24m30s 22 | // todo: find a way to not invert every single texture 23 | 24 | Seriously.plugin('colorcube', { 25 | commonShader: true, 26 | shader: function (inputs, shaderSource) { 27 | shaderSource.fragment = [ 28 | 'precision mediump float;', 29 | 30 | 'uniform sampler2D source;', 31 | 'uniform sampler2D colorCube;', 32 | 'varying vec2 vTexCoord;', 33 | 34 | 'vec3 sampleAs3DTexture(sampler2D tex, vec3 coord, float size) {', 35 | ' float sliceSize = 1.0 / size;', // space of 1 slice 36 | ' float slicePixelSize = sliceSize / size;', // space of 1 pixel 37 | ' float sliceInnerSize = slicePixelSize * (size - 1.0);', // space of size pixels 38 | ' float zSlice0 = min(floor(coord.z * size), size - 1.0);', 39 | ' float zSlice1 = min(zSlice0 + 1.0, size - 1.0);', 40 | ' float xOffset = slicePixelSize * 0.5 + coord.x * sliceInnerSize;', 41 | ' float s0 = xOffset + (zSlice0 * sliceSize);', 42 | ' float s1 = xOffset + (zSlice1 * sliceSize);', 43 | ' vec3 slice0Color = texture2D(tex, vec2(s0, 1.0 - coord.y)).rgb;', 44 | ' vec3 slice1Color = texture2D(tex, vec2(s1, 1.0 - coord.y)).rgb;', 45 | ' float zOffset = mod(coord.z * size, 1.0);', 46 | ' return mix(slice0Color, slice1Color, zOffset);', 47 | '}', 48 | 49 | 'void main(void) {', 50 | ' vec4 originalColor = texture2D(source, vTexCoord);', 51 | ' vec3 color = sampleAs3DTexture(colorCube, originalColor.rgb, 8.0);', 52 | ' gl_FragColor = vec4(color, originalColor.a);', 53 | '}' 54 | ].join('\n'); 55 | return shaderSource; 56 | }, 57 | inPlace: true, 58 | inputs: { 59 | source: { 60 | type: 'image', 61 | uniform: 'source' 62 | }, 63 | cube: { 64 | type: 'image', 65 | uniform: 'colorCube' 66 | } 67 | }, 68 | title: 'Color Cube', 69 | description: '' 70 | }); 71 | })); 72 | -------------------------------------------------------------------------------- /lib/Seriously.js/effects/seriously.crop.js: -------------------------------------------------------------------------------- 1 | /* global define, require */ 2 | (function (root, factory) { 3 | 'use strict'; 4 | 5 | if (typeof define === 'function' && define.amd) { 6 | // AMD. Register as an anonymous module. 7 | define(['seriously'], factory); 8 | } else if (typeof exports === 'object') { 9 | // Node/CommonJS 10 | factory(require('seriously')); 11 | } else { 12 | if (!root.Seriously) { 13 | root.Seriously = { plugin: function (name, opt) { this[name] = opt; } }; 14 | } 15 | factory(root.Seriously); 16 | } 17 | }(window, function (Seriously) { 18 | 'use strict'; 19 | 20 | Seriously.plugin('crop', function () { 21 | var me = this; 22 | 23 | // custom resize method 24 | function resize() { 25 | var width = 1, 26 | height = 1, 27 | source = me.inputs.source, 28 | target, 29 | i; 30 | 31 | if (me.source) { 32 | width = me.source.width; 33 | height = me.source.height; 34 | } else if (me.sources && me.sources.source) { 35 | width = me.sources.source.width; 36 | height = me.sources.source.height; 37 | } 38 | 39 | width = width - me.inputs.left - me.inputs.right; 40 | height = height - me.inputs.top - me.inputs.bottom; 41 | 42 | width = Math.max(1, Math.floor(width)); 43 | height = Math.max(1, Math.floor(height)); 44 | 45 | 46 | if (me.width !== width || me.height !== height) { 47 | me.width = width; 48 | me.height = height; 49 | 50 | me.uniforms.resolution[0] = width; 51 | me.uniforms.resolution[1] = height; 52 | 53 | if (me.frameBuffer) { 54 | me.frameBuffer.resize(me.width, me.height); 55 | } 56 | 57 | me.emit('resize'); 58 | me.setDirty(); 59 | } 60 | 61 | for (i = 0; i < me.targets.length; i++) { 62 | target = me.targets[i]; 63 | target.resize(); 64 | if (target.setTransformDirty) { 65 | target.setTransformDirty(); 66 | } 67 | } 68 | } 69 | 70 | me.resize = resize; 71 | 72 | return { 73 | commonShader: true, 74 | shader: function (inputs, shaderSource) { 75 | shaderSource.vertex = [ 76 | 'precision mediump float;', 77 | 78 | 'attribute vec4 position;', 79 | 'attribute vec2 texCoord;', 80 | 81 | 'uniform vec2 resolution;', 82 | 'uniform mat4 transform;', 83 | 84 | 'uniform float top;', 85 | 'uniform float left;', 86 | 'uniform float bottom;', 87 | 'uniform float right;', 88 | 89 | 'varying vec2 vTexCoord;', 90 | 91 | 'const vec2 ZERO = vec2(0.0);', 92 | 'const vec2 ONE = vec2(1.0);', 93 | 94 | 'void main(void) {', 95 | // first convert to screen space 96 | ' vec4 screenPosition = vec4(position.xy * resolution / 2.0, position.z, position.w);', 97 | ' screenPosition = transform * screenPosition;', 98 | 99 | // convert back to OpenGL coords 100 | ' gl_Position.xy = screenPosition.xy * 2.0 / resolution;', 101 | ' gl_Position.z = screenPosition.z * 2.0 / (resolution.x / resolution.y);', 102 | ' gl_Position.w = screenPosition.w;', 103 | 104 | ' vec2 dim = resolution + vec2(right + left, bottom + top);', 105 | ' vec2 scale = dim / resolution;', 106 | ' vec2 offset = vec2(left, bottom) / resolution;', 107 | 108 | ' vTexCoord = max(ZERO, (texCoord + offset) / scale);', 109 | '}\n' 110 | ].join('\n'); 111 | return shaderSource; 112 | }, 113 | inputs: { 114 | source: { 115 | type: 'image', 116 | uniform: 'source', 117 | update: resize 118 | }, 119 | top: { 120 | type: 'number', 121 | uniform: 'top', 122 | min: 0, 123 | step: 1, 124 | update: resize, 125 | defaultValue: 0 126 | }, 127 | left: { 128 | type: 'number', 129 | uniform: 'left', 130 | min: 0, 131 | step: 1, 132 | update: resize, 133 | defaultValue: 0 134 | }, 135 | bottom: { 136 | type: 'number', 137 | uniform: 'bottom', 138 | min: 0, 139 | step: 1, 140 | update: resize, 141 | defaultValue: 0 142 | }, 143 | right: { 144 | type: 'number', 145 | uniform: 'right', 146 | min: 0, 147 | step: 1, 148 | update: resize, 149 | defaultValue: 0 150 | } 151 | } 152 | }; 153 | }, 154 | { 155 | inPlace: true, 156 | title: 'Crop' 157 | }); 158 | })); 159 | -------------------------------------------------------------------------------- /lib/Seriously.js/effects/seriously.dither.js: -------------------------------------------------------------------------------- 1 | /* global define, require */ 2 | (function (root, factory) { 3 | 'use strict'; 4 | 5 | if (typeof define === 'function' && define.amd) { 6 | // AMD. Register as an anonymous module. 7 | define(['seriously'], factory); 8 | } else if (typeof exports === 'object') { 9 | // Node/CommonJS 10 | factory(require('seriously')); 11 | } else { 12 | if (!root.Seriously) { 13 | root.Seriously = { plugin: function (name, opt) { this[name] = opt; } }; 14 | } 15 | factory(root.Seriously); 16 | } 17 | }(window, function (Seriously) { 18 | 'use strict'; 19 | 20 | /* 21 | Shader code: 22 | Adapted from a blog post by Martin Upitis 23 | http://devlog-martinsh.blogspot.com.es/2011/03/glsl-dithering.html 24 | */ 25 | 26 | Seriously.plugin('dither', { 27 | commonShader: true, 28 | shader: function (inputs, shaderSource) { 29 | shaderSource.fragment = [ 30 | 'precision mediump float;', 31 | 32 | '#define mod4(a) (a >= 4 ? a - 4 : a)', 33 | 34 | 'varying vec2 vTexCoord;', 35 | 36 | 'uniform sampler2D source;', 37 | 'uniform vec2 resolution;', 38 | 39 | 'const mat4 dither = mat4(' + 40 | '1.0, 33.0, 9.0, 41.0,' + 41 | '49.0, 17.0, 57.0, 25.0,' + 42 | '13.0, 45.0, 5.0, 37.0,' + 43 | '61.0, 29.0, 53.0, 21.0' + 44 | ');', 45 | 46 | 'float find_closest(int x, int y, float c0) {', 47 | ' float limit = 0.0;', 48 | ' int x4 = mod4(x);', 49 | ' int y4 = mod4(y);', 50 | //annoying hack since GLSL ES doesn't support variable array index 51 | ' for (int i = 0; i < 4; i++) {', 52 | ' if (i == x4) {', 53 | ' for (int j = 0; j < 4; j++) {', 54 | ' if (j == y4) {', 55 | ' limit = dither[i][j];', 56 | ' break;', 57 | ' }', 58 | ' }', 59 | ' }', 60 | ' }', 61 | ' if (x < 4) {', 62 | ' if (y >= 4) {', 63 | ' limit += 3.0;', 64 | ' }', 65 | ' } else {', 66 | ' if (y >= 4) {', 67 | ' limit += 1.0;', 68 | ' } else {', 69 | ' limit += 2.0;', 70 | ' }', 71 | ' }', 72 | ' limit /= 65.0;', 73 | ' return c0 < limit ? 0.0 : 1.0;', 74 | '}', 75 | 76 | 'void main (void) {', 77 | ' vec4 pixel = texture2D(source, vTexCoord);', 78 | ' vec2 coord = vTexCoord * resolution;', 79 | ' int x = int(mod(coord.x, 8.0));', 80 | ' int y = int(mod(coord.y, 8.0));', 81 | ' pixel.r = find_closest(x, y, pixel.r);', 82 | ' pixel.g = find_closest(x, y, pixel.g);', 83 | ' pixel.b = find_closest(x, y, pixel.b);', 84 | ' gl_FragColor = pixel;', 85 | '}' 86 | ].join('\n'); 87 | return shaderSource; 88 | }, 89 | inPlace: false, 90 | inputs: { 91 | source: { 92 | type: 'image', 93 | uniform: 'source' 94 | } 95 | }, 96 | title: 'Dither' 97 | }); 98 | })); 99 | -------------------------------------------------------------------------------- /lib/Seriously.js/effects/seriously.emboss.js: -------------------------------------------------------------------------------- 1 | /* global define, require */ 2 | (function (root, factory) { 3 | 'use strict'; 4 | 5 | if (typeof define === 'function' && define.amd) { 6 | // AMD. Register as an anonymous module. 7 | define(['seriously'], factory); 8 | } else if (typeof exports === 'object') { 9 | // Node/CommonJS 10 | factory(require('seriously')); 11 | } else { 12 | if (!root.Seriously) { 13 | root.Seriously = { plugin: function (name, opt) { this[name] = opt; } }; 14 | } 15 | factory(root.Seriously); 16 | } 17 | }(window, function (Seriously) { 18 | 'use strict'; 19 | 20 | Seriously.plugin('emboss', { 21 | commonShader: true, 22 | shader: function (inputs, shaderSource) { 23 | shaderSource.vertex = [ 24 | 'precision mediump float;', 25 | 26 | 'attribute vec4 position;', 27 | 'attribute vec2 texCoord;', 28 | 29 | 'uniform vec2 resolution;', 30 | 'uniform mat4 transform;', 31 | 32 | 'varying vec2 vTexCoord1;', 33 | 'varying vec2 vTexCoord2;', 34 | 35 | 'void main(void) {', 36 | // first convert to screen space 37 | ' vec4 screenPosition = vec4(position.xy * resolution / 2.0, position.z, position.w);', 38 | ' screenPosition = transform * screenPosition;', 39 | 40 | // convert back to OpenGL coords 41 | ' gl_Position.xy = screenPosition.xy * 2.0 / resolution;', 42 | ' gl_Position.z = screenPosition.z * 2.0 / (resolution.x / resolution.y);', 43 | ' gl_Position.w = screenPosition.w;', 44 | 45 | ' vec2 offset = 1.0 / resolution;', 46 | ' vTexCoord1 = texCoord - offset;', 47 | ' vTexCoord2 = texCoord + offset;', 48 | '}' 49 | ].join('\n'); 50 | 51 | shaderSource.fragment = [ 52 | 'precision mediump float;', 53 | 54 | 'varying vec2 vTexCoord1;', 55 | 'varying vec2 vTexCoord2;', 56 | 57 | 'uniform sampler2D source;', 58 | 'uniform float amount;', 59 | 60 | 'const vec3 average = vec3(1.0 / 3.0);', 61 | 62 | 'void main (void) {', 63 | ' vec4 pixel = vec4(0.5, 0.5, 0.5, 1.0);', 64 | 65 | ' pixel -= texture2D(source, vTexCoord1) * amount;', 66 | ' pixel += texture2D(source, vTexCoord2) * amount;', 67 | ' pixel.rgb = vec3(dot(pixel.rgb, average));', 68 | 69 | ' gl_FragColor = pixel;', 70 | '}' 71 | ].join('\n'); 72 | return shaderSource; 73 | }, 74 | inputs: { 75 | source: { 76 | type: 'image', 77 | uniform: 'source' 78 | }, 79 | amount: { 80 | type: 'number', 81 | uniform: 'amount', 82 | defaultValue: 1, 83 | min: -255 / 3, 84 | max: 255 / 3 85 | } 86 | }, 87 | title: 'Emboss', 88 | categories: [], 89 | description: 'Emboss' 90 | }); 91 | })); 92 | -------------------------------------------------------------------------------- /lib/Seriously.js/effects/seriously.exposure.js: -------------------------------------------------------------------------------- 1 | /* global define, require */ 2 | (function (root, factory) { 3 | 'use strict'; 4 | 5 | if (typeof define === 'function' && define.amd) { 6 | // AMD. Register as an anonymous module. 7 | define(['seriously'], factory); 8 | } else if (typeof exports === 'object') { 9 | // Node/CommonJS 10 | factory(require('seriously')); 11 | } else { 12 | if (!root.Seriously) { 13 | root.Seriously = { plugin: function (name, opt) { this[name] = opt; } }; 14 | } 15 | factory(root.Seriously); 16 | } 17 | }(window, function (Seriously) { 18 | 'use strict'; 19 | 20 | Seriously.plugin('exposure', { 21 | commonShader: true, 22 | shader: function (inputs, shaderSource) { 23 | shaderSource.fragment = [ 24 | 'precision mediump float;', 25 | 26 | 'varying vec2 vTexCoord;', 27 | 28 | 'uniform sampler2D source;', 29 | 30 | 'uniform float exposure;', 31 | 32 | 'void main (void) {', 33 | ' vec4 pixel = texture2D(source, vTexCoord);', 34 | ' gl_FragColor = vec4(pow(2.0, exposure) * pixel.rgb, pixel.a);', 35 | '}' 36 | ].join('\n'); 37 | return shaderSource; 38 | }, 39 | inPlace: true, 40 | inputs: { 41 | source: { 42 | type: 'image', 43 | uniform: 'source', 44 | shaderDirty: false 45 | }, 46 | exposure: { 47 | type: 'number', 48 | uniform: 'exposure', 49 | defaultValue: 1, 50 | min: -8, 51 | max: 8 52 | } 53 | }, 54 | title: 'Exposure', 55 | categories: ['film'], 56 | description: 'Exposure control' 57 | }); 58 | })); 59 | -------------------------------------------------------------------------------- /lib/Seriously.js/effects/seriously.fader.js: -------------------------------------------------------------------------------- 1 | /* global define, require */ 2 | (function (root, factory) { 3 | 'use strict'; 4 | 5 | if (typeof define === 'function' && define.amd) { 6 | // AMD. Register as an anonymous module. 7 | define(['seriously'], factory); 8 | } else if (typeof exports === 'object') { 9 | // Node/CommonJS 10 | factory(require('seriously')); 11 | } else { 12 | if (!root.Seriously) { 13 | root.Seriously = { plugin: function (name, opt) { this[name] = opt; } }; 14 | } 15 | factory(root.Seriously); 16 | } 17 | }(window, function (Seriously) { 18 | 'use strict'; 19 | 20 | Seriously.plugin('fader', { 21 | commonShader: true, 22 | shader: function (inputs, shaderSource) { 23 | shaderSource.fragment = [ 24 | 'precision mediump float;', 25 | 26 | 'varying vec2 vTexCoord;', 27 | 28 | 'uniform sampler2D source;', 29 | 'uniform vec4 color;', 30 | 'uniform float amount;', 31 | 32 | 'void main(void) {', 33 | ' gl_FragColor = texture2D(source, vTexCoord);', 34 | ' gl_FragColor = mix(gl_FragColor, color, amount);', 35 | '}' 36 | ].join('\n'); 37 | return shaderSource; 38 | }, 39 | requires: function (sourceName, inputs) { 40 | return inputs.amount < 1; 41 | }, 42 | inPlace: true, 43 | inputs: { 44 | source: { 45 | type: 'image', 46 | uniform: 'source' 47 | }, 48 | color: { 49 | type: 'color', 50 | uniform: 'color', 51 | defaultValue: [0, 0, 0, 1] 52 | }, 53 | amount: { 54 | type: 'number', 55 | uniform: 'amount', 56 | defaultValue: 0.5, 57 | min: 0, 58 | max: 1 59 | } 60 | }, 61 | title: 'Fader', 62 | description: 'Fade image to a color' 63 | }); 64 | })); 65 | -------------------------------------------------------------------------------- /lib/Seriously.js/effects/seriously.falsecolor.js: -------------------------------------------------------------------------------- 1 | /* global define, require */ 2 | (function (root, factory) { 3 | 'use strict'; 4 | 5 | if (typeof define === 'function' && define.amd) { 6 | // AMD. Register as an anonymous module. 7 | define(['seriously'], factory); 8 | } else if (typeof exports === 'object') { 9 | // Node/CommonJS 10 | factory(require('seriously')); 11 | } else { 12 | if (!root.Seriously) { 13 | root.Seriously = { plugin: function (name, opt) { this[name] = opt; } }; 14 | } 15 | factory(root.Seriously); 16 | } 17 | }(window, function (Seriously) { 18 | 'use strict'; 19 | 20 | Seriously.plugin('falsecolor', { 21 | commonShader: true, 22 | shader: function (inputs, shaderSource) { 23 | shaderSource.fragment = [ 24 | 'precision mediump float;', 25 | 26 | 'varying vec2 vTexCoord;', 27 | 28 | 'uniform sampler2D source;', 29 | 'uniform float amount;', 30 | 'uniform vec4 black;', 31 | 'uniform vec4 white;', 32 | 33 | 'const vec3 luma = vec3(0.2125, 0.7154, 0.0721);', 34 | 35 | 'void main(void) {', 36 | ' vec4 pixel = texture2D(source, vTexCoord);', 37 | ' float luminance = dot(pixel.rgb, luma);', 38 | ' vec4 result = mix(black, white, luminance);', 39 | ' gl_FragColor = vec4(result.rgb, pixel.a * result.a);', 40 | '}' 41 | ].join('\n'); 42 | return shaderSource; 43 | }, 44 | inPlace: true, 45 | inputs: { 46 | source: { 47 | type: 'image', 48 | uniform: 'source', 49 | shaderDirty: false 50 | }, 51 | black: { 52 | type: 'color', 53 | uniform: 'black', 54 | defaultValue: [0, 0, 0.5, 1] 55 | }, 56 | white: { 57 | type: 'color', 58 | uniform: 'white', 59 | defaultValue: [1, 0, 0, 1] 60 | } 61 | }, 62 | title: 'False Color' 63 | }); 64 | })); 65 | -------------------------------------------------------------------------------- /lib/Seriously.js/effects/seriously.freeze.js: -------------------------------------------------------------------------------- 1 | /* global define, require */ 2 | (function (root, factory) { 3 | 'use strict'; 4 | 5 | if (typeof define === 'function' && define.amd) { 6 | // AMD. Register as an anonymous module. 7 | define(['seriously'], factory); 8 | } else if (typeof exports === 'object') { 9 | // Node/CommonJS 10 | factory(require('seriously')); 11 | } else { 12 | if (!root.Seriously) { 13 | root.Seriously = { plugin: function (name, opt) { this[name] = opt; } }; 14 | } 15 | factory(root.Seriously); 16 | } 17 | }(window, function (Seriously) { 18 | 'use strict'; 19 | 20 | Seriously.plugin('freeze', { 21 | draw: function (shader, model, uniforms, frameBuffer, draw) { 22 | if (!this.inputs.frozen) { 23 | draw(shader, model, uniforms, frameBuffer); 24 | } 25 | }, 26 | requires: function () { 27 | return !this.inputs.frozen; 28 | }, 29 | inPlace: true, 30 | inputs: { 31 | source: { 32 | type: 'image', 33 | uniform: 'source' 34 | }, 35 | frozen: { 36 | type: 'boolean', 37 | defaultValue: false, 38 | updateSources: true 39 | } 40 | }, 41 | title: 'Freeze', 42 | description: 'Freeze Frame' 43 | }); 44 | })); 45 | -------------------------------------------------------------------------------- /lib/Seriously.js/effects/seriously.fxaa.js: -------------------------------------------------------------------------------- 1 | /* global define, require */ 2 | (function (root, factory) { 3 | 'use strict'; 4 | 5 | if (typeof define === 'function' && define.amd) { 6 | // AMD. Register as an anonymous module. 7 | define(['seriously'], factory); 8 | } else if (typeof exports === 'object') { 9 | // Node/CommonJS 10 | factory(require('seriously')); 11 | } else { 12 | if (!root.Seriously) { 13 | root.Seriously = { plugin: function (name, opt) { this[name] = opt; } }; 14 | } 15 | factory(root.Seriously); 16 | } 17 | }(window, function (Seriously) { 18 | 'use strict'; 19 | 20 | /* 21 | http://en.wikipedia.org/wiki/Fast_approximate_anti-aliasing 22 | 23 | adapted from: 24 | http://horde3d.org/wiki/index.php5?title=Shading_Technique_-_FXAA 25 | */ 26 | 27 | Seriously.plugin('fxaa', { 28 | commonShader: true, 29 | shader: function (inputs, shaderSource) { 30 | shaderSource.vertex = [ 31 | 'precision mediump float;', 32 | 33 | 'attribute vec4 position;', 34 | 'attribute vec2 texCoord;', 35 | 36 | 'uniform vec2 resolution;', 37 | 'uniform mat4 transform;', 38 | 39 | 'varying vec2 vTexCoord;', 40 | 'varying vec2 vTexCoordNW;', 41 | 'varying vec2 vTexCoordNE;', 42 | 'varying vec2 vTexCoordSW;', 43 | 'varying vec2 vTexCoordSE;', 44 | 45 | 'const vec2 diag = vec2(1.0, -1.0);', 46 | 47 | 'void main(void) {', 48 | // first convert to screen space 49 | ' vec4 screenPosition = vec4(position.xy * resolution / 2.0, position.z, position.w);', 50 | ' screenPosition = transform * screenPosition;', 51 | 52 | // convert back to OpenGL coords 53 | ' gl_Position.xy = screenPosition.xy * 2.0 / resolution;', 54 | ' gl_Position.z = screenPosition.z * 2.0 / (resolution.x / resolution.y);', 55 | ' gl_Position.w = screenPosition.w;', 56 | 57 | ' vTexCoord = texCoord;', 58 | 59 | ' vec2 invRes = 1.0 / resolution;', 60 | ' vTexCoordNW = texCoord - invRes;', 61 | ' vTexCoordNE = texCoord + invRes * diag;', 62 | ' vTexCoordSW = texCoord - invRes * diag;', 63 | ' vTexCoordSE = texCoord + invRes;', 64 | '}\n' 65 | ].join('\n'); 66 | 67 | shaderSource.fragment = [ 68 | 'precision mediump float;', 69 | 70 | '#define FXAA_REDUCE_MIN (1.0 / 128.0)', 71 | '#define FXAA_REDUCE_MUL (1.0 / 8.0)', 72 | '#define FXAA_SPAN_MAX 8.0', 73 | 74 | 'varying vec2 vTexCoord;', 75 | 'varying vec2 vTexCoordNW;', 76 | 'varying vec2 vTexCoordNE;', 77 | 'varying vec2 vTexCoordSW;', 78 | 'varying vec2 vTexCoordSE;', 79 | 80 | 'uniform vec2 resolution;', 81 | 'uniform sampler2D source;', 82 | 83 | 'const vec3 luma = vec3(0.299, 0.587, 0.114);', 84 | 85 | 'void main(void) {', 86 | ' vec4 original = texture2D(source, vTexCoord);', 87 | ' vec3 rgbNW = texture2D(source, vTexCoordNW).rgb;', 88 | ' vec3 rgbNE = texture2D(source, vTexCoordNE).rgb;', 89 | ' vec3 rgbSW = texture2D(source, vTexCoordSW).rgb;', 90 | ' vec3 rgbSE = texture2D(source, vTexCoordSE).rgb;', 91 | 92 | ' float lumaNW = dot(rgbNW, luma);', 93 | ' float lumaNE = dot(rgbNE, luma);', 94 | ' float lumaSW = dot(rgbSW, luma);', 95 | ' float lumaSE = dot(rgbSE, luma);', 96 | ' float lumaM = dot(original.rgb, luma);', 97 | 98 | ' float lumaMin = min(lumaM, min(min(lumaNW, lumaNE), min(lumaSW, lumaSE)));', 99 | ' float lumaMax = max(lumaM, max(max(lumaNW, lumaNE), max(lumaSW, lumaSE)));', 100 | 101 | ' vec2 dir = vec2(' + 102 | '-((lumaNW + lumaNE) - (lumaSW + lumaSE)), ' + 103 | '((lumaNW + lumaSW) - (lumaNE + lumaSE))' + 104 | ');', 105 | 106 | ' float dirReduce = max((lumaNW + lumaNE + lumaSW + lumaSE) * 0.25 * FXAA_REDUCE_MUL, FXAA_REDUCE_MIN);', 107 | 108 | ' float rcpDirMin = 1.0 / (min(abs(dir.x), abs(dir.y)) + dirReduce);', 109 | 110 | ' dir = min(vec2(FXAA_SPAN_MAX), max(vec2(-FXAA_SPAN_MAX), dir * rcpDirMin)) / resolution;', 111 | 112 | ' vec3 rgbA = 0.5 * (', 113 | ' texture2D(source, vTexCoord + dir * (1.0 / 3.0 - 0.5)).rgb +', 114 | ' texture2D(source, vTexCoord + dir * (2.0 / 3.0 - 0.5)).rgb);', 115 | 116 | ' vec3 rgbB = rgbA * 0.5 + 0.25 * (', 117 | ' texture2D(source, vTexCoord - dir * 0.5).rgb +', 118 | ' texture2D(source, vTexCoord + dir * 0.5).rgb);', 119 | 120 | ' float lumaB = dot(rgbB, luma);', 121 | ' if (lumaB < lumaMin || lumaB > lumaMax) {', 122 | ' gl_FragColor = vec4(rgbA, original.a);', 123 | ' } else {', 124 | ' gl_FragColor = vec4(rgbB, original.a);', 125 | ' }', 126 | '}' 127 | ].join('\n'); 128 | 129 | return shaderSource; 130 | }, 131 | inPlace: true, 132 | inputs: { 133 | source: { 134 | type: 'image', 135 | uniform: 'source', 136 | shaderDirty: false 137 | } 138 | }, 139 | title: 'FXAA', 140 | description: 'Fast approximate anti-aliasing' 141 | }); 142 | })); 143 | -------------------------------------------------------------------------------- /lib/Seriously.js/effects/seriously.hex.js: -------------------------------------------------------------------------------- 1 | /* global define, require */ 2 | (function (root, factory) { 3 | 'use strict'; 4 | 5 | if (typeof define === 'function' && define.amd) { 6 | // AMD. Register as an anonymous module. 7 | define(['seriously'], factory); 8 | } else if (typeof exports === 'object') { 9 | // Node/CommonJS 10 | factory(require('seriously')); 11 | } else { 12 | if (!root.Seriously) { 13 | root.Seriously = { plugin: function (name, opt) { this[name] = opt; } }; 14 | } 15 | factory(root.Seriously); 16 | } 17 | }(window, function (Seriously) { 18 | 'use strict'; 19 | 20 | /* 21 | 22 | Shader adapted from glfx.js by Evan Wallace 23 | License: https://github.com/evanw/glfx.js/blob/master/LICENSE 24 | */ 25 | 26 | Seriously.plugin('hex', { 27 | commonShader: true, 28 | shader: function (inputs, shaderSource) { 29 | shaderSource.fragment = [ 30 | 'precision mediump float;\n', 31 | 32 | 'varying vec2 vTexCoord;', 33 | 34 | 'uniform sampler2D source;', 35 | 'uniform vec2 resolution;', 36 | 'uniform vec2 center;', 37 | 'uniform float size;', 38 | 39 | 'void main(void) {', 40 | ' vec2 aspect = normalize(resolution);', 41 | ' vec2 tex = (vTexCoord * aspect - center) / size;', 42 | ' tex.y /= 0.866025404;', 43 | ' tex.x -= tex.y * 0.5;', 44 | ' vec2 a;', 45 | ' if (tex.x + tex.y - floor(tex.x) - floor(tex.y) < 1.0) {', 46 | ' a = vec2(floor(tex.x), floor(tex.y));', 47 | ' } else {', 48 | ' a = vec2(ceil(tex.x), ceil(tex.y));', 49 | ' }', 50 | ' vec2 b = vec2(ceil(tex.x), floor(tex.y));', 51 | ' vec2 c = vec2(floor(tex.x), ceil(tex.y));', 52 | ' vec3 tex3 = vec3(tex.x, tex.y, 1.0 - tex.x - tex.y);', 53 | ' vec3 a3 = vec3(a.x, a.y, 1.0 - a.x - a.y);', 54 | ' vec3 b3 = vec3(b.x, b.y, 1.0 - b.x - b.y);', 55 | ' vec3 c3 = vec3(c.x, c.y, 1.0 - c.x - c.y);', 56 | ' float alen =length(tex3 - a3);', 57 | ' float blen =length(tex3 - b3);', 58 | ' float clen =length(tex3 - c3);', 59 | ' vec2 choice;', 60 | ' if (alen < blen) {', 61 | ' if (alen < clen) {', 62 | ' choice = a;', 63 | ' } else {', 64 | ' choice = c;', 65 | ' }', 66 | ' } else {', 67 | ' if (blen < clen) {', 68 | ' choice = b;', 69 | ' } else {', 70 | ' choice = c;', 71 | ' }', 72 | ' }', 73 | ' choice.x += choice.y * 0.5;', 74 | ' choice.y *= 0.866025404;', 75 | ' choice *= size / aspect;', 76 | ' gl_FragColor = texture2D(source, choice + center / aspect);', 77 | '}' 78 | ].join('\n'); 79 | return shaderSource; 80 | }, 81 | inPlace: false, 82 | inputs: { 83 | source: { 84 | type: 'image', 85 | uniform: 'source', 86 | shaderDirty: false 87 | }, 88 | size: { 89 | type: 'number', 90 | uniform: 'size', 91 | min: 0, 92 | max: 0.4, 93 | defaultValue: 0.01 94 | }, 95 | center: { 96 | type: 'vector', 97 | uniform: 'center', 98 | dimensions: 2, 99 | defaultValue: [0, 0] 100 | } 101 | }, 102 | title: 'Hex', 103 | description: 'Hexagonal Pixelate' 104 | }); 105 | })); 106 | -------------------------------------------------------------------------------- /lib/Seriously.js/effects/seriously.highlights-shadows.js: -------------------------------------------------------------------------------- 1 | /* global define, require */ 2 | (function (root, factory) { 3 | 'use strict'; 4 | 5 | if (typeof define === 'function' && define.amd) { 6 | // AMD. Register as an anonymous module. 7 | define(['seriously'], factory); 8 | } else if (typeof exports === 'object') { 9 | // Node/CommonJS 10 | factory(require('seriously')); 11 | } else { 12 | if (!root.Seriously) { 13 | root.Seriously = { plugin: function (name, opt) { this[name] = opt; } }; 14 | } 15 | factory(root.Seriously); 16 | } 17 | }(window, function (Seriously) { 18 | 'use strict'; 19 | 20 | Seriously.plugin('highlights-shadows', { 21 | commonShader: true, 22 | shader: function (inputs, shaderSource) { 23 | shaderSource.fragment = [ 24 | 'precision mediump float;', 25 | 26 | 'varying vec2 vTexCoord;', 27 | 28 | 'uniform sampler2D source;', 29 | 'uniform float shadows;', 30 | 'uniform float highlights;', 31 | 32 | 'const vec3 luma = vec3(0.2125, 0.7154, 0.0721);', 33 | 34 | 'void main(void) {', 35 | ' vec4 pixel = texture2D(source, vTexCoord);', 36 | ' float luminance = dot(pixel.rgb, luma);', 37 | ' float shadow = clamp((pow(luminance, 1.0 / (shadows + 1.0)) + (-0.76) * pow(luminance, 2.0 / (shadows + 1.0))) - luminance, 0.0, 1.0);', 38 | ' float highlight = clamp((1.0 - (pow(1.0 - luminance, 1.0 / (2.0 - highlights)) + (-0.8) * pow(1.0 - luminance, 2.0 / (2.0 - highlights)))) - luminance, -1.0, 0.0);', 39 | ' vec3 rgb = (luminance + shadow + highlight) * (pixel.rgb / vec3(luminance));', 40 | //' vec3 rgb = vec3(0.0, 0.0, 0.0) + ((luminance + shadow + highlight) - 0.0) * ((pixel.rgb - vec3(0.0, 0.0, 0.0))/(luminance - 0.0));', 41 | ' gl_FragColor = vec4(rgb, pixel.a);', 42 | '}' 43 | ].join('\n'); 44 | return shaderSource; 45 | }, 46 | inPlace: true, 47 | inputs: { 48 | source: { 49 | type: 'image', 50 | uniform: 'source', 51 | shaderDirty: false 52 | }, 53 | highlights: { 54 | type: 'number', 55 | uniform: 'highlights', 56 | min: 0, 57 | max: 1, 58 | defaultValue: 1 59 | }, 60 | shadows: { 61 | type: 'number', 62 | uniform: 'shadows', 63 | min: 0, 64 | max: 1, 65 | defaultValue: 0 66 | } 67 | }, 68 | title: 'Highlights/Shadows', 69 | description: 'Darken highlights, lighten shadows' 70 | }); 71 | })); 72 | -------------------------------------------------------------------------------- /lib/Seriously.js/effects/seriously.hue-saturation.js: -------------------------------------------------------------------------------- 1 | /* global define, require */ 2 | (function (root, factory) { 3 | 'use strict'; 4 | 5 | if (typeof define === 'function' && define.amd) { 6 | // AMD. Register as an anonymous module. 7 | define(['seriously'], factory); 8 | } else if (typeof exports === 'object') { 9 | // Node/CommonJS 10 | factory(require('seriously')); 11 | } else { 12 | if (!root.Seriously) { 13 | root.Seriously = { plugin: function (name, opt) { this[name] = opt; } }; 14 | } 15 | factory(root.Seriously); 16 | } 17 | }(window, function (Seriously) { 18 | 'use strict'; 19 | 20 | //inspired by Evan Wallace (https://github.com/evanw/glfx.js) 21 | 22 | Seriously.plugin('hue-saturation', { 23 | commonShader: true, 24 | shader: function (inputs, shaderSource) { 25 | shaderSource.vertex = [ 26 | 'precision mediump float;', 27 | 28 | 'attribute vec4 position;', 29 | 'attribute vec2 texCoord;', 30 | 31 | 'uniform vec2 resolution;', 32 | 'uniform mat4 projection;', 33 | 'uniform mat4 transform;', 34 | 35 | 'uniform float hue;', 36 | 'uniform float saturation;', 37 | 38 | 'varying vec2 vTexCoord;', 39 | 40 | 'varying vec3 weights;', 41 | 42 | 'void main(void) {', 43 | ' float angle = hue * 3.14159265358979323846264;', 44 | ' float s = sin(angle);', 45 | ' float c = cos(angle);', 46 | ' weights = (vec3(2.0 * c, -sqrt(3.0) * s - c, sqrt(3.0) * s - c) + 1.0) / 3.0;', 47 | 48 | // first convert to screen space 49 | ' vec4 screenPosition = vec4(position.xy * resolution / 2.0, position.z, position.w);', 50 | ' screenPosition = transform * screenPosition;', 51 | 52 | // convert back to OpenGL coords 53 | ' gl_Position = screenPosition;', 54 | ' gl_Position.xy = screenPosition.xy * 2.0 / resolution;', 55 | ' gl_Position.z = screenPosition.z * 2.0 / (resolution.x / resolution.y);', 56 | ' vTexCoord = texCoord;', 57 | '}' 58 | ].join('\n'); 59 | shaderSource.fragment = [ 60 | 'precision mediump float;', 61 | 62 | 'varying vec2 vTexCoord;', 63 | 64 | 'varying vec3 weights;', 65 | 66 | 'uniform sampler2D source;', 67 | 'uniform float hue;', 68 | 'uniform float saturation;', 69 | 70 | 'void main(void) {', 71 | ' vec4 color = texture2D(source, vTexCoord);', 72 | 73 | //adjust hue 74 | ' float len = length(color.rgb);', 75 | ' color.rgb = vec3(' + 76 | 'dot(color.rgb, weights.xyz), ' + 77 | 'dot(color.rgb, weights.zxy), ' + 78 | 'dot(color.rgb, weights.yzx) ' + 79 | ');', 80 | 81 | //adjust saturation 82 | ' vec3 adjustment = (color.r + color.g + color.b) / 3.0 - color.rgb;', 83 | ' if (saturation > 0.0) {', 84 | ' adjustment *= (1.0 - 1.0 / (1.0 - saturation));', 85 | ' } else {', 86 | ' adjustment *= (-saturation);', 87 | ' }', 88 | ' color.rgb += adjustment;', 89 | 90 | ' gl_FragColor = color;', 91 | '}' 92 | ].join('\n'); 93 | return shaderSource; 94 | }, 95 | inPlace: true, 96 | inputs: { 97 | source: { 98 | type: 'image', 99 | uniform: 'source' 100 | }, 101 | hue: { 102 | type: 'number', 103 | uniform: 'hue', 104 | defaultValue: 0.4, 105 | min: -1, 106 | max: 1 107 | }, 108 | saturation: { 109 | type: 'number', 110 | uniform: 'saturation', 111 | defaultValue: 0, 112 | min: -1, 113 | max: 1 114 | } 115 | }, 116 | title: 'Hue/Saturation', 117 | description: 'Rotate hue and multiply saturation.' 118 | }); 119 | })); 120 | -------------------------------------------------------------------------------- /lib/Seriously.js/effects/seriously.invert.js: -------------------------------------------------------------------------------- 1 | /* global define, require */ 2 | (function (root, factory) { 3 | 'use strict'; 4 | 5 | if (typeof define === 'function' && define.amd) { 6 | // AMD. Register as an anonymous module. 7 | define(['seriously'], factory); 8 | } else if (typeof exports === 'object') { 9 | // Node/CommonJS 10 | factory(require('seriously')); 11 | } else { 12 | if (!root.Seriously) { 13 | root.Seriously = { plugin: function (name, opt) { this[name] = opt; } }; 14 | } 15 | factory(root.Seriously); 16 | } 17 | }(window, function (Seriously) { 18 | 'use strict'; 19 | 20 | Seriously.plugin('invert', { 21 | commonShader: true, 22 | shader: function (inputs, shaderSource) { 23 | shaderSource.fragment = [ 24 | 'precision mediump float;', 25 | 26 | 'varying vec2 vTexCoord;', 27 | 28 | 'uniform sampler2D source;', 29 | 30 | 'void main(void) {', 31 | ' gl_FragColor = texture2D(source, vTexCoord);', 32 | ' gl_FragColor = vec4(1.0 - gl_FragColor.rgb, gl_FragColor.a);', 33 | '}' 34 | ].join('\n'); 35 | return shaderSource; 36 | }, 37 | inPlace: true, 38 | inputs: { 39 | source: { 40 | type: 'image', 41 | uniform: 'source', 42 | shaderDirty: false 43 | } 44 | }, 45 | title: 'Invert', 46 | description: 'Invert image color' 47 | }); 48 | })); 49 | -------------------------------------------------------------------------------- /lib/Seriously.js/effects/seriously.kaleidoscope.js: -------------------------------------------------------------------------------- 1 | /* global define, require */ 2 | (function (root, factory) { 3 | 'use strict'; 4 | 5 | if (typeof define === 'function' && define.amd) { 6 | // AMD. Register as an anonymous module. 7 | define(['seriously'], factory); 8 | } else if (typeof exports === 'object') { 9 | // Node/CommonJS 10 | factory(require('seriously')); 11 | } else { 12 | if (!root.Seriously) { 13 | root.Seriously = { plugin: function (name, opt) { this[name] = opt; } }; 14 | } 15 | factory(root.Seriously); 16 | } 17 | }(window, function (Seriously) { 18 | 'use strict'; 19 | 20 | Seriously.plugin('kaleidoscope', { 21 | commonShader: true, 22 | shader: function (inputs, shaderSource) { 23 | shaderSource.fragment = [ 24 | 'precision mediump float;', 25 | 26 | 'varying vec2 vTexCoord;', 27 | 28 | 'uniform sampler2D source;', 29 | 'uniform float segments;', 30 | 'uniform float offset;', 31 | 32 | 'const float PI = ' + Math.PI + ';', 33 | 'const float TAU = 2.0 * PI;', 34 | 35 | 'void main(void) {', 36 | ' if (segments == 0.0) {', 37 | ' gl_FragColor = texture2D(source, vTexCoord);', 38 | ' } else {', 39 | ' vec2 centered = vTexCoord - 0.5;', 40 | 41 | //to polar 42 | ' float r = length(centered);', 43 | ' float theta = atan(centered.y, centered.x);', 44 | ' theta = mod(theta, TAU / segments);', 45 | ' theta = abs(theta - PI / segments);', 46 | 47 | //back to cartesian 48 | ' vec2 newCoords = r * vec2(cos(theta), sin(theta)) + 0.5;', 49 | ' gl_FragColor = texture2D(source, mod(newCoords - offset, 1.0));', 50 | ' }', 51 | '}' 52 | ].join('\n'); 53 | return shaderSource; 54 | }, 55 | inPlace: true, 56 | inputs: { 57 | source: { 58 | type: 'image', 59 | uniform: 'source', 60 | shaderDirty: false 61 | }, 62 | segments: { 63 | type: 'number', 64 | uniform: 'segments', 65 | defaultValue: 6 66 | }, 67 | offset: { 68 | type: 'number', 69 | uniform: 'offset', 70 | defaultValue: 0 71 | } 72 | }, 73 | title: 'Kaleidoscope' 74 | }); 75 | })); 76 | -------------------------------------------------------------------------------- /lib/Seriously.js/effects/seriously.linear-transfer.js: -------------------------------------------------------------------------------- 1 | /* global define, require */ 2 | (function (root, factory) { 3 | 'use strict'; 4 | 5 | if (typeof define === 'function' && define.amd) { 6 | // AMD. Register as an anonymous module. 7 | define(['seriously'], factory); 8 | } else if (typeof exports === 'object') { 9 | // Node/CommonJS 10 | factory(require('seriously')); 11 | } else { 12 | if (!root.Seriously) { 13 | root.Seriously = { plugin: function (name, opt) { this[name] = opt; } }; 14 | } 15 | factory(root.Seriously); 16 | } 17 | }(window, function (Seriously) { 18 | 'use strict'; 19 | 20 | Seriously.plugin('linear-transfer', { 21 | commonShader: true, 22 | shader: function (inputs, shaderSource) { 23 | shaderSource.fragment = [ 24 | 'precision mediump float;', 25 | 26 | 'varying vec2 vTexCoord;', 27 | 28 | 'uniform sampler2D source;', 29 | 'uniform vec4 slope;', 30 | 'uniform vec4 intercept;', 31 | 32 | 'const vec3 half3 = vec3(0.5);', 33 | 34 | 'void main(void) {', 35 | ' vec4 pixel = texture2D(source, vTexCoord);', 36 | ' gl_FragColor = pixel * slope + intercept;', 37 | '}' 38 | ].join('\n'); 39 | return shaderSource; 40 | }, 41 | inPlace: true, 42 | inputs: { 43 | source: { 44 | type: 'image', 45 | uniform: 'source' 46 | }, 47 | slope: { 48 | type: 'vector', 49 | dimensions: 4, 50 | uniform: 'slope', 51 | defaultValue: [1, 1, 1, 1] 52 | }, 53 | intercept: { 54 | type: 'vector', 55 | uniform: 'intercept', 56 | dimensions: 4, 57 | defaultValue: [0, 0, 0, 0] 58 | } 59 | }, 60 | title: 'Linear Transfer', 61 | description: 'For each color channel: [slope] * [value] + [intercept]' 62 | }); 63 | })); 64 | -------------------------------------------------------------------------------- /lib/Seriously.js/effects/seriously.lumakey.js: -------------------------------------------------------------------------------- 1 | /* global define, require */ 2 | (function (root, factory) { 3 | 'use strict'; 4 | 5 | if (typeof define === 'function' && define.amd) { 6 | // AMD. Register as an anonymous module. 7 | define(['seriously'], factory); 8 | } else if (typeof exports === 'object') { 9 | // Node/CommonJS 10 | factory(require('seriously')); 11 | } else { 12 | if (!root.Seriously) { 13 | root.Seriously = { plugin: function (name, opt) { this[name] = opt; } }; 14 | } 15 | factory(root.Seriously); 16 | } 17 | }(window, function (Seriously) { 18 | 'use strict'; 19 | 20 | Seriously.plugin('lumakey', { 21 | commonShader: true, 22 | shader: function (inputs, shaderSource) { 23 | shaderSource.fragment = [ 24 | 'precision mediump float;', 25 | 26 | 'varying vec2 vTexCoord;', 27 | 28 | 'uniform sampler2D source;', 29 | 30 | 'uniform float threshold;', 31 | 'uniform float clipBlack;', 32 | 'uniform float clipWhite;', 33 | 'uniform bool invert;', 34 | 35 | 'const vec3 lumcoeff = vec3(0.2125,0.7154,0.0721);', 36 | 37 | 'void main (void) {', 38 | ' vec4 pixel = texture2D(source, vTexCoord);', 39 | ' float luma = dot(pixel.rgb,lumcoeff);', 40 | ' float alpha = 1.0 - smoothstep(clipBlack, clipWhite, luma);', 41 | ' if (invert) alpha = 1.0 - alpha;', 42 | ' gl_FragColor = vec4(pixel.rgb, min(pixel.a, alpha) );', 43 | '}' 44 | ].join('\n'); 45 | return shaderSource; 46 | }, 47 | inPlace: true, 48 | inputs: { 49 | source: { 50 | type: 'image', 51 | uniform: 'source', 52 | shaderDirty: false 53 | }, 54 | clipBlack: { 55 | type: 'number', 56 | uniform: 'clipBlack', 57 | defaultValue: 0.9, 58 | min: 0, 59 | max: 1 60 | }, 61 | clipWhite: { 62 | type: 'number', 63 | uniform: 'clipWhite', 64 | defaultValue: 1, 65 | min: 0, 66 | max: 1 67 | }, 68 | invert: { 69 | type: 'boolean', 70 | uniform: 'invert', 71 | defaultValue: false 72 | } 73 | }, 74 | title: 'Luma Key', 75 | categories: ['key'], 76 | description: '' 77 | }); 78 | })); 79 | -------------------------------------------------------------------------------- /lib/Seriously.js/effects/seriously.lut.js: -------------------------------------------------------------------------------- 1 | /* global define, require */ 2 | (function (root, factory) { 3 | 'use strict'; 4 | 5 | if (typeof define === 'function' && define.amd) { 6 | // AMD. Register as an anonymous module. 7 | define(['seriously'], factory); 8 | } else if (typeof exports === 'object') { 9 | // Node/CommonJS 10 | factory(require('seriously')); 11 | } else { 12 | if (!root.Seriously) { 13 | root.Seriously = { plugin: function (name, opt) { this[name] = opt; } }; 14 | } 15 | factory(root.Seriously); 16 | } 17 | }(window, function (Seriously) { 18 | 'use strict'; 19 | 20 | Seriously.plugin('lut', { 21 | commonShader: true, 22 | shader: function (inputs, shaderSource) { 23 | /* 24 | Shader borrowed from Paul Golds @ BBC R&D, with permission 25 | */ 26 | shaderSource.fragment = [ 27 | 'precision mediump float;', 28 | 29 | 'varying vec2 vTexCoord;', 30 | 31 | 'uniform sampler2D source;', 32 | 'uniform sampler2D lut;', 33 | 'uniform float amount;', 34 | 35 | 'void main(void) {', 36 | 37 | ' vec4 textureColor = texture2D(source, vTexCoord);', 38 | ' textureColor = clamp(textureColor, 0.0, 1.0);', 39 | 40 | ' float blueColor = textureColor.b * 63.0;', 41 | 42 | ' vec2 quad1;', 43 | ' quad1.y = floor(floor(blueColor) / 8.0);', 44 | ' quad1.x = floor(blueColor) - (quad1.y * 8.0);', 45 | 46 | ' vec2 quad2;', 47 | ' quad2.y = floor(ceil(blueColor) / 8.0);', 48 | ' quad2.x = ceil(blueColor) - (quad2.y * 8.0);', 49 | 50 | ' vec2 texPos1;', 51 | ' texPos1 = (quad1 * 0.125) + 0.5/512.0 + ((0.125 - 1.0/512.0) * textureColor.rg);', 52 | 53 | ' vec2 texPos2;', 54 | ' texPos2 = (quad2 * 0.125) + 0.5/512.0 + ((0.125 - 1.0/512.0) * textureColor.rg);', 55 | 56 | ' lowp vec4 newColor1 = texture2D(lut, vec2(texPos1.x, 1.0 - texPos1.y));', 57 | ' lowp vec4 newColor2 = texture2D(lut, vec2(texPos2.x, 1.0 - texPos2.y));', 58 | 59 | ' vec4 newColor = mix(newColor1, newColor2, fract(blueColor));', 60 | 61 | ' gl_FragColor = mix(textureColor, newColor, amount);', 62 | '}' 63 | ].join('\n'); 64 | return shaderSource; 65 | }, 66 | inPlace: true, 67 | inputs: { 68 | source: { 69 | type: 'image', 70 | uniform: 'source' 71 | }, 72 | lut: { 73 | type: 'image', 74 | uniform: 'lut' 75 | }, 76 | amount: { 77 | type: 'number', 78 | uniform: 'amount', 79 | min: 0, 80 | max: 1, 81 | defaultValue: 1 82 | } 83 | }, 84 | title: 'Color Look-Up Table', 85 | description: '' 86 | }); 87 | })); 88 | -------------------------------------------------------------------------------- /lib/Seriously.js/effects/seriously.mirror.js: -------------------------------------------------------------------------------- 1 | /* global define, require */ 2 | (function (root, factory) { 3 | 'use strict'; 4 | 5 | if (typeof define === 'function' && define.amd) { 6 | // AMD. Register as an anonymous module. 7 | define(['seriously'], factory); 8 | } else if (typeof exports === 'object') { 9 | // Node/CommonJS 10 | factory(require('seriously')); 11 | } else { 12 | if (!root.Seriously) { 13 | root.Seriously = { plugin: function (name, opt) { this[name] = opt; } }; 14 | } 15 | factory(root.Seriously); 16 | } 17 | }(window, function (Seriously) { 18 | 'use strict'; 19 | 20 | Seriously.plugin('mirror', { 21 | commonShader: true, 22 | shader: function (inputs, shaderSource) { 23 | shaderSource.fragment = [ 24 | 'precision mediump float;', 25 | 26 | 'uniform vec2 resolution;', 27 | 'uniform sampler2D source;', 28 | 29 | 'varying vec2 vTexCoord;', 30 | 31 | 'void main(void) {', 32 | ' gl_FragColor = texture2D(source, vec2(0.5 - abs(0.5 - vTexCoord.x), vTexCoord.y));', 33 | '}' 34 | ].join('\n'); 35 | return shaderSource; 36 | }, 37 | inPlace: true, 38 | inputs: { 39 | source: { 40 | type: 'image', 41 | uniform: 'source' 42 | } 43 | }, 44 | title: 'Mirror', 45 | description: 'Shader Mirror Effect' 46 | }); 47 | })); 48 | -------------------------------------------------------------------------------- /lib/Seriously.js/effects/seriously.nightvision.js: -------------------------------------------------------------------------------- 1 | /* global define, require */ 2 | (function (root, factory) { 3 | 'use strict'; 4 | 5 | if (typeof define === 'function' && define.amd) { 6 | // AMD. Register as an anonymous module. 7 | define(['seriously'], factory); 8 | } else if (typeof exports === 'object') { 9 | // Node/CommonJS 10 | factory(require('seriously')); 11 | } else { 12 | if (!root.Seriously) { 13 | root.Seriously = { plugin: function (name, opt) { this[name] = opt; } }; 14 | } 15 | factory(root.Seriously); 16 | } 17 | }(window, function (Seriously) { 18 | 'use strict'; 19 | 20 | //based on tutorial: http://www.geeks3d.com/20091009/shader-library-night-vision-post-processing-filter-glsl/ 21 | //todo: make noise better? 22 | 23 | Seriously.plugin('nightvision', { 24 | commonShader: true, 25 | shader: function (inputs, shaderSource, utilities) { 26 | shaderSource.fragment = [ 27 | 'precision mediump float;', 28 | 29 | 'varying vec2 vTexCoord;', 30 | 31 | 'uniform sampler2D source;', 32 | 'uniform float time;', 33 | 'uniform float luminanceThreshold;', 34 | 'uniform float amplification;', 35 | 'uniform vec3 nightVisionColor;', 36 | 37 | utilities.shader.makeNoise, 38 | 39 | 'void main(void) {', 40 | ' vec3 noise = vec3(' + 41 | 'makeNoise(vTexCoord.x, vTexCoord.y, time), ' + 42 | 'makeNoise(vTexCoord.x, vTexCoord.y, time * 200.0 + 1.0), ' + 43 | 'makeNoise(vTexCoord.x, vTexCoord.y, time * 100.0 + 3.0)' + 44 | ');', 45 | ' vec4 pixel = texture2D(source, vTexCoord + noise.xy * 0.0025);', 46 | ' float luminance = dot(vec3(0.299, 0.587, 0.114), pixel.rgb);', 47 | ' pixel.rgb *= step(luminanceThreshold, luminance) * amplification;', 48 | ' gl_FragColor = vec4( (pixel.rgb + noise * 0.1) * nightVisionColor, pixel.a);', 49 | '}' 50 | ].join('\n'); 51 | return shaderSource; 52 | }, 53 | inputs: { 54 | source: { 55 | type: 'image', 56 | uniform: 'source', 57 | shaderDirty: false 58 | }, 59 | time: { 60 | type: 'number', 61 | uniform: 'time', 62 | defaultValue: 0 63 | }, 64 | luminanceThreshold: { 65 | type: 'number', 66 | uniform: 'luminanceThreshold', 67 | defaultValue: 0.1, 68 | min: 0, 69 | max: 1 70 | }, 71 | amplification: { 72 | type: 'number', 73 | uniform: 'amplification', 74 | defaultValue: 1.4, 75 | min: 0 76 | }, 77 | color: { 78 | type: 'color', 79 | uniform: 'nightVisionColor', 80 | defaultValue: [0.1, 0.95, 0.2] 81 | } 82 | }, 83 | title: 'Night Vision', 84 | description: '' 85 | }); 86 | })); 87 | -------------------------------------------------------------------------------- /lib/Seriously.js/effects/seriously.noise.js: -------------------------------------------------------------------------------- 1 | /* global define, require */ 2 | (function (root, factory) { 3 | 'use strict'; 4 | 5 | if (typeof define === 'function' && define.amd) { 6 | // AMD. Register as an anonymous module. 7 | define(['seriously'], factory); 8 | } else if (typeof exports === 'object') { 9 | // Node/CommonJS 10 | factory(require('seriously')); 11 | } else { 12 | if (!root.Seriously) { 13 | root.Seriously = { plugin: function (name, opt) { this[name] = opt; } }; 14 | } 15 | factory(root.Seriously); 16 | } 17 | }(window, function (Seriously) { 18 | 'use strict'; 19 | 20 | Seriously.plugin('noise', { 21 | shader: function (inputs, shaderSource, utilities) { 22 | var frag = [ 23 | 'precision mediump float;', 24 | 25 | '#define Blend(base, blend, funcf) vec3(funcf(base.r, blend.r), funcf(base.g, blend.g), funcf(base.b, blend.b))', 26 | '#define BlendOverlayf(base, blend) (base < 0.5 ? (2.0 * base * blend) : (1.0 - 2.0 * (1.0 - base) * (1.0 - blend)))', 27 | '#define BlendOverlay(base, blend) Blend(base, blend, BlendOverlayf)', 28 | 'varying vec2 vTexCoord;', 29 | 30 | 'uniform sampler2D source;', 31 | 32 | 'uniform vec2 resolution;', 33 | 'uniform float amount;', 34 | 'uniform float time;', 35 | 36 | utilities.shader.noiseHelpers, 37 | utilities.shader.snoise3d, 38 | utilities.shader.random, 39 | 40 | 'void main(void) {', 41 | ' vec4 pixel = texture2D(source, vTexCoord);', 42 | ' float r = random(vec2(time * vTexCoord.xy));', 43 | ' float noise = snoise(vec3(vTexCoord * (1024.4 + r * 512.0), time)) * 0.5;' 44 | ]; 45 | 46 | if (inputs.overlay) { 47 | frag.push(' vec3 overlay = BlendOverlay(pixel.rgb, vec3(noise));'); 48 | frag.push(' pixel.rgb = mix(pixel.rgb, overlay, amount);'); 49 | } else { 50 | frag.push(' pixel.rgb += noise * amount;'); 51 | } 52 | frag.push(' gl_FragColor = pixel;}'); 53 | 54 | shaderSource.fragment = frag.join('\n'); 55 | return shaderSource; 56 | }, 57 | inPlace: true, 58 | inputs: { 59 | source: { 60 | type: 'image', 61 | uniform: 'source', 62 | shaderDirty: false 63 | }, 64 | overlay: { 65 | type: 'boolean', 66 | shaderDirty: true, 67 | defaultValue: true 68 | }, 69 | amount: { 70 | type: 'number', 71 | uniform: 'amount', 72 | min: 0, 73 | max: 1, 74 | defaultValue: 1 75 | }, 76 | time: { 77 | type: 'number', 78 | uniform: 'time', 79 | defaultValue: 0, 80 | step: 1 81 | } 82 | }, 83 | title: 'Noise', 84 | description: 'Add noise' 85 | }); 86 | })); 87 | -------------------------------------------------------------------------------- /lib/Seriously.js/effects/seriously.panorama.js: -------------------------------------------------------------------------------- 1 | /* global define, require */ 2 | (function (root, factory) { 3 | 'use strict'; 4 | 5 | if (typeof define === 'function' && define.amd) { 6 | // AMD. Register as an anonymous module. 7 | define(['seriously'], factory); 8 | } else if (typeof exports === 'object') { 9 | // Node/CommonJS 10 | factory(require('seriously')); 11 | } else { 12 | if (!root.Seriously) { 13 | root.Seriously = { plugin: function (name, opt) { this[name] = opt; } }; 14 | } 15 | factory(root.Seriously); 16 | } 17 | }(window, function (Seriously) { 18 | 'use strict'; 19 | 20 | Seriously.plugin('panorama', function () { 21 | var me = this; 22 | 23 | function resize() { 24 | me.resize(); 25 | } 26 | 27 | // custom resize method 28 | this.resize = function () { 29 | var width = this.width, 30 | height = this.height, 31 | source = me.inputs.source, 32 | i; 33 | 34 | if (this.source) { 35 | width = this.source.width; 36 | height = this.source.height; 37 | } else if (this.sources && this.sources.source) { 38 | width = this.sources.source.width; 39 | height = this.sources.source.height; 40 | } else { 41 | width = 1; 42 | height = 1; 43 | } 44 | 45 | if (me.inputs.width) { 46 | width = me.inputs.width; 47 | if (me.inputs.height) { 48 | height = me.inputs.height; 49 | } else if (source) { 50 | //match source aspect ratio 51 | height = width * source.height / source.width; 52 | } 53 | } else if (me.inputs.height) { 54 | height = me.inputs.height; 55 | if (source) { 56 | //match source aspect ratio 57 | width = height * source.width / source.height; 58 | } 59 | } 60 | 61 | width = Math.floor(width); 62 | height = Math.floor(height); 63 | 64 | if (source) { 65 | this.uniforms.resolution[0] = width; 66 | this.uniforms.resolution[1] = height; 67 | } 68 | 69 | if (this.width !== width || this.height !== height) { 70 | this.width = width; 71 | this.height = height; 72 | 73 | if (this.frameBuffer) { 74 | this.frameBuffer.resize(this.width, this.height); 75 | } 76 | 77 | this.emit('resize'); 78 | this.setDirty(); 79 | } 80 | 81 | for (i = 0; i < this.targets.length; i++) { 82 | this.targets[i].resize(); 83 | } 84 | }; 85 | 86 | return { 87 | shader: function (inputs, shaderSource) { 88 | shaderSource.fragment = [ 89 | 'precision mediump float;', 90 | 91 | 'varying vec2 vTexCoord;', 92 | 93 | 'uniform vec2 resolution;', 94 | 'uniform sampler2D source;', 95 | 96 | 'uniform float fov;', 97 | 'uniform float yaw;', 98 | 'uniform float pitch;', 99 | 100 | 'const float M_PI = 3.141592653589793238462643;', 101 | 'const float M_TWOPI = 6.283185307179586476925286;', 102 | 103 | 'mat3 rotationMatrix(vec2 euler) {', 104 | ' vec2 se = sin(euler);', 105 | ' vec2 ce = cos(euler);', 106 | 107 | ' return mat3(ce.x, 0, -se.x, 0, 1, 0, se.x, 0, ce.x) * ', 108 | ' mat3(1, 0, 0, 0, ce.y, -se.y, 0, se.y, ce.y);', 109 | '}', 110 | 111 | 'vec3 toCartesian( vec2 st ) {', 112 | ' return normalize(vec3(st.x, st.y, 0.5 / tan(0.5 * radians(fov))));', 113 | '}', 114 | 115 | 'vec2 toSpherical(vec3 cartesianCoord) {', 116 | ' vec2 st = vec2(', 117 | ' atan(cartesianCoord.x, cartesianCoord.z),', 118 | ' acos(cartesianCoord.y)', 119 | ' );', 120 | ' if(st.x < 0.0)', 121 | ' st.x += M_TWOPI;', 122 | 123 | ' return st;', 124 | '}', 125 | 126 | 'void main(void) {', 127 | ' vec2 sphericalCoord = gl_FragCoord.xy / resolution - vec2(0.5);', 128 | ' sphericalCoord.y *= -resolution.y / resolution.x;', 129 | 130 | ' vec3 cartesianCoord = rotationMatrix(radians(vec2(yaw + 180., -pitch))) * toCartesian(sphericalCoord);', 131 | 132 | ' gl_FragColor = texture2D(source, toSpherical( cartesianCoord )/vec2(M_TWOPI, M_PI));', 133 | '}' 134 | ].join('\n'); 135 | return shaderSource; 136 | }, 137 | inPlace: false, 138 | inputs: { 139 | source: { 140 | type: 'image', 141 | uniform: 'source', 142 | shaderDirty: false 143 | }, 144 | width: { 145 | type: 'number', 146 | min: 0, 147 | step: 1, 148 | update: resize, 149 | defaultValue: 640 150 | }, 151 | height: { 152 | type: 'number', 153 | min: 0, 154 | step: 1, 155 | update: resize, 156 | defaultValue: 360 157 | }, 158 | yaw: { 159 | type: 'number', 160 | uniform: 'yaw', 161 | min: 0, 162 | max: 360, 163 | defaultValue: 0 164 | }, 165 | fov: { 166 | type: 'number', 167 | uniform: 'fov', 168 | min: 0, 169 | max: 180, 170 | defaultValue: 80 171 | }, 172 | pitch: { 173 | type: 'number', 174 | uniform: 'pitch', 175 | min: -90, 176 | max: 90, 177 | defaultValue: 0 178 | } 179 | } 180 | }; 181 | }, { 182 | commonShader: true, 183 | title: 'Panorama' 184 | }); 185 | })); 186 | -------------------------------------------------------------------------------- /lib/Seriously.js/effects/seriously.pixelate.js: -------------------------------------------------------------------------------- 1 | /* global define, require */ 2 | (function (root, factory) { 3 | 'use strict'; 4 | 5 | if (typeof define === 'function' && define.amd) { 6 | // AMD. Register as an anonymous module. 7 | define(['seriously'], factory); 8 | } else if (typeof exports === 'object') { 9 | // Node/CommonJS 10 | factory(require('seriously')); 11 | } else { 12 | if (!root.Seriously) { 13 | root.Seriously = { plugin: function (name, opt) { this[name] = opt; } }; 14 | } 15 | factory(root.Seriously); 16 | } 17 | }(window, function (Seriously) { 18 | 'use strict'; 19 | 20 | Seriously.plugin('pixelate', { 21 | commonShader: true, 22 | shader: function (inputs, shaderSource) { 23 | shaderSource.fragment = [ 24 | 'precision mediump float;', 25 | 26 | 'varying vec2 vTexCoord;', 27 | 28 | 'uniform sampler2D source;', 29 | 'uniform vec2 resolution;', 30 | 'uniform vec2 pixelSize;', 31 | 32 | 'void main(void) {', 33 | ' vec2 delta = pixelSize / resolution;', 34 | ' gl_FragColor = texture2D(source, delta * floor(vTexCoord / delta));', 35 | '}' 36 | ].join('\n'); 37 | return shaderSource; 38 | }, 39 | inPlace: true, 40 | inputs: { 41 | source: { 42 | type: 'image', 43 | uniform: 'source', 44 | shaderDirty: false 45 | }, 46 | pixelSize: { 47 | type: 'vector', 48 | dimensions: 2, 49 | defaultValue: [8, 8], 50 | min: 0, 51 | uniform: 'pixelSize' 52 | } 53 | }, 54 | title: 'Pixelate' 55 | }); 56 | })); 57 | -------------------------------------------------------------------------------- /lib/Seriously.js/effects/seriously.polar.js: -------------------------------------------------------------------------------- 1 | /* global define, require */ 2 | (function (root, factory) { 3 | 'use strict'; 4 | 5 | if (typeof define === 'function' && define.amd) { 6 | // AMD. Register as an anonymous module. 7 | define(['seriously'], factory); 8 | } else if (typeof exports === 'object') { 9 | // Node/CommonJS 10 | factory(require('seriously')); 11 | } else { 12 | if (!root.Seriously) { 13 | root.Seriously = { plugin: function (name, opt) { this[name] = opt; } }; 14 | } 15 | factory(root.Seriously); 16 | } 17 | }(window, function (Seriously) { 18 | 'use strict'; 19 | 20 | Seriously.plugin('polar', { 21 | commonShader: true, 22 | shader: function (inputs, shaderSource) { 23 | shaderSource.fragment = [ 24 | 'precision mediump float;', 25 | 26 | 'varying vec2 vTexCoord;', 27 | 28 | 'uniform sampler2D source;', 29 | 'uniform float angle;', 30 | 31 | 'const float PI = ' + Math.PI + ';', 32 | 33 | 'void main(void) {', 34 | ' vec2 norm = (1.0 - vTexCoord) * 2.0 - 1.0;', 35 | ' float theta = mod(PI + atan(norm.x, norm.y) - angle * (PI / 180.0), PI * 2.0);', 36 | ' vec2 polar = vec2(theta / (2.0 * PI), length(norm));', 37 | ' gl_FragColor = texture2D(source, polar);', 38 | '}' 39 | ].join('\n'); 40 | return shaderSource; 41 | }, 42 | inPlace: false, 43 | inputs: { 44 | source: { 45 | type: 'image', 46 | uniform: 'source', 47 | shaderDirty: false 48 | }, 49 | angle: { 50 | type: 'number', 51 | uniform: 'angle', 52 | defaultValue: 0 53 | } 54 | }, 55 | title: 'Polar Coordinates', 56 | description: 'Convert cartesian to polar coordinates' 57 | }); 58 | })); 59 | -------------------------------------------------------------------------------- /lib/Seriously.js/effects/seriously.ripple.js: -------------------------------------------------------------------------------- 1 | /* global define, require */ 2 | (function (root, factory) { 3 | 'use strict'; 4 | 5 | if (typeof define === 'function' && define.amd) { 6 | // AMD. Register as an anonymous module. 7 | define(['seriously'], factory); 8 | } else if (typeof exports === 'object') { 9 | // Node/CommonJS 10 | factory(require('seriously')); 11 | } else { 12 | if (!root.Seriously) { 13 | root.Seriously = { plugin: function (name, opt) { this[name] = opt; } }; 14 | } 15 | factory(root.Seriously); 16 | } 17 | }(window, function (Seriously) { 18 | 'use strict'; 19 | 20 | //http://msdn.microsoft.com/en-us/library/bb313868(v=xnagamestudio.10).aspx 21 | Seriously.plugin('ripple', { 22 | commonShader: true, 23 | shader: function (inputs, shaderSource) { 24 | shaderSource.fragment = [ 25 | 'precision mediump float;', 26 | 27 | 'varying vec2 vTexCoord;', 28 | 29 | 'uniform sampler2D source;', 30 | 'uniform float wave;', 31 | 'uniform float distortion;', 32 | 'uniform vec2 center;', 33 | 34 | 'void main(void) {', 35 | //todo: can at least move scalar into vertex shader 36 | ' float scalar = abs(1.0 - abs(distance(vTexCoord, center)));', 37 | ' float sinOffset = sin(wave / scalar);', 38 | ' sinOffset = clamp(sinOffset, 0.0, 1.0);', 39 | ' float sinSign = cos(wave / scalar);', 40 | ' sinOffset = sinOffset * distortion / 32.0;', 41 | ' gl_FragColor = texture2D(source, vTexCoord + sinOffset * sinSign);', 42 | '}' 43 | ].join('\n'); 44 | return shaderSource; 45 | }, 46 | inPlace: false, 47 | inputs: { 48 | source: { 49 | type: 'image', 50 | uniform: 'source' 51 | }, 52 | wave: { 53 | type: 'number', 54 | uniform: 'wave', 55 | defaultValue: Math.PI / 0.75 56 | }, 57 | distortion: { 58 | type: 'number', 59 | uniform: 'distortion', 60 | defaultValue: 1 61 | }, 62 | center: { 63 | type: 'vector', 64 | uniform: 'center', 65 | dimensions: 2, 66 | defaultValue: [0.5, 0.5] 67 | } 68 | }, 69 | title: 'Ripple Distortion', 70 | description: '' 71 | }); 72 | })); 73 | -------------------------------------------------------------------------------- /lib/Seriously.js/effects/seriously.scanlines.js: -------------------------------------------------------------------------------- 1 | /* global define, require */ 2 | (function (root, factory) { 3 | 'use strict'; 4 | 5 | if (typeof define === 'function' && define.amd) { 6 | // AMD. Register as an anonymous module. 7 | define(['seriously'], factory); 8 | } else if (typeof exports === 'object') { 9 | // Node/CommonJS 10 | factory(require('seriously')); 11 | } else { 12 | if (!root.Seriously) { 13 | root.Seriously = { plugin: function (name, opt) { this[name] = opt; } }; 14 | } 15 | factory(root.Seriously); 16 | } 17 | }(window, function (Seriously) { 18 | 'use strict'; 19 | 20 | Seriously.plugin('scanlines', { 21 | commonShader: true, 22 | shader: function (inputs, shaderSource) { 23 | shaderSource.fragment = [ 24 | 'precision mediump float;', 25 | 26 | 'varying vec2 vTexCoord;', 27 | 28 | 'uniform sampler2D source;', 29 | 'uniform float lines;', 30 | 'uniform float width;', 31 | 'uniform float intensity;', 32 | 33 | //todo: add vertical offset for animating 34 | 35 | 'void main(void) {', 36 | ' vec4 pixel = texture2D(source, vTexCoord);', 37 | ' float darken = 2.0 * abs( fract(vTexCoord.y * lines / 2.0) - 0.5);', 38 | ' darken = clamp(darken - width + 0.5, 0.0, 1.0);', 39 | ' darken = 1.0 - ((1.0 - darken) * intensity);', 40 | ' gl_FragColor = vec4(pixel.rgb * darken, 1.0);', 41 | '}' 42 | ].join('\n'); 43 | return shaderSource; 44 | }, 45 | inPlace: true, 46 | inputs: { 47 | source: { 48 | type: 'image', 49 | uniform: 'source' 50 | }, 51 | lines: { 52 | type: 'number', 53 | uniform: 'lines', 54 | defaultValue: 60 55 | }, 56 | size: { 57 | type: 'number', 58 | uniform: 'size', 59 | defaultValue: 0.2, 60 | min: 0, 61 | max: 1 62 | }, 63 | intensity: { 64 | type: 'number', 65 | uniform: 'intensity', 66 | defaultValue: 0.1, 67 | min: 0, 68 | max: 1 69 | } 70 | }, 71 | title: 'Scan Lines', 72 | description: '' 73 | }); 74 | })); 75 | -------------------------------------------------------------------------------- /lib/Seriously.js/effects/seriously.select.js: -------------------------------------------------------------------------------- 1 | /* global define, require */ 2 | (function (root, factory) { 3 | 'use strict'; 4 | 5 | if (typeof define === 'function' && define.amd) { 6 | // AMD. Register as an anonymous module. 7 | define(['seriously'], factory); 8 | } else if (typeof exports === 'object') { 9 | // Node/CommonJS 10 | factory(require('seriously')); 11 | } else { 12 | if (!root.Seriously) { 13 | root.Seriously = { plugin: function (name, opt) { this[name] = opt; } }; 14 | } 15 | factory(root.Seriously); 16 | } 17 | }(window, function (Seriously) { 18 | 'use strict'; 19 | 20 | var intRegex = /\d+/; 21 | 22 | Seriously.plugin('select', function (options) { 23 | var count, 24 | me = this, 25 | i, 26 | inputs; 27 | 28 | function resize() { 29 | me.resize(); 30 | } 31 | 32 | function update() { 33 | var i = me.inputs.active, 34 | source; 35 | 36 | source = me.inputs['source' + i]; 37 | me.texture = source && source.texture; 38 | 39 | resize(); 40 | } 41 | 42 | if (typeof options === 'number' && options >= 2) { 43 | count = options; 44 | } else { 45 | count = options && options.count || 4; 46 | count = Math.max(2, count); 47 | } 48 | 49 | inputs = { 50 | active: { 51 | type: 'number', 52 | step: 1, 53 | min: 0, 54 | max: count - 1, 55 | defaultValue: 0, 56 | update: update, 57 | updateSources: true 58 | }, 59 | sizeMode: { 60 | type: 'enum', 61 | defaultValue: '0', 62 | options: [ 63 | 'union', 64 | 'intersection', 65 | 'active' 66 | ], 67 | update: resize 68 | } 69 | }; 70 | 71 | for (i = 0; i < count; i++) { 72 | inputs.sizeMode.options.push(i.toString()); 73 | inputs.sizeMode.options.push('source' + i); 74 | 75 | //source 76 | inputs['source' + i] = { 77 | type: 'image', 78 | update: update 79 | }; 80 | } 81 | 82 | this.uniforms.layerResolution = [1, 1]; 83 | 84 | // custom resize method 85 | this.resize = function () { 86 | var width, 87 | height, 88 | mode = this.inputs.sizeMode, 89 | i, 90 | n, 91 | source, 92 | a; 93 | 94 | if (mode === 'union') { 95 | width = 0; 96 | height = 0; 97 | for (i = 0; i < count; i++) { 98 | source = this.inputs['source' + i]; 99 | if (source) { 100 | width = Math.max(width, source.width); 101 | height = Math.max(height, source.height); 102 | } 103 | } 104 | } else if (mode === 'intersection') { 105 | width = Infinity; 106 | height = Infinity; 107 | for (i = 0; i < count; i++) { 108 | source = this.inputs['source' + i]; 109 | if (source) { 110 | width = Math.min(width, source.width); 111 | height = Math.min(height, source.height); 112 | } 113 | } 114 | } else if (mode === 'active') { 115 | i = this.inputs.active; 116 | source = this.inputs['source' + i]; 117 | width = Math.max(1, source && source.width || 1); 118 | height = Math.max(1, source && source.height || 1); 119 | } else { 120 | width = 1; 121 | height = 1; 122 | n = count - 1; 123 | a = intRegex.exec(this.inputs.sizeMode); 124 | if (a) { 125 | n = Math.min(parseInt(a[0], 10), n); 126 | } 127 | 128 | for (i = 0; i <= n; i++) { 129 | source = this.inputs['source' + i]; 130 | if (source) { 131 | width = source.width; 132 | height = source.height; 133 | break; 134 | } 135 | } 136 | } 137 | 138 | if (this.width !== width || this.height !== height) { 139 | this.width = width; 140 | this.height = height; 141 | 142 | this.emit('resize'); 143 | this.setDirty(); 144 | } 145 | 146 | for (i = 0; i < this.targets.length; i++) { 147 | this.targets[i].resize(); 148 | } 149 | }; 150 | 151 | return { 152 | initialize: function () { 153 | this.initialized = true; 154 | this.shaderDirty = false; 155 | }, 156 | requires: function (sourceName) { 157 | return !!(this.inputs[sourceName] && sourceName === 'source' + this.inputs.active); 158 | }, 159 | 160 | //check the source texture on every draw just in case the source nodes pulls 161 | //shenanigans with its texture. 162 | draw: function () { 163 | var i = me.inputs.active, 164 | source; 165 | 166 | source = me.inputs['source' + i]; 167 | me.texture = source && source.texture; 168 | }, 169 | inputs: inputs 170 | }; 171 | }, 172 | { 173 | title: 'Select', 174 | description: 'Select a single source image from a list of source nodes.', 175 | inPlace: false, 176 | commonShader: true 177 | }); 178 | })); 179 | -------------------------------------------------------------------------------- /lib/Seriously.js/effects/seriously.sepia.js: -------------------------------------------------------------------------------- 1 | /* global define, require */ 2 | (function (root, factory) { 3 | 'use strict'; 4 | 5 | if (typeof define === 'function' && define.amd) { 6 | // AMD. Register as an anonymous module. 7 | define(['seriously'], factory); 8 | } else if (typeof exports === 'object') { 9 | // Node/CommonJS 10 | factory(require('seriously')); 11 | } else { 12 | if (!root.Seriously) { 13 | root.Seriously = { plugin: function (name, opt) { this[name] = opt; } }; 14 | } 15 | factory(root.Seriously); 16 | } 17 | }(window, function (Seriously) { 18 | 'use strict'; 19 | 20 | // sepia coefficients borrowed from: 21 | // http://www.techrepublic.com/blog/howdoi/how-do-i-convert-images-to-grayscale-and-sepia-tone-using-c/120 22 | 23 | Seriously.plugin('sepia', { 24 | commonShader: true, 25 | shader: function (inputs, shaderSource) { 26 | shaderSource.fragment = [ 27 | 'precision mediump float;', 28 | 29 | 'varying vec2 vTexCoord;', 30 | 31 | 'uniform sampler2D source;', 32 | 'uniform vec4 light;', 33 | 'uniform vec4 dark;', 34 | 'uniform float desat;', 35 | 'uniform float toned;', 36 | 37 | 'const mat4 coeff = mat4(' + 38 | '0.393, 0.349, 0.272, 1.0,' + 39 | '0.796, 0.686, 0.534, 1.0, ' + 40 | '0.189, 0.168, 0.131, 1.0, ' + 41 | '0.0, 0.0, 0.0, 1.0 ' + 42 | ');', 43 | 44 | 'void main(void) {', 45 | ' vec4 sourcePixel = texture2D(source, vTexCoord);', 46 | ' gl_FragColor = coeff * sourcePixel;', 47 | '}' 48 | ].join('\n'); 49 | return shaderSource; 50 | }, 51 | inPlace: true, 52 | inputs: { 53 | source: { 54 | type: 'image', 55 | uniform: 'source' 56 | } 57 | }, 58 | title: 'Sepia', 59 | description: '' 60 | }); 61 | })); 62 | -------------------------------------------------------------------------------- /lib/Seriously.js/effects/seriously.simplex.js: -------------------------------------------------------------------------------- 1 | /* global define, require */ 2 | (function (root, factory) { 3 | 'use strict'; 4 | 5 | if (typeof define === 'function' && define.amd) { 6 | // AMD. Register as an anonymous module. 7 | define(['seriously'], factory); 8 | } else if (typeof exports === 'object') { 9 | // Node/CommonJS 10 | factory(require('seriously')); 11 | } else { 12 | if (!root.Seriously) { 13 | root.Seriously = { plugin: function (name, opt) { this[name] = opt; } }; 14 | } 15 | factory(root.Seriously); 16 | } 17 | }(window, function (Seriously) { 18 | 'use strict'; 19 | 20 | Seriously.plugin('simplex', function () { 21 | var me = this; 22 | 23 | function resize() { 24 | me.resize(); 25 | } 26 | 27 | return { 28 | shader: function (inputs, shaderSource, utilities) { 29 | var frequency = 1, 30 | amplitude = 1, 31 | i, 32 | adjust = 0; 33 | 34 | function fmtFloat(n) { 35 | if (n - Math.floor(n) === 0) { 36 | return n + '.0'; 37 | } 38 | return n; 39 | } 40 | 41 | shaderSource.fragment = [ 42 | 'precision mediump float;', 43 | 44 | 'varying vec2 vTexCoord;', 45 | 46 | 'uniform float amount;', 47 | 'uniform vec2 noiseScale;', 48 | 'uniform vec2 noiseOffset;', 49 | 'uniform float time;', 50 | 'uniform vec4 black;', 51 | 'uniform vec4 white;', 52 | 53 | utilities.shader.noiseHelpers, 54 | utilities.shader.snoise3d, 55 | //utilities.shader.random, 56 | 57 | 'void main(void) {', 58 | ' float total = 0.0;', 59 | ' vec3 pos = vec3(vTexCoord.xy * noiseScale + noiseOffset, time);' 60 | ].join('\n'); 61 | 62 | for (i = 0; i < inputs.octaves; i++) { 63 | frequency = Math.pow(2, i); 64 | amplitude = Math.pow(inputs.persistence, i); 65 | adjust += amplitude; 66 | shaderSource.fragment += '\ttotal += snoise(pos * ' + fmtFloat(frequency) + ') * ' + fmtFloat(amplitude) + ';\n'; 67 | } 68 | shaderSource.fragment += [ 69 | ' total *= amount / ' + fmtFloat(adjust) + ';', 70 | ' total = (total + 1.0)/ 2.0;', 71 | ' gl_FragColor = mix(black, white, total);', 72 | '}' 73 | ].join('\n'); 74 | 75 | return shaderSource; 76 | }, 77 | inputs: { 78 | noiseScale: { 79 | type: 'vector', 80 | dimensions: 2, 81 | uniform: 'noiseScale', 82 | defaultValue: [1, 1] 83 | }, 84 | noiseOffset: { 85 | type: 'vector', 86 | dimensions: 2, 87 | uniform: 'noiseOffset', 88 | defaultValue: [0, 0] 89 | }, 90 | octaves: { 91 | type: 'number', 92 | shaderDirty: true, 93 | min: 1, 94 | max: 8, 95 | step: 1, 96 | defaultValue: 1 97 | }, 98 | persistence: { 99 | type: 'number', 100 | defaultValue: 0.5, 101 | min: 0, 102 | max: 0.5 103 | }, 104 | amount: { 105 | type: 'number', 106 | uniform: 'amount', 107 | min: 0, 108 | defaultValue: 1 109 | }, 110 | time: { 111 | type: 'number', 112 | uniform: 'time', 113 | defaultValue: 0 114 | }, 115 | width: { 116 | type: 'number', 117 | min: 0, 118 | step: 1, 119 | update: resize, 120 | defaultValue: 0 121 | }, 122 | height: { 123 | type: 'number', 124 | min: 0, 125 | step: 1, 126 | update: resize, 127 | defaultValue: 0 128 | }, 129 | black: { 130 | type: 'color', 131 | uniform: 'black', 132 | defaultValue: [0, 0, 0, 1] 133 | }, 134 | white: { 135 | type: 'color', 136 | uniform: 'white', 137 | defaultValue: [1, 1, 1, 1] 138 | } 139 | } 140 | }; 141 | }, { 142 | title: 'Simplex Noise', 143 | description: 'Generate Simplex Noise' 144 | }); 145 | })); 146 | -------------------------------------------------------------------------------- /lib/Seriously.js/effects/seriously.sketch.js: -------------------------------------------------------------------------------- 1 | /* global define, require */ 2 | (function (root, factory) { 3 | 'use strict'; 4 | 5 | if (typeof define === 'function' && define.amd) { 6 | // AMD. Register as an anonymous module. 7 | define(['seriously'], factory); 8 | } else if (typeof exports === 'object') { 9 | // Node/CommonJS 10 | factory(require('seriously')); 11 | } else { 12 | if (!root.Seriously) { 13 | root.Seriously = { plugin: function (name, opt) { this[name] = opt; } }; 14 | } 15 | factory(root.Seriously); 16 | } 17 | }(window, function (Seriously) { 18 | 'use strict'; 19 | 20 | /* inspired by http://lab.adjazent.com/2009/01/09/more-pixel-bender/ */ 21 | 22 | Seriously.plugin('sketch', { 23 | commonShader: true, 24 | shader: function (inputs, shaderSource) { 25 | shaderSource.fragment = [ 26 | 'precision mediump float;', 27 | 28 | //todo: make adjust adjustable 29 | 'varying vec2 vTexCoord;', 30 | 31 | 'uniform sampler2D source;', 32 | 'uniform vec2 resolution;', 33 | 34 | 'float res = resolution.x;', 35 | 'float n0 = 97.0 / res;', 36 | 'float n1 = 15.0 / res;', 37 | 'float n2 = 97.0 / res;', 38 | 'float n3 = 9.7 / res;', 39 | 'float total = n2 + ( 4.0 * n0 ) + ( 4.0 * n1 );', 40 | 41 | 'const vec3 div3 = vec3(1.0 / 3.0);', 42 | 43 | 'void main(void) {', 44 | ' float offset, temp1, temp2;', 45 | ' vec4 m, p0, p1, p2, p3, p4, p5, p6, p7, p8;', 46 | ' offset = n3;', 47 | 48 | ' p0=texture2D(source,vTexCoord);', 49 | ' p1=texture2D(source,vTexCoord+vec2(-offset,-offset));', 50 | ' p2=texture2D(source,vTexCoord+vec2( offset,-offset));', 51 | ' p3=texture2D(source,vTexCoord+vec2( offset, offset));', 52 | ' p4=texture2D(source,vTexCoord+vec2(-offset, offset));', 53 | 54 | ' offset=n3*2.0;', 55 | 56 | ' p5=texture2D(source,vTexCoord+vec2(-offset,-offset));', 57 | ' p6=texture2D(source,vTexCoord+vec2( offset,-offset));', 58 | ' p7=texture2D(source,vTexCoord+vec2( offset, offset));', 59 | ' p8=texture2D(source,vTexCoord+vec2(-offset, offset));', 60 | ' m = (p0 * n2 + (p1 + p2 + p3 + p4) * n0 + (p5 + p6 + p7 + p8) * n1) / total;', 61 | 62 | //convert to b/w 63 | ' temp1 = dot(p0.rgb, div3);', 64 | ' temp2 = dot(m.rgb, div3);', 65 | 66 | //color dodge blend mode 67 | ' if (temp2 <= 0.0005) {', 68 | ' gl_FragColor = vec4( 1.0, 1.0, 1.0, p0.a);', 69 | ' } else {', 70 | ' gl_FragColor = vec4( vec3(min(temp1 / temp2, 1.0)), p0.a);', 71 | ' }', 72 | '}' 73 | ].join('\n'); 74 | return shaderSource; 75 | }, 76 | inPlace: false, 77 | inputs: { 78 | source: { 79 | type: 'image', 80 | uniform: 'source', 81 | shaderDirty: false 82 | } 83 | }, 84 | title: 'Sketch', 85 | description: 'Pencil/charcoal sketch' 86 | }); 87 | })); 88 | -------------------------------------------------------------------------------- /lib/Seriously.js/effects/seriously.temperature.js: -------------------------------------------------------------------------------- 1 | /* global define, require */ 2 | (function (root, factory) { 3 | 'use strict'; 4 | 5 | if (typeof define === 'function' && define.amd) { 6 | // AMD. Register as an anonymous module. 7 | define(['seriously'], factory); 8 | } else if (typeof exports === 'object') { 9 | // Node/CommonJS 10 | factory(require('seriously')); 11 | } else { 12 | if (!root.Seriously) { 13 | root.Seriously = { plugin: function (name, opt) { this[name] = opt; } }; 14 | } 15 | factory(root.Seriously); 16 | } 17 | }(window, function (Seriously) { 18 | 'use strict'; 19 | 20 | // algorithm from http://www.tannerhelland.com/4435/convert-temperature-rgb-algorithm-code/ 21 | 22 | Seriously.plugin('temperature', { 23 | commonShader: true, 24 | shader: function (inputs, shaderSource) { 25 | shaderSource.vertex = [ 26 | 'precision mediump float;', 27 | 28 | 'attribute vec4 position;', 29 | 'attribute vec2 texCoord;', 30 | 31 | 'uniform vec2 resolution;', 32 | 'uniform mat4 transform;', 33 | 34 | 'uniform float temperature;', 35 | 36 | 'varying vec2 vTexCoord;', 37 | 'varying vec3 tempFactor;', 38 | 39 | 'const vec3 luma = vec3(0.2125,0.7154,0.0721);', 40 | 41 | 'vec3 temperatureRGB(float t) {', 42 | ' float temp = t / 100.0;', 43 | ' vec3 color = vec3(1.0);', 44 | ' if (temp < 66.0) {', 45 | ' color.g = 0.3900815787690196 * log(temp) - 0.6318414437886275;', 46 | ' color.b = 0.543206789110196 * log(temp - 10.0) - 1.19625408914;', 47 | ' } else {', 48 | ' color.r = 1.292936186062745 * pow(temp - 60.0, -0.1332047592);', 49 | ' color.g = 1.129890860895294 * pow(temp - 60.0, -0.0755148492);', 50 | ' }', 51 | ' return color;', 52 | '}', 53 | 54 | 'void main(void) {', 55 | // first convert to screen space 56 | ' vec4 screenPosition = vec4(position.xy * resolution / 2.0, position.z, position.w);', 57 | ' screenPosition = transform * screenPosition;', 58 | 59 | // convert back to OpenGL coords 60 | ' gl_Position.xy = screenPosition.xy * 2.0 / resolution;', 61 | ' gl_Position.z = screenPosition.z * 2.0 / (resolution.x / resolution.y);', 62 | ' gl_Position.w = screenPosition.w;', 63 | ' vTexCoord = texCoord;', 64 | ' vec3 tempColor = temperatureRGB(temperature);', 65 | ' tempFactor = dot(tempColor, luma) / tempColor;', 66 | '}\n' 67 | ].join('\n'); 68 | 69 | shaderSource.fragment = [ 70 | 'precision mediump float;', 71 | 72 | 'varying vec2 vTexCoord;', 73 | 'varying vec3 tempFactor;', 74 | 75 | 'uniform sampler2D source;', 76 | 77 | 'void main(void) {', 78 | ' vec4 pixel = texture2D(source, vTexCoord);', 79 | ' gl_FragColor = vec4(pixel.rgb * tempFactor, pixel.a);', 80 | '}' 81 | ].join('\n'); 82 | return shaderSource; 83 | }, 84 | inPlace: true, 85 | inputs: { 86 | source: { 87 | type: 'image', 88 | uniform: 'source' 89 | }, 90 | temperature: { 91 | type: 'number', 92 | uniform: 'temperature', 93 | defaultValue: 6500, 94 | min: 3000, 95 | max: 25000 96 | } 97 | }, 98 | title: 'Color Temperature', 99 | description: '' 100 | }); 101 | })); 102 | -------------------------------------------------------------------------------- /lib/Seriously.js/effects/seriously.throttle.js: -------------------------------------------------------------------------------- 1 | /* global define, require */ 2 | (function (root, factory) { 3 | 'use strict'; 4 | 5 | if (typeof define === 'function' && define.amd) { 6 | // AMD. Register as an anonymous module. 7 | define(['seriously'], factory); 8 | } else if (typeof exports === 'object') { 9 | // Node/CommonJS 10 | factory(require('seriously')); 11 | } else { 12 | if (!root.Seriously) { 13 | root.Seriously = { plugin: function (name, opt) { this[name] = opt; } }; 14 | } 15 | factory(root.Seriously); 16 | } 17 | }(window, function (Seriously) { 18 | 'use strict'; 19 | 20 | Seriously.plugin('throttle', function () { 21 | var lastDrawTime = 0; 22 | return { 23 | draw: function (shader, model, uniforms, frameBuffer, draw) { 24 | if (this.inputs.frameRate && Date.now() - lastDrawTime >= 1000 / this.inputs.frameRate) { 25 | draw(shader, model, uniforms, frameBuffer); 26 | lastDrawTime = Date.now(); 27 | } 28 | }, 29 | requires: function (sourceName, inputs) { 30 | if (inputs.frameRate && Date.now() - lastDrawTime >= 1000 / inputs.frameRate) { 31 | return true; 32 | } 33 | 34 | return false; 35 | } 36 | }; 37 | }, { 38 | inPlace: true, 39 | commonShader: true, 40 | title: 'Throttle', 41 | description: 'Throttle frame rate', 42 | inputs: { 43 | source: { 44 | type: 'image', 45 | uniform: 'source' 46 | }, 47 | frameRate: { 48 | type: 'number', 49 | uniform: 'opacity', 50 | defaultValue: 15, 51 | min: 0 52 | } 53 | } 54 | }); 55 | })); 56 | -------------------------------------------------------------------------------- /lib/Seriously.js/effects/seriously.tone.js: -------------------------------------------------------------------------------- 1 | /* global define, require */ 2 | (function (root, factory) { 3 | 'use strict'; 4 | 5 | if (typeof define === 'function' && define.amd) { 6 | // AMD. Register as an anonymous module. 7 | define(['seriously'], factory); 8 | } else if (typeof exports === 'object') { 9 | // Node/CommonJS 10 | factory(require('seriously')); 11 | } else { 12 | if (!root.Seriously) { 13 | root.Seriously = { plugin: function (name, opt) { this[name] = opt; } }; 14 | } 15 | factory(root.Seriously); 16 | } 17 | }(window, function (Seriously) { 18 | 'use strict'; 19 | 20 | Seriously.plugin('tone', { 21 | commonShader: true, 22 | shader: function (inputs, shaderSource) { 23 | shaderSource.fragment = [ 24 | 'precision mediump float;', 25 | 26 | 'varying vec2 vTexCoord;', 27 | 28 | 'uniform sampler2D source;', 29 | 'uniform vec4 light;', 30 | 'uniform vec4 dark;', 31 | 'uniform float desat;', 32 | 'uniform float toned;', 33 | 34 | 'const vec3 lumcoeff = vec3(0.2125,0.7154,0.0721);', 35 | 36 | 'void main(void) {', 37 | ' vec4 sourcePixel = texture2D(source, vTexCoord);', 38 | ' vec3 sceneColor = light.rgb * sourcePixel.rgb;', 39 | ' vec3 gray = vec3(dot(lumcoeff, sceneColor));', 40 | ' vec3 muted = mix(sceneColor, gray, desat);', 41 | ' vec3 tonedColor = mix(dark.rgb, light.rgb, gray);', 42 | ' gl_FragColor = vec4(mix(muted, tonedColor, toned), sourcePixel.a);', 43 | '}' 44 | ].join('\n'); 45 | return shaderSource; 46 | }, 47 | inPlace: true, 48 | inputs: { 49 | source: { 50 | type: 'image', 51 | uniform: 'source' 52 | }, 53 | light: { 54 | type: 'color', 55 | uniform: 'light', 56 | defaultValue: [1, 0.9, 0.5, 1] 57 | }, 58 | dark: { 59 | type: 'color', 60 | uniform: 'dark', 61 | defaultValue: [0.2, 0.05, 0, 1] 62 | }, 63 | toned: { 64 | type: 'number', 65 | uniform: 'toned', 66 | defaultValue: 1, 67 | minimumRange: 0, 68 | maximumRange: 1 69 | }, 70 | desat: { 71 | type: 'number', 72 | uniform: 'desat', 73 | defaultValue: 0.5, 74 | minimumRange: 0, 75 | maximumRange: 1 76 | } 77 | }, 78 | title: 'Tone', 79 | description: '' 80 | }); 81 | })); 82 | -------------------------------------------------------------------------------- /lib/Seriously.js/effects/seriously.vibrance.js: -------------------------------------------------------------------------------- 1 | /* global define, require */ 2 | (function (root, factory) { 3 | 'use strict'; 4 | 5 | if (typeof define === 'function' && define.amd) { 6 | // AMD. Register as an anonymous module. 7 | define(['seriously'], factory); 8 | } else if (typeof exports === 'object') { 9 | // Node/CommonJS 10 | factory(require('seriously')); 11 | } else { 12 | if (!root.Seriously) { 13 | root.Seriously = { plugin: function (name, opt) { this[name] = opt; } }; 14 | } 15 | factory(root.Seriously); 16 | } 17 | }(window, function (Seriously) { 18 | 'use strict'; 19 | 20 | /* 21 | Vibrance is similar to saturation, but it has less effect on skin tones 22 | http://www.iceflowstudios.com/2013/tips/vibrance-vs-saturation-in-photoshop/ 23 | 24 | Shader adapted from glfx.js by Evan Wallace 25 | License: https://github.com/evanw/glfx.js/blob/master/LICENSE 26 | */ 27 | 28 | Seriously.plugin('vibrance', { 29 | commonShader: true, 30 | shader: function (inputs, shaderSource) { 31 | shaderSource.fragment = [ 32 | 'precision mediump float;', 33 | 34 | 'varying vec2 vTexCoord;', 35 | 36 | 'uniform sampler2D source;', 37 | 'uniform float amount;', 38 | 39 | 'void main(void) {', 40 | ' vec4 color = texture2D(source, vTexCoord);', 41 | 42 | ' float average = (color.r + color.g + color.b) / 3.0;', 43 | ' float mx = max(color.r, max(color.g, color.b));', 44 | ' float amt = (mx - average) * (-3.0 * amount);', 45 | ' color.rgb = mix(color.rgb, vec3(mx), amt);', 46 | ' gl_FragColor = color;', 47 | 48 | /* 49 | https://github.com/v002/v002-Color-Controls 50 | doesn't work so well with values < 0 51 | ' const vec4 lumacoeff = vec4(0.299,0.587,0.114, 0.);', 52 | ' vec4 luma = vec4(dot(color, lumacoeff));', 53 | ' vec4 mask = clamp(color - luma, 0.0, 1.0);', 54 | ' float lumaMask = 1.0 - dot(lumacoeff, mask);', 55 | ' gl_FragColor = mix(luma, color, 1.0 + amount * lumaMask);', 56 | */ 57 | '}' 58 | ].join('\n'); 59 | return shaderSource; 60 | }, 61 | inPlace: true, 62 | inputs: { 63 | source: { 64 | type: 'image', 65 | uniform: 'source' 66 | }, 67 | amount: { 68 | type: 'number', 69 | uniform: 'amount', 70 | defaultValue: 0, 71 | min: -1, 72 | max: 1 73 | } 74 | }, 75 | title: 'Vibrance', 76 | description: 'Non-peaking saturation effect' 77 | }); 78 | })); 79 | -------------------------------------------------------------------------------- /lib/Seriously.js/effects/seriously.vignette.js: -------------------------------------------------------------------------------- 1 | /* global define, require */ 2 | (function (root, factory) { 3 | 'use strict'; 4 | 5 | if (typeof define === 'function' && define.amd) { 6 | // AMD. Register as an anonymous module. 7 | define(['seriously'], factory); 8 | } else if (typeof exports === 'object') { 9 | // Node/CommonJS 10 | factory(require('seriously')); 11 | } else { 12 | if (!root.Seriously) { 13 | root.Seriously = { plugin: function (name, opt) { this[name] = opt; } }; 14 | } 15 | factory(root.Seriously); 16 | } 17 | }(window, function (Seriously) { 18 | 'use strict'; 19 | 20 | Seriously.plugin('vignette', { 21 | commonShader: true, 22 | shader: function (inputs, shaderSource) { 23 | shaderSource.fragment = [ 24 | 'precision mediump float;', 25 | 26 | 'varying vec2 vTexCoord;', 27 | 28 | 'uniform sampler2D source;', 29 | 'uniform float amount;', 30 | 31 | 'void main(void) {', 32 | ' vec4 pixel = texture2D(source, vTexCoord);', 33 | ' vec2 pos = vTexCoord.xy - 0.5;', 34 | ' float vignette = 1.0 - (dot(pos, pos) * amount);', 35 | ' gl_FragColor = vec4(pixel.rgb * vignette, pixel.a);', 36 | '}' 37 | ].join('\n'); 38 | return shaderSource; 39 | }, 40 | inPlace: false, 41 | inputs: { 42 | source: { 43 | type: 'image', 44 | uniform: 'source' 45 | }, 46 | amount: { 47 | type: 'number', 48 | uniform: 'amount', 49 | defaultValue: 1, 50 | min: 0 51 | } 52 | }, 53 | title: 'Vignette', 54 | description: 'Vignette' 55 | }); 56 | })); 57 | -------------------------------------------------------------------------------- /lib/Seriously.js/examples/accumulator/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Seriously.js Accumulator Effect Example 5 | 31 | 32 | 33 | 34 | 35 |
36 |
37 | 38 | 72 |
73 |
74 |
75 | 76 | 149 | 150 | 151 | -------------------------------------------------------------------------------- /lib/Seriously.js/examples/amd/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | Seriously.js AMD/Require.js Example 4 | 5 | 6 | 7 | 8 |
9 | 10 | 11 |
12 | 13 | 14 | 49 | 50 | 51 | -------------------------------------------------------------------------------- /lib/Seriously.js/examples/animate/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Seriously.js Animate Example 5 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 62 | 63 | 64 | -------------------------------------------------------------------------------- /lib/Seriously.js/examples/blend/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Seriously.js Blend Example 5 | 19 | 20 | 21 | 22 | 23 |
24 |
25 | 26 | 60 |
61 |
62 |
63 | 64 | 65 | 106 | 107 | 108 | -------------------------------------------------------------------------------- /lib/Seriously.js/examples/blur/blur.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Seriously.js Blur Example 5 | 30 | 31 | 32 | 33 | 34 |
35 |
36 | 37 |
38 | 39 | 40 | 143 | 144 | 145 | -------------------------------------------------------------------------------- /lib/Seriously.js/examples/blur/directionblur.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Seriously.js Directional Motion Blur Example 5 | 19 | 20 | 21 | 22 | 23 |
24 |
25 |
26 |
27 | 28 | 54 | 55 | 56 | -------------------------------------------------------------------------------- /lib/Seriously.js/examples/blur/whip.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Seriously.js Whip Pan Example 5 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 106 | 107 | 108 | -------------------------------------------------------------------------------- /lib/Seriously.js/examples/camera/camera-source.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Seriously.js Camera Demo 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 43 | 44 | 45 | -------------------------------------------------------------------------------- /lib/Seriously.js/examples/camera/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Seriously.js Camera Demo 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 77 | 78 | 79 | -------------------------------------------------------------------------------- /lib/Seriously.js/examples/channels/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Seriously.js Channels Example 5 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 158 | 159 | 160 | -------------------------------------------------------------------------------- /lib/Seriously.js/examples/color/color.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Seriously.js Color Generator 5 | 20 | 21 | 22 | 23 |
24 | 25 | 26 | 27 |
28 | 29 | 30 | 31 | 54 | 55 | 56 | -------------------------------------------------------------------------------- /lib/Seriously.js/examples/color/linear-transfer.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Seriously.js Linear Color Transfer Example 5 | 23 | 24 | 25 | 26 | 27 |
28 |
29 | Slope 30 | 31 | 32 | 33 | 34 |
35 | 36 |
37 | Intercept 38 | 39 | 40 | 41 | 42 |
43 |
44 | 45 | 88 | 89 | 90 | -------------------------------------------------------------------------------- /lib/Seriously.js/examples/color/lut.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Seriously.js Color Look-Up Table Example 5 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 |
31 |
32 | 40 |
41 |
42 | 43 |
44 |
45 | 46 | 82 | 83 | 84 | -------------------------------------------------------------------------------- /lib/Seriously.js/examples/crop.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Seriously.js Camera Shake Example 5 | 29 | 30 | 31 | 32 | 33 |
34 | 35 | 36 | 37 | 38 |
39 | 40 | 41 | 42 | 79 | 80 | 81 | -------------------------------------------------------------------------------- /lib/Seriously.js/examples/demo/drunk.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Drunk Video 5 | 23 | 24 | 25 | 26 | 27 | 81 | 82 | 83 | -------------------------------------------------------------------------------- /lib/Seriously.js/examples/demo/panorama.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Seriously.js Panorama Example 5 | 6 | 35 | 36 | 37 | 38 | 39 |
40 | 41 | 42 |
43 | 44 | 93 | 94 | 95 | -------------------------------------------------------------------------------- /lib/Seriously.js/examples/demo/select.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Seriously.js Switch Example 5 | 24 | 25 | 26 |
27 | 28 |
29 | 30 | 31 | 149 | 150 | 151 | -------------------------------------------------------------------------------- /lib/Seriously.js/examples/displace/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Seriously.js Displacement Example 6 | 45 | 46 | 47 | 48 | 49 | 50 |
51 |

Move mouse to change perspective.

52 |

Drag and drop or select a JPG file taken with Android Camera using Lens Blur option.

53 | 54 |
55 | 56 | 57 | 58 | 59 | 60 | 145 | 146 | -------------------------------------------------------------------------------- /lib/Seriously.js/examples/gradientwipe.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Seriously.js Gradient Wipe Example 5 | 33 | 34 | 35 | 36 | 37 | 38 |
39 | 40 | 41 |
42 | 43 | 44 | 45 | 46 | 47 | 96 | 97 | 98 | -------------------------------------------------------------------------------- /lib/Seriously.js/examples/images/README.md: -------------------------------------------------------------------------------- 1 | # Image Credits 2 | 3 | ## Color Your Life 4 | https://www.flickr.com/photos/uaeincredible/231011361/ 5 | by "Capture Queen" 6 | Creative Commons Attribution 2.0 Generic (CC BY 2.0) 7 | 8 | ## Pinwheel Bot 9 | https://www.flickr.com/photos/ittybittiesforyou/4837847601/ 10 | by "Jenn and Tony Bot" 11 | Attribution-NonCommercial 2.0 Generic (CC BY-NC 2.0) 12 | 13 | ## Dutch Colour Fields 14 | https://www.flickr.com/photos/45610102@N02/4611180427 15 | by Peter Femto 16 | Attribution-NonCommercial-ShareAlike 2.0 Generic (CC BY-NC-SA 2.0) 17 | 18 | ## Panorama 19 | by Jimmy Ferbuson 20 | http://www.jwjferguson.com 21 | 22 | ## Color Look-Up Talbes 23 | by Ian Forrester 24 | http://www.bbc.co.uk/rd/people/ianforrester 25 | - Cyan Spike 26 | - Lock Stock 27 | - Super Vivid -------------------------------------------------------------------------------- /lib/Seriously.js/examples/images/colorbars.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/positlabs/chromavore/a7c994e42b67dd17b09ca459f854d2f0abc8405e/lib/Seriously.js/examples/images/colorbars.png -------------------------------------------------------------------------------- /lib/Seriously.js/examples/images/field.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/positlabs/chromavore/a7c994e42b67dd17b09ca459f854d2f0abc8405e/lib/Seriously.js/examples/images/field.jpg -------------------------------------------------------------------------------- /lib/Seriously.js/examples/images/lut_cyanspike.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/positlabs/chromavore/a7c994e42b67dd17b09ca459f854d2f0abc8405e/lib/Seriously.js/examples/images/lut_cyanspike.png -------------------------------------------------------------------------------- /lib/Seriously.js/examples/images/lut_lockstock.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/positlabs/chromavore/a7c994e42b67dd17b09ca459f854d2f0abc8405e/lib/Seriously.js/examples/images/lut_lockstock.png -------------------------------------------------------------------------------- /lib/Seriously.js/examples/images/lut_supervivid.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/positlabs/chromavore/a7c994e42b67dd17b09ca459f854d2f0abc8405e/lib/Seriously.js/examples/images/lut_supervivid.png -------------------------------------------------------------------------------- /lib/Seriously.js/examples/images/monochromebars.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/positlabs/chromavore/a7c994e42b67dd17b09ca459f854d2f0abc8405e/lib/Seriously.js/examples/images/monochromebars.png -------------------------------------------------------------------------------- /lib/Seriously.js/examples/images/panorama.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/positlabs/chromavore/a7c994e42b67dd17b09ca459f854d2f0abc8405e/lib/Seriously.js/examples/images/panorama.jpg -------------------------------------------------------------------------------- /lib/Seriously.js/examples/images/pencils.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/positlabs/chromavore/a7c994e42b67dd17b09ca459f854d2f0abc8405e/lib/Seriously.js/examples/images/pencils.jpg -------------------------------------------------------------------------------- /lib/Seriously.js/examples/images/robot.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/positlabs/chromavore/a7c994e42b67dd17b09ca459f854d2f0abc8405e/lib/Seriously.js/examples/images/robot.jpg -------------------------------------------------------------------------------- /lib/Seriously.js/examples/images/table.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/positlabs/chromavore/a7c994e42b67dd17b09ca459f854d2f0abc8405e/lib/Seriously.js/examples/images/table.jpg -------------------------------------------------------------------------------- /lib/Seriously.js/examples/images/xbcontroller.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/positlabs/chromavore/a7c994e42b67dd17b09ca459f854d2f0abc8405e/lib/Seriously.js/examples/images/xbcontroller.jpg -------------------------------------------------------------------------------- /lib/Seriously.js/examples/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Seriously.js Examples 5 | 6 | 7 |