Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- vec2 rotate_uv(vec2 uv, float rotation) {
- return vec2(
- cos(rotation) * (uv.x) + sin(rotation) * (uv.y),
- cos(rotation) * (uv.y) - sin(rotation) * (uv.x)
- );
- }
- void mainImage(out vec4 fragColor, in vec2 fragCoord) {
- vec2 uv = fragCoord / iResolution.xy;
- vec2 fade_uv = uv;
- float time = abs(sin(iTime)) * 36.00 / 36.00;
- float angle = 70.00;
- float angle_1q = mod(angle, 90.0);
- float angle_rad = radians(angle);
- float angle_1q_rad = radians(angle_1q);
- float tan_1q_rad = tan(angle_1q_rad);
- float a = tan_1q_rad / (tan_1q_rad + 1.0);
- float scale = sqrt(2.0*a*a - 2.0*a + 1.0);
- fade_uv = fade_uv - 0.5;
- fade_uv = rotate_uv(fade_uv, angle_rad);
- fade_uv = fade_uv * scale;
- fade_uv = fade_uv + 0.5;
- float alpha = step(
- 1.0 - time,
- 1.0 - fade_uv.x
- );
- fragColor.xyz = mix(
- texture(iChannel0, uv).xyz,
- vec3(0.00),
- alpha
- );
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement