|
@@ -61,6 +61,8 @@
|
|
|
|
|
|
import { PointerLockControls } from 'three/addons/controls/PointerLockControls.js';
|
|
import { PointerLockControls } from 'three/addons/controls/PointerLockControls.js';
|
|
|
|
|
|
|
|
+ THREE.ColorManagement.enabled = true;
|
|
|
|
+
|
|
let camera, scene, renderer, controls;
|
|
let camera, scene, renderer, controls;
|
|
|
|
|
|
const objects = [];
|
|
const objects = [];
|
|
@@ -216,7 +218,7 @@
|
|
|
|
|
|
for ( let i = 0, l = position.count; i < l; i ++ ) {
|
|
for ( let i = 0, l = position.count; i < l; i ++ ) {
|
|
|
|
|
|
- color.setHSL( Math.random() * 0.3 + 0.5, 0.75, Math.random() * 0.25 + 0.75 );
|
|
|
|
|
|
+ color.setHSL( Math.random() * 0.3 + 0.5, 0.75, Math.random() * 0.25 + 0.75, THREE.SRGBColorSpace );
|
|
colorsFloor.push( color.r, color.g, color.b );
|
|
colorsFloor.push( color.r, color.g, color.b );
|
|
|
|
|
|
}
|
|
}
|
|
@@ -237,7 +239,7 @@
|
|
|
|
|
|
for ( let i = 0, l = position.count; i < l; i ++ ) {
|
|
for ( let i = 0, l = position.count; i < l; i ++ ) {
|
|
|
|
|
|
- color.setHSL( Math.random() * 0.3 + 0.5, 0.75, Math.random() * 0.25 + 0.75 );
|
|
|
|
|
|
+ color.setHSL( Math.random() * 0.3 + 0.5, 0.75, Math.random() * 0.25 + 0.75, THREE.SRGBColorSpace );
|
|
colorsBox.push( color.r, color.g, color.b );
|
|
colorsBox.push( color.r, color.g, color.b );
|
|
|
|
|
|
}
|
|
}
|
|
@@ -247,7 +249,7 @@
|
|
for ( let i = 0; i < 500; i ++ ) {
|
|
for ( let i = 0; i < 500; i ++ ) {
|
|
|
|
|
|
const boxMaterial = new THREE.MeshPhongMaterial( { specular: 0xffffff, flatShading: true, vertexColors: true } );
|
|
const boxMaterial = new THREE.MeshPhongMaterial( { specular: 0xffffff, flatShading: true, vertexColors: true } );
|
|
- boxMaterial.color.setHSL( Math.random() * 0.2 + 0.5, 0.75, Math.random() * 0.25 + 0.75 );
|
|
|
|
|
|
+ boxMaterial.color.setHSL( Math.random() * 0.2 + 0.5, 0.75, Math.random() * 0.25 + 0.75, THREE.SRGBColorSpace );
|
|
|
|
|
|
const box = new THREE.Mesh( boxGeometry, boxMaterial );
|
|
const box = new THREE.Mesh( boxGeometry, boxMaterial );
|
|
box.position.x = Math.floor( Math.random() * 20 - 10 ) * 20;
|
|
box.position.x = Math.floor( Math.random() * 20 - 10 ) * 20;
|
|
@@ -264,7 +266,6 @@
|
|
renderer = new THREE.WebGLRenderer( { antialias: true } );
|
|
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.outputColorSpace = THREE.LinearSRGBColorSpace;
|
|
|
|
document.body.appendChild( renderer.domElement );
|
|
document.body.appendChild( renderer.domElement );
|
|
|
|
|
|
//
|
|
//
|