Created
July 19, 2017 08:31
-
-
Save floz/4ad133f45e57fbd9a15585cace1d7d67 to your computer and use it in GitHub Desktop.
Mirrors.fs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
uniform sampler2D tInput; | |
uniform vec2 resolution; | |
varying vec2 vUv; | |
uniform float divide3; | |
uniform float divide4; | |
uniform float mirrorX; | |
uniform float mirrorY; | |
void main() { | |
vec2 uv = vUv; | |
if(divide4>0.){ uv *= 2.; uv = mod(uv,vec2(1.)); } | |
// if(divide3>0.){ uv *= 2.; uv = mod(uv,vec2(1.)); } | |
if(mirrorX>0.){ uv.x = abs(uv.x-.5)+.5; } | |
if(mirrorY>0.){ uv.y = abs(uv.y-.5)+.5; } | |
gl_FragColor = texture2D(tInput, uv); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Bump