{"id":11742,"date":"2021-11-15T17:34:06","date_gmt":"2021-11-15T08:34:06","guid":{"rendered":"http:\/\/www.gisdeveloper.co.kr\/?p=11742"},"modified":"2022-10-30T08:37:50","modified_gmt":"2022-10-29T23:37:50","slug":"three-js%ec%97%90%ec%84%9c-%ec%9c%a0%eb%a6%ac-%ec%9e%ac%ec%a7%88%ec%97%90-%eb%8f%99%ec%a0%81-%ed%99%98%ea%b2%bd%eb%a7%b5-%ec%a0%81%ec%9a%a9%ed%95%98%ea%b8%b0","status":"publish","type":"post","link":"http:\/\/www.gisdeveloper.co.kr\/?p=11742","title":{"rendered":"three.js\uc5d0\uc11c \uc720\ub9ac \uc7ac\uc9c8\uc5d0 \ub3d9\uc801 \ud658\uacbd\ub9f5 \uc801\uc6a9\ud558\uae30"},"content":{"rendered":"<p>three.js\uc5d0\uc11c \uc720\ub9ac \uc7ac\uc9c8\uc744 \ud45c\ud604\ud558\uae30 \uc704\ud574\uc11c MeshPhysicalMaterial\ub97c \uc0ac\uc6a9\ud569\ub2c8\ub2e4. \uad74\uc808\ub960(ior)\uacfc \uc720\ub9ac\uc758 \ub450\uaed8(thickness)\ub3c4 \ud45c\ud604\ud560 \uc218 \uc788\uc2b5\ub2c8\ub2e4. \uadf8\ub7ec\ub098 \ub9e4\uc26c\uc5d0 MeshPhysicalMaterial\ub97c \uc0ac\uc6a9\ud558\uc5ec \uc720\ub9ac \uc7ac\uc9c8\uc744 \uc801\uc6a9\ud558\uace0 \uc815\uc801\uc778 \ud658\uacbd \ub9f5\uacfc \ub3d9\uc801\uc778 \ud658\uacbd \ub9f5\uc744 \uc801\uc6a9\ud574 \ubcf4\uba74 \uc815\uc801 \ud658\uacbd\ub9f5\uc740 \ubb38\uc81c\uac00 \uc5c6\uc73c\ub098 \ub3d9\uc801 \ud658\uacbd\ub9f5\uc758 \uacbd\uc6b0 \ud45c\ud604\ub418\uc9c0 \uc54a\uc2b5\ub2c8\ub2e4.<\/p>\n<p>\uc774\ub294 MeshPhysicalMaterial\uc5d0\uc11c \ub3d9\uc801 \ud658\uacbd\ub9f5\uc744 \uc801\uc6a9\ud558\uae30 \uc704\ud574\uc11c\ub294 \ubc18\ub4dc\uc2dc PMREM \ud615\uc2dd\uc73c\ub85c \ub9cc\ub4e4\uc5b4\uc9c4 \ud14d\uc2a4\uccd0\ub9f5\uc744 \uc0ac\uc6a9\ud574\uc57c \ud55c\ub2e4\uace0 \ud569\ub2c8\ub2e4. \uc989 WebGLCubeRenderTarget\uc73c\ub85c\ubd80\ud130 \ud14d\uc2a4\uccd0\ub9f5\uc744 \ubc14\ub85c \uc7ac\uc9c8\uc758 envMap \uc18d\uc131\uc5d0 \uc9c0\uc815\ud574\uc11c\ub294 \uc548\ub418\uace0 PMREMGenerator \ud074\ub798\uc2a4\ub97c \uc0ac\uc6a9\ud574\uc5ec \ubcc0\ud658\ub41c \ud14d\uc2a4\uccd0\ub9f5\uc744 envMap \uc18d\uc131\uc5d0 \uc9c0\uc815\ud574\uc918\uc57c \ud569\ub2c8\ub2e4.<\/p>\n<p>\uc77c\ubc18\uc801\uc778 \ub3d9\uc801 \ud658\uacbd\ub9f5 \uc0dd\uc131\uacfc PMREM \ud615\uc2dd\uc758 \ud658\uacbd\ub9f5 \uac00\uacf5\uc744 \uc704\ud55c \uac1d\uccb4\uc5d0 \ub300\ud55c \ucf54\ub4dc\ub294 \ub2e4\uc74c\uacfc \uac19\uc2b5\ub2c8\ub2e4.<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"js\">\r\nconst sphereRenderTarget = new THREE.WebGLCubeRenderTarget(1024, {\r\n    format: THREE.RGBFormat,\r\n    generateMipmaps: true,\r\n    minFilter: THREE.LinearMipmapLinearFilter\r\n});\r\n\r\nsphereRenderTarget._pmremGen = new THREE.PMREMGenerator(this._renderer);\r\nconst sphereCamera = new THREE.CubeCamera(0.01, 10, sphereRenderTarget);\r\n<\/pre>\n<p>\uadf8\ub9ac\uace0 \ud658\uacbd\ub9f5 \uc9c0\uc815\uc744 \uc704\ud55c \ub9e4\uc26c\uc5d0 CubeCamera\ub97c \ucd94\uac00\ud569\ub2c8\ub2e4.<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"js\">\r\nsphere.add(sphereCamera);\r\nthis._sphere = sphere;\r\n<\/pre>\n<p>\uadf8\ub9ac\uace0 \ub80c\ub354\ub9c1 \uc2dc\uc5d0 \ud658\uacbd\ub9f5\uc744 \uc5c5\ub370\uc774\ud2b8 \ud574\uc918\uc57c \ud569\ub2c8\ub2e4.<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"js\">\r\nif(this._sphere) {\r\n    this._sphere.visible = false;\r\n\r\n    const cubeCamera = this._sphere.children[0];\r\n    cubeCamera.update(this._renderer, this._scene);\r\n    const renderTarget = cubeCamera.renderTarget._pmremGen.fromCubemap(\r\n        cubeCamera.renderTarget.texture);\r\n    this._sphere.material.envMap = renderTarget.texture;\r\n    this._sphere.visible = true;\r\n}\r\n<\/pre>\n<p>\uc2e4\ud589 \uacb0\uacfc\ub294 \ub2e4\uc74c\uacfc \uac19\uc774 \uc815\uc801\uc778 \ud658\uacbd\ub9f5\uacfc \ub3d9\uc801\uc778 \ud658\uacbd\ub9f5 \ubaa8\ub450 \uc798\ud45c\ud604\ub418\ub294 \uac83\uc744 \ud655\uc778\ud560 \uc218 \uc788\uc2b5\ub2c8\ub2e4.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/www.gisdeveloper.co.kr\/wp-content\/uploads\/2021\/11\/meshphysicalmaterial_envmap.jpg\" alt=\"\" width=\"1935\" height=\"1312\" class=\"aligncenter size-full wp-image-11755\" \/><\/p>\n<p>\uc804\uccb4 \ucf54\ub4dc\ub294 \uc544\ub798\ub97c \ud074\ub9ad\ud574\uc11c \ub2e4\uc6b4\ub85c\ub4dc \ubc1b\uc744 \uc218 \uc788\uc2b5\ub2c8\ub2e4. (three.js \ub77c\uc774\ube0c\ub7ec\ub9ac\ub294 \ud3ec\ud568\ub418\uc5b4 \uc788\uc9c0 \uc54a\uc2b5\ub2c8\ub2e4)<\/p>\n<p style=\"text-align: center;\"><a href=\"http:\/\/www.gisdeveloper.co.kr\/wp-content\/uploads\/2021\/11\/dynamic_envmap_glass.zip\"\"><br \/>\n<img decoding=\"async\" src=\"http:\/\/www.gisdeveloper.co.kr\/wp-content\/uploads\/1\/1035990848.png\"><\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>three.js\uc5d0\uc11c \uc720\ub9ac \uc7ac\uc9c8\uc744 \ud45c\ud604\ud558\uae30 \uc704\ud574\uc11c MeshPhysicalMaterial\ub97c \uc0ac\uc6a9\ud569\ub2c8\ub2e4. \uad74\uc808\ub960(ior)\uacfc \uc720\ub9ac\uc758 \ub450\uaed8(thickness)\ub3c4 \ud45c\ud604\ud560 \uc218 \uc788\uc2b5\ub2c8\ub2e4. \uadf8\ub7ec\ub098 \ub9e4\uc26c\uc5d0 MeshPhysicalMaterial\ub97c \uc0ac\uc6a9\ud558\uc5ec \uc720\ub9ac \uc7ac\uc9c8\uc744 \uc801\uc6a9\ud558\uace0 \uc815\uc801\uc778 \ud658\uacbd \ub9f5\uacfc \ub3d9\uc801\uc778 \ud658\uacbd \ub9f5\uc744 \uc801\uc6a9\ud574 \ubcf4\uba74 \uc815\uc801 \ud658\uacbd\ub9f5\uc740 \ubb38\uc81c\uac00 \uc5c6\uc73c\ub098 \ub3d9\uc801 \ud658\uacbd\ub9f5\uc758 \uacbd\uc6b0 \ud45c\ud604\ub418\uc9c0 \uc54a\uc2b5\ub2c8\ub2e4. \uc774\ub294 MeshPhysicalMaterial\uc5d0\uc11c \ub3d9\uc801 \ud658\uacbd\ub9f5\uc744 \uc801\uc6a9\ud558\uae30 \uc704\ud574\uc11c\ub294 \ubc18\ub4dc\uc2dc PMREM \ud615\uc2dd\uc73c\ub85c \ub9cc\ub4e4\uc5b4\uc9c4 \ud14d\uc2a4\uccd0\ub9f5\uc744 \uc0ac\uc6a9\ud574\uc57c \ud55c\ub2e4\uace0 \ud569\ub2c8\ub2e4. \uc989 WebGLCubeRenderTarget\uc73c\ub85c\ubd80\ud130 \ud14d\uc2a4\uccd0\ub9f5\uc744 \ubc14\ub85c &hellip; <\/p>\n<p class=\"link-more\"><a href=\"http:\/\/www.gisdeveloper.co.kr\/?p=11742\" class=\"more-link\">\ub354 \ubcf4\uae30<span class=\"screen-reader-text\"> &#8220;three.js\uc5d0\uc11c \uc720\ub9ac \uc7ac\uc9c8\uc5d0 \ub3d9\uc801 \ud658\uacbd\ub9f5 \uc801\uc6a9\ud558\uae30&#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":[145,139,1],"tags":[],"class_list":["post-11742","post","type-post","status-publish","format-standard","hentry","category-three-js","category-webgl","category-uncategorized"],"_links":{"self":[{"href":"http:\/\/www.gisdeveloper.co.kr\/index.php?rest_route=\/wp\/v2\/posts\/11742","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=11742"}],"version-history":[{"count":16,"href":"http:\/\/www.gisdeveloper.co.kr\/index.php?rest_route=\/wp\/v2\/posts\/11742\/revisions"}],"predecessor-version":[{"id":11761,"href":"http:\/\/www.gisdeveloper.co.kr\/index.php?rest_route=\/wp\/v2\/posts\/11742\/revisions\/11761"}],"wp:attachment":[{"href":"http:\/\/www.gisdeveloper.co.kr\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=11742"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.gisdeveloper.co.kr\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=11742"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.gisdeveloper.co.kr\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=11742"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}