From 4e07037493baaf6184c669d4b997f977dd9e46f5 Mon Sep 17 00:00:00 2001
From: Michael Herzog
Date: Sat, 1 Jul 2023 11:09:15 +0200
Subject: [PATCH] Manual: Honor latest changes. (#26355)
---
manual/en/textures.html | 27 +-
manual/en/voxel-geometry.html | 1 +
.../examples/render-on-demand-w-damping.html | 161 +--
manual/examples/render-on-demand-w-gui.html | 215 ++--
manual/examples/render-on-demand.html | 165 +--
manual/examples/render-target.html | 218 ++--
manual/examples/responsive-editor.html | 32 +-
manual/examples/responsive-hd-dpi.html | 146 ++-
manual/examples/responsive-no-resize.html | 105 +-
manual/examples/responsive-update-camera.html | 111 +-
manual/examples/responsive.html | 144 ++-
manual/examples/scenegraph-car.html | 183 +--
.../scenegraph-sun-earth-moon-axes-grids.html | 276 +++--
.../scenegraph-sun-earth-moon-axes.html | 198 +--
.../examples/scenegraph-sun-earth-moon.html | 180 +--
.../scenegraph-sun-earth-orbit-fixed.html | 152 ++-
.../examples/scenegraph-sun-earth-orbit.html | 144 ++-
manual/examples/scenegraph-sun-earth.html | 144 ++-
manual/examples/scenegraph-sun.html | 134 +-
manual/examples/scenegraph-tank.html | 493 ++++----
manual/examples/shadertoy-as-texture.html | 166 +--
manual/examples/shadertoy-basic-x40.html | 102 +-
manual/examples/shadertoy-basic.html | 102 +-
manual/examples/shadertoy-bleepy-blocks.html | 116 +-
manual/examples/shadertoy-prep.html | 80 +-
...shadows-directional-light-shadow-acne.html | 432 ++++---
...ows-directional-light-with-camera-gui.html | 429 ++++---
...-directional-light-with-camera-helper.html | 299 +++--
.../examples/shadows-directional-light.html | 293 +++--
manual/examples/shadows-fake.html | 299 ++---
manual/examples/shadows-point-light.html | 373 +++---
.../shadows-spot-light-with-camera-gui.html | 413 ++++---
...shadows-spot-light-with-shadow-radius.html | 419 ++++---
manual/examples/textured-cube-6-textures.html | 140 ++-
manual/examples/textured-cube-adjust.html | 241 ++--
.../textured-cube-wait-for-all-textures.html | 170 +--
.../textured-cube-wait-for-texture.html | 128 +-
manual/examples/textured-cube.html | 125 +-
manual/examples/threejs-responsive.js | 3 +-
.../examples/tips-preservedrawingbuffer.html | 201 +--
manual/examples/tips-screenshot-bad.html | 190 +--
manual/examples/tips-screenshot-good.html | 213 ++--
manual/examples/tips-tabindex.html | 57 +-
manual/examples/tips-transparent-canvas.html | 160 +--
.../transparency-doubleside-hack.html | 210 ++--
manual/examples/transparency-doubleside.html | 198 +--
...parency-intersecting-planes-alphatest.html | 257 ++--
...ransparency-intersecting-planes-fixed.html | 201 +--
.../transparency-intersecting-planes.html | 173 +--
manual/examples/transparency.html | 196 +--
.../voxel-geometry-culled-faces-ui.html | 1093 ++++++++++-------
...l-geometry-culled-faces-with-textures.html | 605 +++++----
.../examples/voxel-geometry-culled-faces.html | 518 ++++----
manual/examples/voxel-geometry-merged.html | 181 +--
.../voxel-geometry-separate-cubes.html | 203 +--
manual/examples/webxr-basic-vr-optional.html | 204 +--
manual/examples/webxr-basic-w-background.html | 176 +--
manual/examples/webxr-basic.html | 152 ++-
.../webxr-look-to-select-selector.html | 204 +--
.../webxr-look-to-select-w-cursor.html | 434 ++++---
manual/examples/webxr-look-to-select.html | 246 ++--
.../webxr-point-to-select-w-move.html | 458 ++++---
manual/examples/webxr-point-to-select.html | 398 +++---
manual/ko/voxel-geometry.html | 1 +
64 files changed, 8114 insertions(+), 6374 deletions(-)
diff --git a/manual/en/textures.html b/manual/en/textures.html
index d5e9febd6cb712..297e476c62084c 100644
--- a/manual/en/textures.html
+++ b/manual/en/textures.html
@@ -66,10 +66,12 @@ Hello Texture
load
method with the URL of an
image and set the material's map
property to the result instead of setting its color
.
+const loader = new THREE.TextureLoader();
++const texture = loader.load( 'resources/images/wall.jpg' );
++texture.colorSpace = THREE.SRGBColorSpace;
const material = new THREE.MeshBasicMaterial({
- color: 0xFF8844,
-+ map: loader.load('resources/images/wall.jpg'),
++ map: texture,
});
Note that we're using MeshBasicMaterial
so no need for any lights.
@@ -96,20 +98,28 @@ We just make 6 materials and pass them as an array when we create the Mesh
const loader = new THREE.TextureLoader();
+-const texture = loader.load( 'resources/images/wall.jpg' );
+-texture.colorSpace = THREE.SRGBColorSpace;
-const material = new THREE.MeshBasicMaterial({
-- map: loader.load('resources/images/wall.jpg'),
+- map: texture,
-});
+const materials = [
-+ new THREE.MeshBasicMaterial({map: loader.load('resources/images/flower-1.jpg')}),
-+ new THREE.MeshBasicMaterial({map: loader.load('resources/images/flower-2.jpg')}),
-+ new THREE.MeshBasicMaterial({map: loader.load('resources/images/flower-3.jpg')}),
-+ new THREE.MeshBasicMaterial({map: loader.load('resources/images/flower-4.jpg')}),
-+ new THREE.MeshBasicMaterial({map: loader.load('resources/images/flower-5.jpg')}),
-+ new THREE.MeshBasicMaterial({map: loader.load('resources/images/flower-6.jpg')}),
++ new THREE.MeshBasicMaterial({map: loadColorTexture('resources/images/flower-1.jpg')}),
++ new THREE.MeshBasicMaterial({map: loadColorTexture('resources/images/flower-2.jpg')}),
++ new THREE.MeshBasicMaterial({map: loadColorTexture('resources/images/flower-3.jpg')}),
++ new THREE.MeshBasicMaterial({map: loadColorTexture('resources/images/flower-4.jpg')}),
++ new THREE.MeshBasicMaterial({map: loadColorTexture('resources/images/flower-5.jpg')}),
++ new THREE.MeshBasicMaterial({map: loadColorTexture('resources/images/flower-6.jpg')}),
+];
-const cube = new THREE.Mesh(geometry, material);
+const cube = new THREE.Mesh(geometry, materials);
+
++function loadColorTexture( path ) {
++ const texture = loader.load( path );
++ texture.colorSpace = THREE.SRGBColorSpace;
++ return texture;
++}
It works!
@@ -152,6 +162,7 @@
Wait
like this
const loader = new THREE.TextureLoader();
loader.load('resources/images/wall.jpg', (texture) => {
+ texture.colorSpace = THREE.SRGBColorSpace;
const material = new THREE.MeshBasicMaterial({
map: texture,
});
diff --git a/manual/en/voxel-geometry.html b/manual/en/voxel-geometry.html
index e69ac281c43b90..6b08887a04114d 100644
--- a/manual/en/voxel-geometry.html
+++ b/manual/en/voxel-geometry.html
@@ -691,6 +691,7 @@ Voxel(Minecraft Like) Geometry
const texture = loader.load('resources/images/minecraft/flourish-cc-by-nc-sa.png', render);
texture.magFilter = THREE.NearestFilter;
texture.minFilter = THREE.NearestFilter;
+texture.colorSpace = THREE.SRGBColorSpace;
and pass the settings to the VoxelWorld
class
+const tileSize = 16;
diff --git a/manual/examples/render-on-demand-w-damping.html b/manual/examples/render-on-demand-w-damping.html
index 61e910c70adfc1..35b8bcf063cc2f 100644
--- a/manual/examples/render-on-demand-w-damping.html
+++ b/manual/examples/render-on-demand-w-damping.html
@@ -35,90 +35,111 @@