From 3ac120d9de75795d1ea92d3000dad25e17d9af46 Mon Sep 17 00:00:00 2001 From: Jose Ferrao Date: Wed, 3 Jan 2024 08:12:16 +0000 Subject: [PATCH] Fix color examples --- examples/transition.js | 3 +++ source/examples/basic.ts | 6 +++++- source/examples/providers.ts | 6 +++++- source/examples/transition.ts | 8 +++++++- 4 files changed, 20 insertions(+), 3 deletions(-) diff --git a/examples/transition.js b/examples/transition.js index 88faa36..0bfd46f 100644 --- a/examples/transition.js +++ b/examples/transition.js @@ -34439,12 +34439,15 @@ var canvas = document.getElementById('canvas'); const SPHERE = 0; const PLANE = 1; + ColorManagement.enabled = false; const scenes = [createWorldScene(), createMapScene()]; let active = SPHERE; let renderer = new WebGLRenderer({ canvas: canvas, antialias: true }); + renderer.outputColorSpace = LinearSRGBColorSpace; + console.log(ColorManagement, renderer); function createWorldScene() { var scene = new Scene(); scene.background = new Color(0x000000); diff --git a/source/examples/basic.ts b/source/examples/basic.ts index 52c5502..8903569 100644 --- a/source/examples/basic.ts +++ b/source/examples/basic.ts @@ -1,16 +1,20 @@ // @ts-nocheck -import {WebGLRenderer, Scene, Color, AmbientLight, PerspectiveCamera} from 'three'; +import {WebGLRenderer, Scene, Color, AmbientLight, PerspectiveCamera, LinearSRGBColorSpace, ColorManagement} from 'three'; import {MapControls} from 'three/examples/jsm/controls/MapControls.js'; import {MapView, BingMapsProvider, UnitsUtils} from '../Main'; var canvas = document.getElementById('canvas'); +ColorManagement.enabled = false; + var renderer = new WebGLRenderer({ canvas: canvas, antialias: true }); +renderer.outputColorSpace = LinearSRGBColorSpace; + var scene = new Scene(); scene.background = new Color(0.4, 0.4, 0.4); diff --git a/source/examples/providers.ts b/source/examples/providers.ts index 8baaa0f..31055e2 100644 --- a/source/examples/providers.ts +++ b/source/examples/providers.ts @@ -1,17 +1,21 @@ // @ts-nocheck -import {WebGLRenderer, Scene, Color, AmbientLight, PerspectiveCamera, DirectionalLight, Vector3} from 'three'; +import {WebGLRenderer, Scene, Color, AmbientLight, PerspectiveCamera, DirectionalLight, Vector3, LinearSRGBColorSpace, ColorManagement} from 'three'; import {MapControls} from 'three/examples/jsm/controls/MapControls.js'; import {Sky} from 'three/examples/jsm/objects/Sky.js'; import {HereMapsProvider, BingMapsProvider, MapTilerProvider, HeightDebugProvider, DebugProvider, LODRaycast, LODFrustum, LODRadial, UnitsUtils, OpenStreetMapsProvider, OpenMapTilesProvider, MapBoxProvider, MapView} from '../Main'; var canvas = document.getElementById('canvas'); +ColorManagement.enabled = false; + var renderer = new WebGLRenderer({ canvas: canvas, antialias: true }); +renderer.outputColorSpace = LinearSRGBColorSpace; + var scene = new Scene(); scene.background = new Color(0.4, 0.4, 0.4); diff --git a/source/examples/transition.ts b/source/examples/transition.ts index 18a8579..febcdd3 100644 --- a/source/examples/transition.ts +++ b/source/examples/transition.ts @@ -1,6 +1,6 @@ // @ts-nocheck -import {WebGLRenderer, Scene, Color, TextureLoader, Mesh, SphereGeometry, MeshBasicMaterial, PerspectiveCamera, MOUSE, AmbientLight, Raycaster, Vector2} from 'three'; +import {WebGLRenderer, Scene, Color, TextureLoader, Mesh, SphereGeometry, MeshBasicMaterial, PerspectiveCamera, MOUSE, AmbientLight, Raycaster, Vector2, LinearSRGBColorSpace, ColorManagement} from 'three'; import {MapControls} from 'three/examples/jsm/controls/MapControls.js'; import {UnitsUtils, BingMapsProvider, MapView} from '../Main'; @@ -12,6 +12,8 @@ const SPHERE = 0; // Planar earth scene const PLANE = 1; +ColorManagement.enabled = false; + // List of scenes const scenes = [createWorldScene(), createMapScene()]; @@ -22,6 +24,10 @@ let renderer = new WebGLRenderer({ antialias: true }); +renderer.outputColorSpace = LinearSRGBColorSpace; + +console.log(ColorManagement, renderer); + // Create scene for spherical earth function createWorldScene(): any {