|
@@ -110,21 +110,23 @@
|
|
|
metalness: 1
|
|
|
} );
|
|
|
|
|
|
- const gui = new GUI();
|
|
|
- gui.add( material, 'roughness', 0, 1 );
|
|
|
- gui.add( material, 'metalness', 0, 1 );
|
|
|
- gui.add( renderer, 'toneMappingExposure', 0, 2 ).name( 'exposure' );
|
|
|
-
|
|
|
sphere = new THREE.Mesh( new THREE.IcosahedronGeometry( 15, 8 ), material );
|
|
|
scene.add( sphere );
|
|
|
|
|
|
- const material2 = new THREE.MeshStandardMaterial( {
|
|
|
+ const material1 = new Nodes.MeshStandardNodeMaterial( {
|
|
|
+ map: uvTexture,
|
|
|
+ roughness: 0.1,
|
|
|
+ metalness: 0,
|
|
|
+ } );
|
|
|
+
|
|
|
+ const material2 = new Nodes.MeshStandardNodeMaterial( {
|
|
|
map: uvTexture,
|
|
|
roughness: 0.1,
|
|
|
- metalness: 0
|
|
|
+ metalness: 0,
|
|
|
+ envMap: texture,
|
|
|
} );
|
|
|
|
|
|
- cube = new THREE.Mesh( new THREE.BoxGeometry( 15, 15, 15 ), material2 );
|
|
|
+ cube = new THREE.Mesh( new THREE.BoxGeometry( 15, 15, 15 ), material1 );
|
|
|
scene.add( cube );
|
|
|
|
|
|
torus = new THREE.Mesh( new THREE.TorusKnotGeometry( 8, 3, 128, 16 ), material2 );
|
|
@@ -135,6 +137,13 @@
|
|
|
controls = new OrbitControls( camera, renderer.domElement );
|
|
|
controls.autoRotate = true;
|
|
|
|
|
|
+ const gui = new GUI();
|
|
|
+ gui.add( material, 'roughness', 0, 1 );
|
|
|
+ gui.add( material, 'metalness', 0, 1 );
|
|
|
+ gui.add( renderer, 'toneMappingExposure', 0, 2 ).name( 'exposure' );
|
|
|
+ gui.add( scene, 'environmentIntensity', 0, 1 );
|
|
|
+ gui.add( material2, 'envMapIntensity', 0, 1 );
|
|
|
+
|
|
|
}
|
|
|
|
|
|
function onWindowResized() {
|