0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

plunkerでshadertoy sandbox その34

Last updated at Posted at 2025-11-17

概要

plunkerでshadertoyのglsl動かしてみた。
TUTORIAL、やってみる。

TUTORIAL 25

PLASMA EFFECT

void mainImage(out vec4 fragColor, in vec2 fragCoord) {
	vec2 p = vec2(fragCoord.xy / iResolution.xy);
	vec2 r = 2.0 * vec2(fragCoord.xy - 0.5 * iResolution.xy) / iResolution.y;
	float t = iGlobalTime;
	r = r * 8.0;
	float v1 = sin(r.x + t);
	float v2 = sin(r.y + t);
	float v3 = sin(r.x + r.y + t);
	float v4 = sin(sqrt(r.x * r.x + r.y * r.y) + 1.7 * t);
	float v = v1 + v2 + v3 + v4;
	vec3 ret;
	if (p.x < 1. / 10.)
	{
		ret = vec3(v1);
	}
	else if (p.x < 2. / 10.)
	{
		ret = vec3(v2);
	}
	else if (p.x < 3. / 10.)
	{
		ret = vec3(v3);
	}
	else if (p.x < 4. / 10.)
	{
		ret = vec3(v4);
	}
	else if (p.x < 5. / 10.)
	{
		ret = vec3(v);
	}
	else if (p.x < 6. / 10.)
	{
		ret = vec3(sin(2.*v));
	}
	else if (p.x < 10. / 10.)
	{
		v *= 1.0;
		ret = vec3(sin(v), sin(v + 0.5 * PI), sin(v + 1.0 * PI));
	}
	ret = 0.5 + 0.5 * ret;
	vec3 pixel = ret;
	fragColor = vec4(pixel, 1.);
}

写真

image.png

成果物

以上。

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

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?