Skip to content

Commit

Permalink
Fix color examples
Browse files Browse the repository at this point in the history
  • Loading branch information
tentone committed Jan 3, 2024
1 parent 1e11bd3 commit 3ac120d
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 3 deletions.
3 changes: 3 additions & 0 deletions examples/transition.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
6 changes: 5 additions & 1 deletion source/examples/basic.ts
Original file line number Diff line number Diff line change
@@ -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);

Expand Down
6 changes: 5 additions & 1 deletion source/examples/providers.ts
Original file line number Diff line number Diff line change
@@ -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);

Expand Down
8 changes: 7 additions & 1 deletion source/examples/transition.ts
Original file line number Diff line number Diff line change
@@ -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';

Expand All @@ -12,6 +12,8 @@ const SPHERE = 0;
// Planar earth scene
const PLANE = 1;

ColorManagement.enabled = false;

// List of scenes
const scenes = [createWorldScene(), createMapScene()];

Expand All @@ -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
{
Expand Down

0 comments on commit 3ac120d

Please sign in to comment.