|
60 | 60 | } |
61 | 61 |
|
62 | 62 | camera = new THREE.PerspectiveCamera( 70, window.innerWidth / window.innerHeight, 0.1, 10 ); |
63 | | - camera.position.z = 2; |
| 63 | + camera.position.z = 1.5; |
64 | 64 |
|
65 | 65 | scene = new THREE.Scene(); |
66 | 66 | scene.background = new THREE.Color( 0x222222 ); |
67 | 67 |
|
68 | 68 | // lights |
69 | 69 |
|
70 | | - const sphereGeometry = new THREE.SphereGeometry( 0.02, 16, 8 ); |
| 70 | + const sphereGeometry = new THREE.SphereGeometry( 0.01, 16, 8 ); |
71 | 71 |
|
72 | | - const addLight = ( hexColor, intensity = 2, distance = 1 ) => { |
| 72 | + const addLight = ( hexColor ) => { |
73 | 73 |
|
74 | 74 | const material = new MeshStandardNodeMaterial(); |
75 | 75 | material.colorNode = color( hexColor ); |
76 | 76 | material.lightsNode = lights(); // ignore scene lights |
77 | 77 |
|
78 | 78 | const mesh = new THREE.Mesh( sphereGeometry, material ); |
79 | 79 |
|
80 | | - const light = new THREE.PointLight( hexColor, intensity, distance ); |
| 80 | + const light = new THREE.PointLight( hexColor, 0.1, 0.8 ); |
81 | 81 | light.add( mesh ); |
82 | 82 |
|
83 | 83 | scene.add( light ); |
|
98 | 98 |
|
99 | 99 | const points = []; |
100 | 100 |
|
101 | | - for ( let i = 0; i < 3000; i ++ ) { |
| 101 | + for ( let i = 0; i < 1_000_000; i ++ ) { |
102 | 102 |
|
103 | 103 | const point = new THREE.Vector3().random().subScalar( 0.5 ).multiplyScalar( 2 ); |
104 | 104 | points.push( point ); |
|
126 | 126 | renderer.setPixelRatio( window.devicePixelRatio ); |
127 | 127 | renderer.setSize( window.innerWidth, window.innerHeight ); |
128 | 128 | renderer.setAnimationLoop( animate ); |
129 | | - renderer.toneMappingNode = toneMapping( THREE.LinearToneMapping, 1 ); |
| 129 | + renderer.toneMappingNode = toneMapping( THREE.NeutralToneMapping, 1 ); |
130 | 130 | document.body.appendChild( renderer.domElement ); |
131 | 131 |
|
132 | 132 | // controls |
|
167 | 167 | light3.position.y = Math.cos( time * 0.3 ) * scale; |
168 | 168 | light3.position.z = Math.sin( time * 0.5 ) * scale; |
169 | 169 |
|
| 170 | + scene.rotation.y = time * 0.6; |
| 171 | + |
170 | 172 | renderer.render( scene, camera ); |
171 | 173 |
|
172 | 174 | } |
|
0 commit comments