LoginSignup
0
0

plunkerでshadertoy sandbox その 6

Last updated at Posted at 2024-01-21

概要

plunkerでshadertoyのglsl動かしてみた。

参考にしたページ

写真

image.png

サンプルコード

precision mediump float;
uniform vec2 iResolution;
uniform float iGlobalTime;
uniform float iChannelTime[4];

void mainImage(out vec4 fragColor, in vec2 fragCoord) {
    vec2 n, 
			q, 
			p = (fragCoord - iResolution.xy * 0.5) / iResolution.y;
    float d = dot(p, p), 
			S = 9.0, 
			a = 0.0, 
			j = 0.0;
    for (float i = 0.0; i < 30.0; i++) 
		{
        mat2 m = mat2(cos(5.0), -sin(5.0), sin(5.0), cos(5.0));
        p *= m; 
				n *= m;
        q = p * S + iGlobalTime * 4.0 + sin(iGlobalTime * 4.0 - d * 6.0) * 0.8 + j + n;
        a += dot(cos(q) / S, vec2(0.2));
        n -= sin(q);
        S *= 1.2;
        j += 1.0;
    }
    fragColor = (a + 0.2) * vec4(4.0, 2.0, 1.0, 0.0) + a + a - d;
}

void main() {
	vec4 color = vec4(0.0, 0.0, 0.0, 1.0);
	mainImage(color, gl_FragCoord.xy);
	color.w = 1.0;
	gl_FragColor = color;
}

成果物

以上。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0