Skip to content

Commit

Permalink
WebGLRenderer: Default output to sRGB (#25783)
Browse files Browse the repository at this point in the history
* WebGLRenderer: Default output to sRGB

* Examples: Update all for sRGB default renderer output.

* Revert changes in examples/webgl_points_sprites.html

* Clean up

* Revert changes to webgl_points_sprites screenshot.

---------

Co-authored-by: Michael Herzog <michael.herzog@human-interactive.org>
  • Loading branch information
donmccurdy and Mugen87 authored Apr 7, 2023
1 parent 435bcc6 commit 13397a8
Show file tree
Hide file tree
Showing 205 changed files with 340 additions and 40 deletions.
4 changes: 4 additions & 0 deletions examples/css2d_label.html
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@

import { GUI } from 'three/addons/libs/lil-gui.module.min.js';

THREE.ColorManagement.enabled = true;

let gui;

let camera, scene, renderer, labelRenderer;
Expand Down Expand Up @@ -108,6 +110,7 @@
normalMap: textureLoader.load( 'textures/planets/earth_normal_2048.jpg' ),
normalScale: new THREE.Vector2( 0.85, 0.85 )
} );
earthMaterial.map.colorSpace = THREE.SRGBColorSpace;
const earth = new THREE.Mesh( earthGeometry, earthMaterial );
scene.add( earth );

Expand All @@ -116,6 +119,7 @@
shininess: 5,
map: textureLoader.load( 'textures/planets/moon_1024.jpg' )
} );
moonMaterial.map.colorSpace = THREE.SRGBColorSpace;
moon = new THREE.Mesh( moonGeometry, moonMaterial );
scene.add( moon );

Expand Down
20 changes: 13 additions & 7 deletions examples/jsm/loaders/TiltLoader.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import {
BufferAttribute,
BufferGeometry,
Color,
DoubleSide,
FileLoader,
Group,
Expand Down Expand Up @@ -182,6 +183,8 @@ class StrokeGeometry extends BufferGeometry {
const vector3 = new Vector3();
const vector4 = new Vector3();

const color = new Color();

// size = size / 2;

for ( const k in strokes ) {
Expand All @@ -190,7 +193,10 @@ class StrokeGeometry extends BufferGeometry {
const positions = stroke[ 0 ];
const quaternions = stroke[ 1 ];
const size = stroke[ 2 ];
const color = stroke[ 3 ];
const rgba = stroke[ 3 ];
const alpha = stroke[ 3 ][ 3 ];

color.fromArray( rgba ).convertSRGBToLinear();

prevPosition.fromArray( positions, 0 );
prevQuaternion.fromArray( quaternions, 0 );
Expand Down Expand Up @@ -227,13 +233,13 @@ class StrokeGeometry extends BufferGeometry {
prevPosition.copy( position );
prevQuaternion.copy( quaternion );

colors.push( ...color );
colors.push( ...color );
colors.push( ...color );
colors.push( ...color, alpha );
colors.push( ...color, alpha );
colors.push( ...color, alpha );

colors.push( ...color );
colors.push( ...color );
colors.push( ...color );
colors.push( ...color, alpha );
colors.push( ...color, alpha );
colors.push( ...color, alpha );

const p1 = i / l;
const p2 = ( i - 3 ) / l;
Expand Down
8 changes: 7 additions & 1 deletion examples/jsm/misc/RollerCoaster.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
import {
BufferAttribute,
BufferGeometry,
Color,
Quaternion,
Raycaster,
SRGBColorSpace,
Vector3
} from 'three';

Expand Down Expand Up @@ -513,6 +515,8 @@ class TreesGeometry extends BufferGeometry {
const raycaster = new Raycaster();
raycaster.ray.direction.set( 0, - 1, 0 );

const _color = new Color();

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

const x = Math.random() * 500 - 250;
Expand Down Expand Up @@ -544,7 +548,9 @@ class TreesGeometry extends BufferGeometry {

for ( let j = 0; j < 6; j ++ ) {

colors.push( 0.2 + random, 0.4 + random, 0 );
_color.setRGB( 0.2 + random, 0.4 + random, 0, SRGBColorSpace );

colors.push( _color.r, _color.g, _color.b );

}

Expand Down
2 changes: 2 additions & 0 deletions examples/jsm/offscreen/scene.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import * as THREE from '../../../build/three.module.js';

THREE.ColorManagement.enabled = true;

let camera, scene, renderer, group;

function init( canvas, width, height, pixelRatio, path ) {
Expand Down
4 changes: 2 additions & 2 deletions examples/jsm/renderers/webgpu/WebGPURenderer.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import WebGPUBackground from './WebGPUBackground.js';
import WebGPUNodes from './nodes/WebGPUNodes.js';
import WebGPUUtils from './WebGPUUtils.js';

import { Frustum, Matrix4, Vector3, Color, LinearSRGBColorSpace, NoToneMapping, DepthFormat } from 'three';
import { Frustum, Matrix4, Vector3, Color, SRGBColorSpace, NoToneMapping, DepthFormat } from 'three';

console.info( 'THREE.WebGPURenderer: Modified Matrix4.makePerspective() and Matrix4.makeOrtographic() to work with WebGPU, see https://github.com/mrdoob/three.js/issues/20276.' );

Expand Down Expand Up @@ -98,7 +98,7 @@ class WebGPURenderer {
this.autoClearDepth = true;
this.autoClearStencil = true;

this.outputColorSpace = LinearSRGBColorSpace;
this.outputColorSpace = SRGBColorSpace;

this.toneMapping = NoToneMapping;
this.toneMappingExposure = 1.0;
Expand Down
1 change: 1 addition & 0 deletions examples/misc_boxselection.html
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@
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
2 changes: 2 additions & 0 deletions examples/misc_controls_drag.html
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@

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

THREE.ColorManagement.enabled = true;

let container;
let camera, scene, renderer;
let controls, group;
Expand Down
1 change: 1 addition & 0 deletions examples/misc_controls_map.html
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@
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
1 change: 1 addition & 0 deletions examples/misc_controls_orbit.html
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@
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
1 change: 1 addition & 0 deletions examples/misc_controls_pointerlock.html
Original file line number Diff line number Diff line change
Expand Up @@ -264,6 +264,7 @@
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
1 change: 1 addition & 0 deletions examples/misc_controls_trackball.html
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@
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
3 changes: 3 additions & 0 deletions examples/misc_controls_transform.html
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@
import { OrbitControls } from 'three/addons/controls/OrbitControls.js';
import { TransformControls } from 'three/addons/controls/TransformControls.js';

THREE.ColorManagement.enabled = true;

let cameraPersp, cameraOrtho, currentCamera;
let scene, renderer, control, orbit;

Expand Down Expand Up @@ -66,6 +68,7 @@
scene.add( light );

const texture = new THREE.TextureLoader().load( 'textures/crate.gif', render );
texture.colorSpace = THREE.SRGBColorSpace;
texture.anisotropy = renderer.capabilities.getMaxAnisotropy();

const geometry = new THREE.BoxGeometry( 200, 200, 200 );
Expand Down
1 change: 1 addition & 0 deletions examples/misc_exporter_draco.html
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@
renderer = new THREE.WebGLRenderer( { antialias: true } );
renderer.setPixelRatio( window.devicePixelRatio );
renderer.setSize( window.innerWidth, window.innerHeight );
renderer.outputColorSpace = THREE.LinearSRGBColorSpace;
renderer.shadowMap.enabled = true;
document.body.appendChild( renderer.domElement );

Expand Down
1 change: 1 addition & 0 deletions examples/misc_exporter_stl.html
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@
renderer = new THREE.WebGLRenderer( { antialias: true } );
renderer.setPixelRatio( window.devicePixelRatio );
renderer.setSize( window.innerWidth, window.innerHeight );
renderer.outputColorSpace = THREE.LinearSRGBColorSpace;
renderer.shadowMap.enabled = true;
document.body.appendChild( renderer.domElement );

Expand Down
2 changes: 2 additions & 0 deletions examples/physics_ammo_break.html
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@
import { ConvexObjectBreaker } from 'three/addons/misc/ConvexObjectBreaker.js';
import { ConvexGeometry } from 'three/addons/geometries/ConvexGeometry.js';

THREE.ColorManagement.enabled = true;

// - Global variables -

// Graphics variables
Expand Down
4 changes: 4 additions & 0 deletions examples/physics_ammo_cloth.html
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@

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

THREE.ColorManagement.enabled = true;

// Graphics variables
let container, stats;
let camera, controls, scene, renderer;
Expand Down Expand Up @@ -159,6 +161,7 @@
ground.receiveShadow = true;
textureLoader.load( 'textures/grid.png', function ( texture ) {

texture.colorSpace = THREE.SRGBColorSpace;
texture.wrapS = THREE.RepeatWrapping;
texture.wrapT = THREE.RepeatWrapping;
texture.repeat.set( 40, 40 );
Expand Down Expand Up @@ -242,6 +245,7 @@
scene.add( cloth );
textureLoader.load( 'textures/grid.png', function ( texture ) {

texture.colorSpace = THREE.SRGBColorSpace;
texture.wrapS = THREE.RepeatWrapping;
texture.wrapT = THREE.RepeatWrapping;
texture.repeat.set( clothNumSegmentsZ, clothNumSegmentsY );
Expand Down
3 changes: 3 additions & 0 deletions examples/physics_ammo_rope.html
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@

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

THREE.ColorManagement.enabled = true;

// Graphics variables
let container, stats;
let camera, controls, scene, renderer;
Expand Down Expand Up @@ -163,6 +165,7 @@
ground.receiveShadow = true;
textureLoader.load( 'textures/grid.png', function ( texture ) {

texture.colorSpace = THREE.SRGBColorSpace;
texture.wrapS = THREE.RepeatWrapping;
texture.wrapT = THREE.RepeatWrapping;
texture.repeat.set( 40, 40 );
Expand Down
1 change: 1 addition & 0 deletions examples/physics_ammo_terrain.html
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@
renderer = new THREE.WebGLRenderer();
renderer.setPixelRatio( window.devicePixelRatio );
renderer.setSize( window.innerWidth, window.innerHeight );
renderer.outputColorSpace = THREE.LinearSRGBColorSpace;
renderer.shadowMap.enabled = true;
container.appendChild( renderer.domElement );

Expand Down
3 changes: 3 additions & 0 deletions examples/physics_ammo_volume.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';
import * as BufferGeometryUtils from 'three/addons/utils/BufferGeometryUtils.js';

THREE.ColorManagement.enabled = true;

// Graphics variables
let container, stats;
let camera, controls, scene, renderer;
Expand Down Expand Up @@ -164,6 +166,7 @@
ground.receiveShadow = true;
textureLoader.load( 'textures/grid.png', function ( texture ) {

texture.colorSpace = THREE.SRGBColorSpace;
texture.wrapS = THREE.RepeatWrapping;
texture.wrapT = THREE.RepeatWrapping;
texture.repeat.set( 40, 40 );
Expand Down
Binary file modified examples/screenshots/css2d_label.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_drag.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/physics_ammo_cloth.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/physics_ammo_rope.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/physics_ammo_volume.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/webaudio_timing.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/webgl_clipping.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/webgl_clipping_intersection.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/webgl_decals.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/webgl_effects_peppersghost.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/webgl_furnace_test.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/webgl_geometries.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/webgl_geometries_parametric.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/webgl_geometry_colors.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/webgl_geometry_convex.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/webgl_geometry_extrude_shapes.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/webgl_geometry_extrude_splines.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/webgl_geometry_nurbs.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/webgl_geometry_shapes.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/webgl_helpers.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/webgl_instancing_scatter.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/webgl_interactive_buffergeometry.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/webgl_interactive_cubes.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/webgl_interactive_cubes_gpu.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/webgl_interactive_cubes_ortho.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/webgl_interactive_raycasting_points.jpg
Binary file modified examples/screenshots/webgl_layers.jpg
Binary file modified examples/screenshots/webgl_lights_pointlights.jpg
Binary file modified examples/screenshots/webgl_loader_amf.jpg
Binary file modified examples/screenshots/webgl_loader_ttf.jpg
Binary file modified examples/screenshots/webgl_loader_vtk.jpg
Binary file modified examples/screenshots/webgl_lod.jpg
Binary file modified examples/screenshots/webgl_materials.jpg
Binary file modified examples/screenshots/webgl_math_obb.jpg
Binary file modified examples/screenshots/webgl_modifier_subdivision.jpg
Binary file modified examples/screenshots/webgl_multiple_renderers.jpg
Binary file modified examples/screenshots/webgl_multiple_scenes_comparison.jpg
Binary file modified examples/screenshots/webgl_multiple_views.jpg
Binary file modified examples/screenshots/webgl_nodes_materials_instance_uniform.jpg
Binary file modified examples/screenshots/webgl_raycaster_texture.jpg
Binary file modified examples/screenshots/webgl_shadowmap_csm.jpg
Binary file modified examples/screenshots/webgl_shadowmap_pointlight.jpg
Binary file modified examples/screenshots/webgl_shadowmesh.jpg
2 changes: 2 additions & 0 deletions examples/webaudio_sandbox.html
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@

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

THREE.ColorManagement.enabled = true;

let camera, controls, scene, renderer, light;

let material1, material2, material3;
Expand Down
2 changes: 2 additions & 0 deletions examples/webaudio_timing.html
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@

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

THREE.ColorManagement.enabled = true;

let scene, camera, renderer, clock;

const objects = [];
Expand Down
1 change: 1 addition & 0 deletions examples/webgl2_materials_texture3d_partialupdate.html
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@
renderer = new THREE.WebGLRenderer();
renderer.setPixelRatio( window.devicePixelRatio );
renderer.setSize( window.innerWidth, window.innerHeight );
renderer.outputColorSpace = THREE.LinearSRGBColorSpace;
document.body.appendChild( renderer.domElement );

scene = new THREE.Scene();
Expand Down
1 change: 1 addition & 0 deletions examples/webgl2_volume_cloud.html
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@
renderer = new THREE.WebGLRenderer();
renderer.setPixelRatio( window.devicePixelRatio );
renderer.setSize( window.innerWidth, window.innerHeight );
renderer.outputColorSpace = THREE.LinearSRGBColorSpace;
document.body.appendChild( renderer.domElement );

scene = new THREE.Scene();
Expand Down
1 change: 1 addition & 0 deletions examples/webgl_buffergeometry_compression.html
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@
renderer = new THREE.WebGLRenderer( { antialias: true } );
renderer.setPixelRatio( window.devicePixelRatio );
renderer.setSize( window.innerWidth, window.innerHeight );
renderer.outputColorSpace = THREE.LinearSRGBColorSpace;
container.appendChild( renderer.domElement );

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

import Stats from 'three/addons/libs/stats.module.js';

THREE.ColorManagement.enabled = true;

let container, stats;

let camera, scene, renderer;
Expand Down Expand Up @@ -92,7 +94,7 @@
const vy = ( y / n ) + 0.5;
const vz = ( z / n ) + 0.5;

color.setRGB( vx, vy, vz );
color.setRGB( vx, vy, vz, THREE.SRGBColorSpace );

colors.push( color.r, color.g, color.b );

Expand Down
1 change: 1 addition & 0 deletions examples/webgl_buffergeometry_indexed.html
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,7 @@
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
1 change: 1 addition & 0 deletions examples/webgl_buffergeometry_instancing_interleaved.html
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@

const material = new THREE.MeshBasicMaterial();
material.map = new THREE.TextureLoader().load( 'textures/crate.gif' );
material.map.colorSpace = THREE.SRGBColorSpace;
material.map.flipY = false;

// per instance data
Expand Down
4 changes: 3 additions & 1 deletion examples/webgl_buffergeometry_points.html
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@

import Stats from 'three/addons/libs/stats.module.js';

THREE.ColorManagement.enabled = true;

let container, stats;

let camera, scene, renderer;
Expand Down Expand Up @@ -81,7 +83,7 @@
const vy = ( y / n ) + 0.5;
const vz = ( z / n ) + 0.5;

color.setRGB( vx, vy, vz );
color.setRGB( vx, vy, vz, THREE.SRGBColorSpace );

colors.push( color.r, color.g, color.b );

Expand Down
Loading

0 comments on commit 13397a8

Please sign in to comment.