{"id":532,"date":"2007-10-05T14:44:00","date_gmt":"2007-10-05T14:44:00","guid":{"rendered":"http:\/\/www.gisdeveloper.co.kr\/?p=532"},"modified":"2017-01-29T11:03:18","modified_gmt":"2017-01-29T02:03:18","slug":"opengl-shader-24","status":"publish","type":"post","link":"http:\/\/www.gisdeveloper.co.kr\/?p=532","title":{"rendered":"OpenGL Shader &#8211; 24"},"content":{"rendered":"<p><strong>GLSL \uc608\uc81c : Lighting(\uad11\uc6d0) &#8211; 1\/6<\/strong><br \/>\n\uc6d0\ubb38 : <a href=\"http:\/\/www.lighthouse3d.com\/opengl\/glsl\/index.php?lights\">http:\/\/www.lighthouse3d.com\/opengl\/glsl\/index.php?lights<\/a><\/p>\n<p>OpenGL\uc5d0\ub294 \uc138\uac00\uc9c0 \uc885\ub958\uc758 \ube5b\uc774 \uc788\uc2b5\ub2c8\ub2e4: <strong>Directional, Point, Spotlight.<\/strong> \uc774 \uc7a5\uc5d0\uc11c\ub294 Directional \uad11\uc6d0\uc744 \uad6c\ud604\ud558\ub294 \uac83\uc73c\ub85c \uc2dc\uc791\ud574 \ubcf4\uaca0\ub2e4. \uba3c\uc800 GLSL\uc744 \uc774\uc6a9\ud574\uc11c OpenGL\uc758 \uad11\uc6d0\ud6a8\uacfc\ub97c \ubaa8\ubc29\ud574 \ubcf4\uaca0\ub2e4.<\/p>\n<p>\uc6b0\ub9ac\ub294 Ambient \ube5b\uc73c\ub85c \uc2dc\uc791\ud574\uc11c GLSL\uc744 \uc810\uc9c4\uc801\uc73c\ub85c \ubc1c\uc804\uc2dc\ucf1c Specular \ube5b\uae4c\uc9c0 \uad6c\ud604\ud574\ubcf4\uaca0\ub2e4.<br \/>\n<img loading=\"lazy\" decoding=\"async\" class=\"aligncenter\" src=\"http:\/\/www.gisdeveloper.co.kr\/wp-content\/uploads\/1\/1153351090.jpg\" alt=\"\" width=\"510\" height=\"123\" \/><br \/>\n\ub2e4\uc74c\uc73c\ub85c \uc880\ub354 \ub098\uc740 \uacb0\uacfc\ub97c \uc81c\uacf5\ud558\ub294 Lighting Per Pixel\uc744 \uad6c\ud604\ud574\ubcf4\uaca0\ub2e4.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter\" src=\"http:\/\/www.gisdeveloper.co.kr\/wp-content\/uploads\/1\/1238530625.gif\" alt=\"\" width=\"193\" height=\"128\" \/>\uadf8\ub9ac\uace0 \uc774 \ub2e4\uc74c\uc73c\ub85c\ub294, Point\uc640 Spot Lighting Per Pixel\uc744 \uad6c\ud604\ud574\ubcf4\uaca0\ub2e4. \ube5b\uc5d0 \ub300\ud55c \ucd1d 6\uac1c\uc758 \uc7a5\uc740 Directional Lights\uc5d0 \uad00\ub828\ub41c \uc7a5\uc5d0\uc11c\uc758 \ucf54\ub4dc\uc758 \ub0b4\uc6a9\uc744 \uacf5\ud1b5\uc801\uc73c\ub85c \uc0ac\uc6a9\ud560 \uac83\uc774\ub2e4.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter\" src=\"http:\/\/www.gisdeveloper.co.kr\/wp-content\/uploads\/1\/1237216336.jpg\" alt=\"\" width=\"374\" height=\"154\" \/><\/p>\n<p>\ud230\uc250\uc774\ub354\uc5d0\uc11c \uc5b8\uae09\ud588\ub4ef\uc774, GLSL\uc740 \uad11\uc6d0 \uc124\uc815\uc5d0 \ub300\ud55c \ub370\uc774\ud130\ub97c \ud3ec\ud568\ud558\ub294 OpenGL \uc0c1\ud0dc\uac12\uc5d0 \uc811\uadfc\ud560 \uc218 \uc788\ub2e4. \uc774 \ub370\uc774\ud130\ub294 \uad11\uc6d0 \uc124\uc815\uc5d0 \ub300\ud55c \uc138\uc138\ud55c \ub0b4\uc6a9\uc744 \ub2f4\uace0 \uc788\ub294 \uad6c\uc870\uccb4\ud615\uc2dd\uc758 \uc804\uc5ed\ubcc0\uc218\uc774\ub2e4.<\/p>\n<pre><code class=\"html\">struct gl_LightSourceParameters {\r\n    vec4 ambient;\r\n    vec4 diffuse;\r\n    vec4 specular;\r\n    vec4 position;\r\n    vec4 halfVector;\r\n    vec3 spotDirection;\r\n    float spotExponent;\r\n    float spotCutoff; \/\/ (range: [0.0, 90.0], 180.0)\r\n    float spotCosCutoff; \/\/ (range: [1.0, 0.0], -1.0)\r\n    float constantAttenuation;\r\n    float linearAttenuation;\r\n    float quadraticAttenuation;\r\n};\r\n\r\nuniform gl_LightSourceParameters gl_LightSource[gl_MaxLights];\r\n\r\nstruct gl_LightModelParameters {\r\n    vec4 ambient;\r\n};\r\n\r\nuniform gl_LightModelParameters gl_LightModel;<\/code><\/pre>\n<p>\uc7ac\uc9c8 \uc18d\uc131\ub3c4 \uc5ed\uc2dc GLSL\uc5d0\uc11c \uc811\uadfc\ud560 \uc218 \uc788\ub2e4.<\/p>\n<pre><code class=\"html\">struct gl_MaterialParameters {\r\n    vec4 emission;\r\n    vec4 ambient;\r\n    vec4 diffuse;\r\n    vec4 specular;\r\n    float shiness;\r\n};\r\n\r\nuniform gl_MaterialParameters gl_FrontMaterial;\r\nuniform gl_MaterialParameters gl_BackMaterial;<\/code><\/pre>\n<p>\uad11\uc6d0\uacfc \uc7ac\uc9c8\uc5d0 \ub300\ud55c \uc774 \ud30c\ub77c\uba54\ud130\ub4e4\uc758 \ub300\ubd80\ubd84\uc758 \uc0ac\uc6a9\uc740 OpenGL \uc5b4\ud50c\ub9ac\ucf00\uc774\uc158\uc5d0\uc11c \uc0ac\uc6a9\ud558\ub294 \uac83\uacfc \uc720\uc0ac\ud558\ub2e4. \uc774\uc81c \uc6b0\ub9ac\ub294 \uc774\ub4e4 \uc18d\uc131\uc744 \uc0ac\uc6a9\ud574\uc11c Directional \uad11\uc6d0\uc744 \uad6c\ud604\ud574 \ubcfc \uac83\uc774\ub2e4.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>GLSL \uc608\uc81c : Lighting(\uad11\uc6d0) &#8211; 1\/6 \uc6d0\ubb38 : http:\/\/www.lighthouse3d.com\/opengl\/glsl\/index.php?lights OpenGL\uc5d0\ub294 \uc138\uac00\uc9c0 \uc885\ub958\uc758 \ube5b\uc774 \uc788\uc2b5\ub2c8\ub2e4: Directional, Point, Spotlight. \uc774 \uc7a5\uc5d0\uc11c\ub294 Directional \uad11\uc6d0\uc744 \uad6c\ud604\ud558\ub294 \uac83\uc73c\ub85c \uc2dc\uc791\ud574 \ubcf4\uaca0\ub2e4. \uba3c\uc800 GLSL\uc744 \uc774\uc6a9\ud574\uc11c OpenGL\uc758 \uad11\uc6d0\ud6a8\uacfc\ub97c \ubaa8\ubc29\ud574 \ubcf4\uaca0\ub2e4. \uc6b0\ub9ac\ub294 Ambient \ube5b\uc73c\ub85c \uc2dc\uc791\ud574\uc11c GLSL\uc744 \uc810\uc9c4\uc801\uc73c\ub85c \ubc1c\uc804\uc2dc\ucf1c Specular \ube5b\uae4c\uc9c0 \uad6c\ud604\ud574\ubcf4\uaca0\ub2e4. \ub2e4\uc74c\uc73c\ub85c \uc880\ub354 \ub098\uc740 \uacb0\uacfc\ub97c \uc81c\uacf5\ud558\ub294 Lighting Per Pixel\uc744 \uad6c\ud604\ud574\ubcf4\uaca0\ub2e4. \uadf8\ub9ac\uace0 \uc774 \ub2e4\uc74c\uc73c\ub85c\ub294, Point\uc640 &hellip; <\/p>\n<p class=\"link-more\"><a href=\"http:\/\/www.gisdeveloper.co.kr\/?p=532\" class=\"more-link\">\ub354 \ubcf4\uae30<span class=\"screen-reader-text\"> &#8220;OpenGL Shader &#8211; 24&#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":[4],"tags":[3,25],"class_list":["post-532","post","type-post","status-publish","format-standard","hentry","category-opengl","tag-opengl","tag-shader"],"_links":{"self":[{"href":"http:\/\/www.gisdeveloper.co.kr\/index.php?rest_route=\/wp\/v2\/posts\/532","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=532"}],"version-history":[{"count":1,"href":"http:\/\/www.gisdeveloper.co.kr\/index.php?rest_route=\/wp\/v2\/posts\/532\/revisions"}],"predecessor-version":[{"id":3562,"href":"http:\/\/www.gisdeveloper.co.kr\/index.php?rest_route=\/wp\/v2\/posts\/532\/revisions\/3562"}],"wp:attachment":[{"href":"http:\/\/www.gisdeveloper.co.kr\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=532"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.gisdeveloper.co.kr\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=532"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.gisdeveloper.co.kr\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=532"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}