Skip to content

Instantly share code, notes, and snippets.

@JuriaanGregor

JuriaanGregor/Splitscan.txt Secret

Created Jun 9, 2020
Embed
What would you like to do?
Splitscan for Isadora found on https://www.shadertoy.com/view/XdGcWK
// All credit to the original owner Hamoid
// Original url https://www.shadertoy.com/view/XdGcWK
uniform float time;
uniform vec2 mouse;
uniform vec2 resolution;
uniform sampler2D tex0;
void main(void) {
vec2 uv = gl_FragCoord.xy /resolution.xy;
float a = texture2D(tex0, vec2(0.5, time * 0.001)).r;
// 2D rotation of "a" radians
float nx = uv.x * cos(a) - uv.y * sin(a);
float ny = uv.x * sin(a) + uv.y * cos(a);
vec3 col = texture2D(tex0, vec2(nx, time * 0.01 + ny * 0.01)).rgb;
gl_FragColor = vec4(col.bgr, 1.0);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment