|
@@ -52,8 +52,8 @@
|
|
container = document.createElement( 'div' );
|
|
container = document.createElement( 'div' );
|
|
document.body.appendChild( container );
|
|
document.body.appendChild( container );
|
|
|
|
|
|
- camera = new THREE.PerspectiveCamera( 27, window.innerWidth / window.innerHeight, 1, 10000 );
|
|
|
|
- camera.position.z = 1000;
|
|
|
|
|
|
+ camera = new THREE.PerspectiveCamera( 27, window.innerWidth / window.innerHeight, 1, 1000 );
|
|
|
|
+ camera.position.z = 100;
|
|
|
|
|
|
scene = new THREE.Scene();
|
|
scene = new THREE.Scene();
|
|
|
|
|
|
@@ -65,7 +65,7 @@
|
|
.load( [ 'px.hdr', 'nx.hdr', 'py.hdr', 'ny.hdr', 'pz.hdr', 'nz.hdr' ],
|
|
.load( [ 'px.hdr', 'nx.hdr', 'py.hdr', 'ny.hdr', 'pz.hdr', 'nz.hdr' ],
|
|
function ( hdrTexture ) {
|
|
function ( hdrTexture ) {
|
|
|
|
|
|
- const geometry = new THREE.SphereGeometry( 80, 64, 32 );
|
|
|
|
|
|
+ const geometry = new THREE.SphereGeometry( 8, 64, 32 );
|
|
|
|
|
|
const offsetNode = timerLocal();
|
|
const offsetNode = timerLocal();
|
|
const customUV = normalWorld.mul( 10 ).add( offsetNode );
|
|
const customUV = normalWorld.mul( 10 ).add( offsetNode );
|
|
@@ -76,8 +76,8 @@
|
|
material.colorNode = mx_noise_vec3( customUV );
|
|
material.colorNode = mx_noise_vec3( customUV );
|
|
|
|
|
|
let mesh = new THREE.Mesh( geometry, material );
|
|
let mesh = new THREE.Mesh( geometry, material );
|
|
- mesh.position.x = - 100;
|
|
|
|
- mesh.position.y = 100;
|
|
|
|
|
|
+ mesh.position.x = - 10;
|
|
|
|
+ mesh.position.y = 10;
|
|
group.add( mesh );
|
|
group.add( mesh );
|
|
|
|
|
|
// right top
|
|
// right top
|
|
@@ -86,8 +86,8 @@
|
|
material.colorNode = mx_cell_noise_float( customUV );
|
|
material.colorNode = mx_cell_noise_float( customUV );
|
|
|
|
|
|
mesh = new THREE.Mesh( geometry, material );
|
|
mesh = new THREE.Mesh( geometry, material );
|
|
- mesh.position.x = 100;
|
|
|
|
- mesh.position.y = 100;
|
|
|
|
|
|
+ mesh.position.x = 10;
|
|
|
|
+ mesh.position.y = 10;
|
|
group.add( mesh );
|
|
group.add( mesh );
|
|
|
|
|
|
// left bottom
|
|
// left bottom
|
|
@@ -96,8 +96,8 @@
|
|
material.colorNode = mx_worley_noise_vec3( customUV );
|
|
material.colorNode = mx_worley_noise_vec3( customUV );
|
|
|
|
|
|
mesh = new THREE.Mesh( geometry, material );
|
|
mesh = new THREE.Mesh( geometry, material );
|
|
- mesh.position.x = - 100;
|
|
|
|
- mesh.position.y = - 100;
|
|
|
|
|
|
+ mesh.position.x = - 10;
|
|
|
|
+ mesh.position.y = - 10;
|
|
group.add( mesh );
|
|
group.add( mesh );
|
|
|
|
|
|
// right bottom
|
|
// right bottom
|
|
@@ -106,8 +106,8 @@
|
|
material.colorNode = mx_fractal_noise_vec3( customUV.mul( .2 ) );
|
|
material.colorNode = mx_fractal_noise_vec3( customUV.mul( .2 ) );
|
|
|
|
|
|
mesh = new THREE.Mesh( geometry, material );
|
|
mesh = new THREE.Mesh( geometry, material );
|
|
- mesh.position.x = 100;
|
|
|
|
- mesh.position.y = - 100;
|
|
|
|
|
|
+ mesh.position.x = 10;
|
|
|
|
+ mesh.position.y = - 10;
|
|
group.add( mesh );
|
|
group.add( mesh );
|
|
|
|
|
|
//
|
|
//
|
|
@@ -122,16 +122,17 @@
|
|
// LIGHTS
|
|
// LIGHTS
|
|
|
|
|
|
particleLight = new THREE.Mesh(
|
|
particleLight = new THREE.Mesh(
|
|
- new THREE.SphereGeometry( 4, 8, 8 ),
|
|
|
|
|
|
+ new THREE.SphereGeometry( 0.4, 8, 8 ),
|
|
new THREE.MeshBasicMaterial( { color: 0xffffff } )
|
|
new THREE.MeshBasicMaterial( { color: 0xffffff } )
|
|
);
|
|
);
|
|
scene.add( particleLight );
|
|
scene.add( particleLight );
|
|
|
|
|
|
- particleLight.add( new THREE.PointLight( 0xffffff, 1 ) );
|
|
|
|
|
|
+ particleLight.add( new THREE.PointLight( 0xffffff, 1000 ) );
|
|
|
|
|
|
- renderer = new THREE.WebGLRenderer();
|
|
|
|
|
|
+ renderer = new THREE.WebGLRenderer( { antialias: true } );
|
|
renderer.setPixelRatio( window.devicePixelRatio );
|
|
renderer.setPixelRatio( window.devicePixelRatio );
|
|
renderer.setSize( window.innerWidth, window.innerHeight );
|
|
renderer.setSize( window.innerWidth, window.innerHeight );
|
|
|
|
+ renderer.useLegacyLights = false;
|
|
container.appendChild( renderer.domElement );
|
|
container.appendChild( renderer.domElement );
|
|
|
|
|
|
//
|
|
//
|
|
@@ -187,9 +188,9 @@
|
|
|
|
|
|
const timer = Date.now() * 0.00025;
|
|
const timer = Date.now() * 0.00025;
|
|
|
|
|
|
- particleLight.position.x = Math.sin( timer * 7 ) * 300;
|
|
|
|
- particleLight.position.y = Math.cos( timer * 5 ) * 400;
|
|
|
|
- particleLight.position.z = Math.cos( timer * 3 ) * 300;
|
|
|
|
|
|
+ particleLight.position.x = Math.sin( timer * 7 ) * 30;
|
|
|
|
+ particleLight.position.y = Math.cos( timer * 5 ) * 40;
|
|
|
|
+ particleLight.position.z = Math.cos( timer * 3 ) * 30;
|
|
|
|
|
|
for ( let i = 0; i < group.children.length; i ++ ) {
|
|
for ( let i = 0; i < group.children.length; i ++ ) {
|
|
|
|
|