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 その16

Last updated at Posted at 2025-11-11

概要

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

TUTORIAL 7

COORDINATE TRANSFORMATION

void mainImage(out vec4 fragColor, in vec2 fragCoord) {
	vec2 r = vec2(fragCoord.x / iResolution.x, fragCoord.y / iResolution.y);
	vec3 color1 = vec3(0.841, 0.582, 0.594);
	vec3 color2 = vec3(0.884, 0.850, 0.648);
	vec3 color3 = vec3(0.348, 0.555, 0.641);
	vec3 pixel;
	if (r.x < 1.0 / 3.0)
	{
		pixel = color1;
	}
	else if (r.x < 2.0 / 3.0)
	{
		pixel = color2;
	}
	else
	{
		pixel = color3;
	}
	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?