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のglsl動かしてみた。
TUTORIAL、やってみる。

TUTORIAL 12

DISK

void mainImage(out vec4 fragColor, in vec2 fragCoord) {
	vec2 r = 2.0 * vec2(fragCoord.xy - 0.5 * iResolution.xy) / iResolution.y;
	vec3 bgCol = vec3(0.3);
	vec3 col1 = vec3(0.216, 0.471, 0.698);
	vec3 col2 = vec3(1.00, 0.329, 0.298);
	vec3 col3 = vec3(0.867, 0.910, 0.247);
	vec3 pixel = bgCol;
	float radius = 0.8;
	if (r.x * r.x + r.y * r.y < radius * radius)
	{
		pixel = col1;
	}
	if (length(r) < 0.3)
	{
		pixel = col3;
	}
	vec2 center = vec2(0.9, -0.4);
	vec2 d = r - center;
	if (length(d) < 0.6)
	{
		pixel = col2;
	}
	fragColor = vec4(pixel, 1.0);
}

写真

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?