Skip to content

Instantly share code, notes, and snippets.

@code-disaster
Created August 3, 2016 07:36
Show Gist options
  • Save code-disaster/869c1c47d8b708dc2458538907445952 to your computer and use it in GitHub Desktop.
Save code-disaster/869c1c47d8b708dc2458538907445952 to your computer and use it in GitHub Desktop.

Revisions

  1. code-disaster created this gist Aug 3, 2016.
    10 changes: 10 additions & 0 deletions fullscreen-quad-libgdx.glsl
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,10 @@
    /* post-fx pass by blending a solid white fullscreen quad, no texture required */

    /*uniform*/ float fmin = 0.7;

    void main(void)
    {
    float fmod = mod(gl_FragCoord.y, 2.0);
    float fstep = fmin + (1.0 - fmin) * fmod;
    gl_FragColor = vec4(1.0, 1.0, 1.0, fstep);
    }
    12 changes: 12 additions & 0 deletions shadertoy.glsl
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,12 @@
    /* shadertoy test - blends with a texture */

    float fmin = 0.7;

    void mainImage( out vec4 fragColor, in vec2 fragCoord )
    {
    float fmod = mod(fragCoord.y, 2.0);
    float fstep = fmin + (1.0 - fmin) * fmod;

    vec2 uv = fragCoord.xy / iResolution.xy;
    fragColor = vec4(texture2D(iChannel0, uv).rgb * fstep, 1.0);
    }