Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion examples/misc_boxselection.html
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@
import { SelectionBox } from 'three/addons/interactive/SelectionBox.js';
import { SelectionHelper } from 'three/addons/interactive/SelectionHelper.js';

THREE.ColorManagement.enabled = true;

let container, stats;
let camera, scene, renderer;

Expand Down Expand Up @@ -111,7 +113,6 @@
renderer.setPixelRatio( window.devicePixelRatio );
renderer.setSize( window.innerWidth, window.innerHeight );

renderer.outputColorSpace = THREE.LinearSRGBColorSpace;
renderer.shadowMap.enabled = true;
renderer.shadowMap.type = THREE.PCFShadowMap;

Expand Down
5 changes: 3 additions & 2 deletions examples/misc_controls_map.html
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@

import { MapControls } from 'three/addons/controls/MapControls.js';

THREE.ColorManagement.enabled = true;

let camera, controls, scene, renderer;

init();
Expand All @@ -58,7 +60,6 @@
renderer = new THREE.WebGLRenderer( { antialias: true } );
renderer.setPixelRatio( window.devicePixelRatio );
renderer.setSize( window.innerWidth, window.innerHeight );
renderer.outputColorSpace = THREE.LinearSRGBColorSpace;
document.body.appendChild( renderer.domElement );

camera = new THREE.PerspectiveCamera( 60, window.innerWidth / window.innerHeight, 1, 1000 );
Expand All @@ -84,7 +85,7 @@

const geometry = new THREE.BoxGeometry( 1, 1, 1 );
geometry.translate( 0, 0.5, 0 );
const material = new THREE.MeshPhongMaterial( { color: 0xffffff, flatShading: true } );
const material = new THREE.MeshPhongMaterial( { color: 0xeeeeee, flatShading: true } );
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This line is just an artistic change. Contrast was lower with the corrected color workflow, so I brought a bit of contrast back.


for ( let i = 0; i < 500; i ++ ) {

Expand Down
3 changes: 2 additions & 1 deletion examples/misc_controls_orbit.html
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@

import { OrbitControls } from 'three/addons/controls/OrbitControls.js';

THREE.ColorManagement.enabled = true;

let camera, controls, scene, renderer;

init();
Expand All @@ -56,7 +58,6 @@
renderer = new THREE.WebGLRenderer( { antialias: true } );
renderer.setPixelRatio( window.devicePixelRatio );
renderer.setSize( window.innerWidth, window.innerHeight );
renderer.outputColorSpace = THREE.LinearSRGBColorSpace;
document.body.appendChild( renderer.domElement );

camera = new THREE.PerspectiveCamera( 60, window.innerWidth / window.innerHeight, 1, 1000 );
Expand Down
9 changes: 5 additions & 4 deletions examples/misc_controls_pointerlock.html
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,8 @@

import { PointerLockControls } from 'three/addons/controls/PointerLockControls.js';

THREE.ColorManagement.enabled = true;

let camera, scene, renderer, controls;

const objects = [];
Expand Down Expand Up @@ -216,7 +218,7 @@

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 );

}
Expand All @@ -237,7 +239,7 @@

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 );

}
Expand All @@ -247,7 +249,7 @@
for ( let i = 0; i < 500; i ++ ) {

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 );
box.position.x = Math.floor( Math.random() * 20 - 10 ) * 20;
Expand All @@ -264,7 +266,6 @@
renderer = new THREE.WebGLRenderer( { antialias: true } );
renderer.setPixelRatio( window.devicePixelRatio );
renderer.setSize( window.innerWidth, window.innerHeight );
renderer.outputColorSpace = THREE.LinearSRGBColorSpace;
document.body.appendChild( renderer.domElement );

//
Expand Down
3 changes: 2 additions & 1 deletion examples/misc_controls_trackball.html
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@

import { TrackballControls } from 'three/addons/controls/TrackballControls.js';

THREE.ColorManagement.enabled = true;

let perspectiveCamera, orthographicCamera, controls, scene, renderer, stats;

const params = {
Expand Down Expand Up @@ -104,7 +106,6 @@
renderer = new THREE.WebGLRenderer( { antialias: true } );
renderer.setPixelRatio( window.devicePixelRatio );
renderer.setSize( window.innerWidth, window.innerHeight );
renderer.outputColorSpace = THREE.LinearSRGBColorSpace;
document.body.appendChild( renderer.domElement );

stats = new Stats();
Expand Down
Binary file modified examples/screenshots/misc_boxselection.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified examples/screenshots/misc_controls_map.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified examples/screenshots/misc_controls_orbit.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified examples/screenshots/misc_controls_pointerlock.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified examples/screenshots/misc_controls_trackball.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.