Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- mat2 rotate(float Angle){
- mat2 rotation = mat2(
- vec2( cos(Angle), sin(Angle)),
- vec2(-sin(Angle), cos(Angle))
- );
- return rotation;
- }
- vec4 add (vec4 a, vec4 b){
- return a + b;
- }
- vec4 sub (vec4 a, vec4 b){
- return a - b;
- }
- vec4 mul (vec4 a, vec4 b){
- return (.5+a) * (.5+b);
- }
- vec4 div (vec4 a, vec4 b){
- return a / b;
- }
- vec4 avg (vec4 a, vec4 b){
- return (a / b)/2.;
- }
- void mainImage( out vec4 fragColor, in vec2 fragCoord )
- {
- vec2 uv = fragCoord.xy / iResolution.xy - vec2(0.5);
- vec2 yv = uv * (0.99 - 0.04*length(uv));
- yv *= rotate(0.01 + length(uv)*0.09);
- uv+=vec2(0.5);
- yv+=vec2(0.5);
- fragColor = div(mul(texture(iChannel0,uv) * 0.4,texture(iChannel1,yv)*(0.8+sin(iTime*0.01)*0.1)),vec4(.8)); // * (0.85 + 0.1 * sin(iTime + uv.x));
- fragColor.xz *= rotate(0.09*sin(iTime*.4));
- fragColor.yx *= rotate(-0.09*sin(iTime*.7+0.2));
- // fragColor = max(texture(iChannel0,uv)-vec4(0.4),vec4(0.0)) * 1.0 + texture(iChannel1,yv) * (0.85 + 0.1 * sin(iTime + uv.x));
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement