Skip to content

Instantly share code, notes, and snippets.

@gre
Forked from glslioadmin/TEMPLATE.glsl
Created May 17, 2014 10:58

Revisions

  1. gre revised this gist May 17, 2014. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion uniforms.default.json
    Original file line number Diff line number Diff line change
    @@ -1 +1 @@
    {"power":3,"powerDest":false}
    {"power":3,"powerDest":true}
  2. gre renamed this gist May 17, 2014. 1 changed file with 0 additions and 0 deletions.
    File renamed without changes.
  3. gre revised this gist May 17, 2014. 2 changed files with 14 additions and 2 deletions.
    14 changes: 13 additions & 1 deletion TEMPLATE.glsl
    Original file line number Diff line number Diff line change
    @@ -5,7 +5,19 @@ uniform sampler2D from, to;
    uniform float progress;
    uniform vec2 resolution;

    uniform float power;
    uniform bool powerDest;

    void main() {
    vec2 p = gl_FragCoord.xy / resolution.xy;
    gl_FragColor = mix(texture2D(from, p), texture2D(to, p), progress);

    vec2 p2 = mix(
    p,
    vec2(pow(p.x, power), pow(p.y, power)),
    (powerDest ? 0.5 : 1.0)-distance(progress, powerDest ? 0.5 : 1.0));

    gl_FragColor = mix(
    texture2D(from, p2),
    texture2D(to, powerDest ? p2: p),
    progress);
    }
    2 changes: 1 addition & 1 deletion uniforms.default.json
    Original file line number Diff line number Diff line change
    @@ -1 +1 @@
    {}
    {"power":3,"powerDest":false}
  4. @glslioadmin glslioadmin revised this gist May 16, 2014. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion TEMPLATE.glsl
    Original file line number Diff line number Diff line change
    @@ -4,7 +4,7 @@ precision highp float;
    uniform sampler2D from, to;
    uniform float progress;
    uniform vec2 resolution;

    void main() {
    vec2 p = gl_FragCoord.xy / resolution.xy;
    gl_FragColor = mix(texture2D(from, p), texture2D(to, p), progress);
  5. @glslioadmin glslioadmin revised this gist May 16, 2014. 1 changed file with 18 additions and 4 deletions.
    22 changes: 18 additions & 4 deletions ~LICENSE
    Original file line number Diff line number Diff line change
    @@ -1,8 +1,22 @@
    GLSL.io Transition License (v1) under MIT
    GLSL.io Transition License (v1):
    The MIT License (MIT)

    Copyright (C) 2014 contact@glsl.io

    Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
    Permission is hereby granted, free of charge, to any person obtaining a copy
    of this software and associated documentation files (the "Software"), to deal
    in the Software without restriction, including without limitation the rights
    to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
    copies of the Software, and to permit persons to whom the Software is
    furnished to do so, subject to the following conditions:

    The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
    The above copyright notice and this permission notice shall be included in
    all copies or substantial portions of the Software.

    THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
    THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
    IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
    FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
    AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
    LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
    OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
    THE SOFTWARE.
  6. @glslioadmin glslioadmin created this gist May 16, 2014.
    11 changes: 11 additions & 0 deletions TEMPLATE.glsl
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,11 @@
    #ifdef GL_ES
    precision highp float;
    #endif
    uniform sampler2D from, to;
    uniform float progress;
    uniform vec2 resolution;

    void main() {
    vec2 p = gl_FragCoord.xy / resolution.xy;
    gl_FragColor = mix(texture2D(from, p), texture2D(to, p), progress);
    }
    1 change: 1 addition & 0 deletions uniforms.default.json
    Original file line number Diff line number Diff line change
    @@ -0,0 +1 @@
    {}
    8 changes: 8 additions & 0 deletions ~LICENSE
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,8 @@
    GLSL.io Transition License (v1) under MIT
    Copyright (C) 2014 contact@glsl.io

    Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

    The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

    THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.