Created
March 1, 2021 22:33
-
-
Save BABAK0T0/bebfe378476ea19bb4bcceb2a6dbc90c to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * The environment map is like an image of what's surrounding the scene. | |
| * You can use it to add reflection or refraction to your objects. | |
| * It can also be used as lighting information. | |
| **/ | |
| const material = new THREE.MeshStandardMaterial(); | |
| material.metalness = 0.7; | |
| material.roughness = 0.2; | |
| const cubeTextureLoader = new THREE.CubeTextureLoader(); | |
| const environmentMapTexture = cubeTextureLoader.load([ | |
| '/textures/environmentMaps/0/px.jpg', | |
| '/textures/environmentMaps/0/nx.jpg', | |
| '/textures/environmentMaps/0/py.jpg', | |
| '/textures/environmentMaps/0/ny.jpg', | |
| '/textures/environmentMaps/0/pz.jpg', | |
| '/textures/environmentMaps/0/nz.jpg' | |
| ]); | |
| material.envMap = environmentMapTexture; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment