diff --git a/README.md b/README.md index 0bda35c13b788c32629aee0ca0d64773e2fb41c7..17f8b15fcf4190c499a9063391881c7cf31c59a9 100644 --- a/README.md +++ b/README.md @@ -24,20 +24,20 @@ const materials = [ >그리고 더 나아가 주변 환경이 비치도록 Reflection 을 이용할 수도 있습니다. const path = 'https://raw.githubusercontent.com/tamani-coding/threejs-texture-maps/main/dist/Metal_Tiles_003_'; - const urls = [ - path+'ambientOcclusion.jpg', path+'basecolor.jpg', - path+'metallic.jpg', path+'metallic.jpg', - path+'normal.jpg', path+'roughness.jpg' - ]; +const urls = [ + path+'ambientOcclusion.jpg', path+'basecolor.jpg', + path+'metallic.jpg', path+'metallic.jpg', + path+'normal.jpg', path+'roughness.jpg' + ]; - const reflectionCube = new THREE.CubeTextureLoader().load( urls ); - scene.background = reflectionCube; - const material1 = new THREE.MeshPhongMaterial( - { color: 0x00ffff, envMap: reflectionCube, combine: THREE.MixOperation, reflectivity: 0.5 } ); - const material2 = new THREE.MeshLambertMaterial( - { color: 0xffffff, envMap: reflectionCube, combine: THREE.MixOperation, reflectivity: 0.5 } ); - const material3 = new THREE.MeshLambertMaterial( - { color: 0xffff00, envMap: reflectionCube, combine: THREE.MixOperation, reflectivity: 0.5 } ); +const reflectionCube = new THREE.CubeTextureLoader().load( urls ); +scene.background = reflectionCube; +const material1 = new THREE.MeshPhongMaterial( +{ color: 0x00ffff, envMap: reflectionCube, combine: THREE.MixOperation, reflectivity: 0.5 } ); +const material2 = new THREE.MeshLambertMaterial( +{ color: 0xffffff, envMap: reflectionCube, combine: THREE.MixOperation, reflectivity: 0.5 } ); +const material3 = new THREE.MeshLambertMaterial( +{ color: 0xffff00, envMap: reflectionCube, combine: THREE.MixOperation, reflectivity: 0.5 } ); > 여기서 반사가 얼마나 되는지 조절하려면 reflectivity를 수정하면 됩니다. > envMap를 reflectionCube로 설정했기에 반사를 활용할 수 있습니다.