{"id":15797,"date":"2025-03-21T09:49:53","date_gmt":"2025-03-21T00:49:53","guid":{"rendered":"http:\/\/www.gisdeveloper.co.kr\/?p=15797"},"modified":"2025-03-21T09:50:11","modified_gmt":"2025-03-21T00:50:11","slug":"glsl-%eb%ac%b4%ec%a7%80%ea%b0%9c-%ec%83%89-%ed%91%9c%ed%98%84","status":"publish","type":"post","link":"http:\/\/www.gisdeveloper.co.kr\/?p=15797","title":{"rendered":"GLSL, \ubb34\uc9c0\uac1c \uc0c9 \ud45c\ud604"},"content":{"rendered":"<p>\uc218\ud3c9\uc73c\ub85c 7\uac1c\uc758 \ubb34\uc9c0\uac1c \uc0c9\uc744 \ud45c\ud604\ud558\ub294 \ud504\ub808\uadf8\uba3c\ud2b8 \uc250\uc5b4\ub514 \ucf54\ub4dc\uc785\ub2c8\ub2e4. \ubc30\uc5f4 \uc790\ub8cc\ud615\uc744 \uc0ac\uc6a9\ud558\uace0 \uc788\ub294 \uc608\uc81c \ucf54\ub4dc\uc785\ub2c8\ub2e4.<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"glsl\">\r\nuniform vec2 uResolution;\r\nuniform float uTime;\r\nuniform vec2 uMouse;\r\n\r\nvec3 rainbow(float t) {\r\n    vec3 colors[7];\r\n\r\n    colors[0] = vec3(1.0, 0.0, 0.0); \/\/ \ube68\uac15\r\n    colors[1] = vec3(1.0, 0.5, 0.0); \/\/ \uc8fc\ud669\r\n    colors[2] = vec3(1.0, 1.0, 0.0); \/\/ \ub178\ub791\r\n    colors[3] = vec3(0.0, 1.0, 0.0); \/\/ \ucd08\ub85d\r\n    colors[4] = vec3(0.0, 0.0, 1.0); \/\/ \ud30c\ub791\r\n    colors[5] = vec3(0.29, 0.0, 0.51); \/\/ \ub0a8\uc0c9\r\n    colors[6] = vec3(0.56, 0.0, 1.0); \/\/ \ubcf4\ub77c\r\n    \r\n    int index = int(t * 7.0);\r\n    return colors[index];\r\n}\r\n\r\nvoid main() {\r\n    vec2 st = gl_FragCoord.xy\/uResolution.xy;\r\n    vec3 color = rainbow(st.x);\r\n        \r\n    gl_FragColor = vec4(color,1.0);\r\n}\r\n<\/pre>\n<p>\uacb0\uacfc\ub294 \ub2e4\uc74c\uacfc \uac19\uc2b5\ub2c8\ub2e4.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/www.gisdeveloper.co.kr\/wp-content\/uploads\/2025\/03\/\u1109\u1173\u110f\u1173\u1105\u1175\u11ab\u1109\u1163\u11ba-2025-03-21-09.49.17.png\" alt=\"\" width=\"1148\" height=\"1242\" class=\"aligncenter size-full wp-image-15798\" \/><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\uc218\ud3c9\uc73c\ub85c 7\uac1c\uc758 \ubb34\uc9c0\uac1c \uc0c9\uc744 \ud45c\ud604\ud558\ub294 \ud504\ub808\uadf8\uba3c\ud2b8 \uc250\uc5b4\ub514 \ucf54\ub4dc\uc785\ub2c8\ub2e4. \ubc30\uc5f4 \uc790\ub8cc\ud615\uc744 \uc0ac\uc6a9\ud558\uace0 \uc788\ub294 \uc608\uc81c \ucf54\ub4dc\uc785\ub2c8\ub2e4. uniform vec2 uResolution; uniform float uTime; uniform vec2 uMouse; vec3 rainbow(float t) { vec3 colors[7]; colors[0] = vec3(1.0, 0.0, 0.0); \/\/ \ube68\uac15 colors[1] = vec3(1.0, 0.5, 0.0); \/\/ \uc8fc\ud669 colors[2] = vec3(1.0, 1.0, 0.0); \/\/ \ub178\ub791 colors[3] = vec3(0.0, 1.0, 0.0); &hellip; <\/p>\n<p class=\"link-more\"><a href=\"http:\/\/www.gisdeveloper.co.kr\/?p=15797\" class=\"more-link\">\ub354 \ubcf4\uae30<span class=\"screen-reader-text\"> &#8220;GLSL, \ubb34\uc9c0\uac1c \uc0c9 \ud45c\ud604&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[152],"tags":[],"class_list":["post-15797","post","type-post","status-publish","format-standard","hentry","category-glsl"],"_links":{"self":[{"href":"http:\/\/www.gisdeveloper.co.kr\/index.php?rest_route=\/wp\/v2\/posts\/15797","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/www.gisdeveloper.co.kr\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.gisdeveloper.co.kr\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.gisdeveloper.co.kr\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.gisdeveloper.co.kr\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=15797"}],"version-history":[{"count":3,"href":"http:\/\/www.gisdeveloper.co.kr\/index.php?rest_route=\/wp\/v2\/posts\/15797\/revisions"}],"predecessor-version":[{"id":15801,"href":"http:\/\/www.gisdeveloper.co.kr\/index.php?rest_route=\/wp\/v2\/posts\/15797\/revisions\/15801"}],"wp:attachment":[{"href":"http:\/\/www.gisdeveloper.co.kr\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=15797"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.gisdeveloper.co.kr\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=15797"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.gisdeveloper.co.kr\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=15797"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}