@@ -7376,62 +7376,18 @@ index 5b13e8f4..83aad15c 100644
7376
7376
init();
7377
7377
7378
7378
diff --git a/examples-testing/examples/webgl_loader_obj.ts b/examples-testing/examples/webgl_loader_obj.ts
7379
- index f61eeb75..44b29b66 100644
7379
+ index d393c5ef..64e08310 100644
7380
7380
--- a/examples-testing/examples/webgl_loader_obj.ts
7381
7381
+++ b/examples-testing/examples/webgl_loader_obj.ts
7382
- @@ -3,9 +3,9 @@ import * as THREE from 'three';
7383
- import { OBJLoader } from 'three/addons/loaders/OBJLoader.js';
7384
- import { OrbitControls } from 'three/addons/controls/OrbitControls.js';
7385
-
7386
- -let camera, scene, renderer;
7387
- +let camera: THREE.PerspectiveCamera, scene: THREE.Scene, renderer: THREE.WebGLRenderer;
7388
-
7389
- -let object;
7390
- +let object: THREE.Group;
7391
-
7392
- init();
7393
-
7394
- @@ -28,7 +28,8 @@ function init() {
7395
-
7396
- function loadModel() {
7397
- object.traverse(function (child) {
7398
- - if (child.isMesh) child.material.map = texture;
7399
- + if ((child as THREE.Mesh).isMesh)
7400
- + (child as THREE.Mesh<THREE.BufferGeometry, THREE.MeshPhongMaterial>).material.map = texture;
7401
- });
7402
-
7403
- object.position.y = -0.95;
7404
- @@ -48,7 +49,7 @@ function init() {
7405
-
7406
- // model
7407
-
7408
- - function onProgress(xhr) {
7409
- + function onProgress(xhr: ProgressEvent) {
7410
- if (xhr.lengthComputable) {
7411
- const percentComplete = (xhr.loaded / xhr.total) * 100;
7412
- console.log('model ' + percentComplete.toFixed(2) + '% downloaded');
7413
- diff --git a/examples-testing/examples/webgl_loader_obj_mtl.ts b/examples-testing/examples/webgl_loader_obj_mtl.ts
7414
- index 4308aee7..f27d82d9 100644
7415
- --- a/examples-testing/examples/webgl_loader_obj_mtl.ts
7416
- +++ b/examples-testing/examples/webgl_loader_obj_mtl.ts
7417
7382
@@ -4,7 +4,7 @@ import { MTLLoader } from 'three/addons/loaders/MTLLoader.js';
7418
7383
import { OBJLoader } from 'three/addons/loaders/OBJLoader.js';
7419
7384
import { OrbitControls } from 'three/addons/controls/OrbitControls.js';
7420
7385
7421
- -let camera, scene, renderer;
7422
- +let camera: THREE.PerspectiveCamera, scene: THREE.Scene, renderer: THREE.WebGLRenderer;
7386
+ -let camera, scene, renderer, controls ;
7387
+ +let camera: THREE.PerspectiveCamera, scene: THREE.Scene, renderer: THREE.WebGLRenderer, controls: OrbitControls ;
7423
7388
7424
7389
init();
7425
7390
7426
- @@ -25,7 +25,7 @@ function init() {
7427
-
7428
- // model
7429
-
7430
- - const onProgress = function (xhr) {
7431
- + const onProgress = function (xhr: ProgressEvent) {
7432
- if (xhr.lengthComputable) {
7433
- const percentComplete = (xhr.loaded / xhr.total) * 100;
7434
- console.log(percentComplete.toFixed(2) + '% downloaded');
7435
7391
diff --git a/examples-testing/examples/webgl_loader_pcd.ts b/examples-testing/examples/webgl_loader_pcd.ts
7436
7392
index dd0f0b0f..e47005a8 100644
7437
7393
--- a/examples-testing/examples/webgl_loader_pcd.ts
@@ -14134,10 +14090,10 @@ index 7bb91369..7f794094 100644
14134
14090
duck.material.side = THREE.DoubleSide;
14135
14091
duck.material.transparent = true;
14136
14092
diff --git a/examples-testing/examples/webgpu_centroid_sampling.ts b/examples-testing/examples/webgpu_centroid_sampling.ts
14137
- index 18fbc872..c3c883d9 100644
14093
+ index 4168292c..9d02417c 100644
14138
14094
--- a/examples-testing/examples/webgpu_centroid_sampling.ts
14139
14095
+++ b/examples-testing/examples/webgpu_centroid_sampling.ts
14140
- @@ -1,15 +1,15 @@
14096
+ @@ -1,15 +1,22 @@
14141
14097
-import * as THREE from 'three';
14142
14098
+import * as THREE from 'three/webgpu';
14143
14099
import { varying, uv, texture, Fn } from 'three/tsl';
@@ -14149,18 +14105,26 @@ index 18fbc872..c3c883d9 100644
14149
14105
-let camera;
14150
14106
-let scene;
14151
14107
-let gui;
14108
+ -
14109
+ -const effectController = {
14152
14110
+let rendererAntialiasingEnabled: THREE.WebGPURenderer;
14153
14111
+let rendererAntialiasingDisabled: THREE.WebGPURenderer;
14154
14112
+let camera: THREE.PerspectiveCamera;
14155
14113
+let scene: THREE.Scene;
14156
14114
+let gui: GUI;
14157
-
14158
- -const effectController = {
14159
- +const effectController: { sampling: THREE.InterpolationSamplingMode } = {
14115
+ +
14116
+ +const effectController: {
14117
+ + sampling:
14118
+ + | typeof THREE.InterpolationSamplingMode.NORMAL
14119
+ + | typeof THREE.InterpolationSamplingMode.CENTROID
14120
+ + | typeof THREE.InterpolationSamplingMode.SAMPLE
14121
+ + | 'flat first'
14122
+ + | 'flat either';
14123
+ +} = {
14160
14124
sampling: 'normal',
14161
14125
};
14162
14126
14163
- @@ -17,7 +17 ,7 @@ const atlasCanvas = document.createElement('canvas');
14127
+ @@ -17,7 +24 ,7 @@ const atlasCanvas = document.createElement('canvas');
14164
14128
atlasCanvas.width = 16;
14165
14129
atlasCanvas.height = 16;
14166
14130
@@ -14169,7 +14133,7 @@ index 18fbc872..c3c883d9 100644
14169
14133
ctx.fillStyle = 'red';
14170
14134
ctx.fillRect(0, 0, 8, 8);
14171
14135
14172
- @@ -62,7 +62 ,7 @@ function init() {
14136
+ @@ -62,7 +69 ,7 @@ function init() {
14173
14137
14174
14138
scene = new THREE.Scene();
14175
14139
@@ -14178,7 +14142,7 @@ index 18fbc872..c3c883d9 100644
14178
14142
const geometry = new THREE.BufferGeometry();
14179
14143
const positions = [-1, -1, 0, 1, -1, 0, 1, 1, 0, -1, 1, 0];
14180
14144
geometry.setAttribute('position', new THREE.BufferAttribute(new Float32Array(positions), 3));
14181
- @@ -78,7 +78 ,7 @@ function init() {
14145
+ @@ -78,7 +85 ,7 @@ function init() {
14182
14146
const material = new THREE.MeshBasicNodeMaterial();
14183
14147
const testUV = varying(uv(), 'testUV');
14184
14148
@@ -14187,7 +14151,7 @@ index 18fbc872..c3c883d9 100644
14187
14151
return Fn(() => {
14188
14152
testUV.setInterpolation(type, sampling);
14189
14153
14190
- @@ -113,7 +113 ,7 @@ function init() {
14154
+ @@ -113,7 +120 ,7 @@ function init() {
14191
14155
14192
14156
material.colorNode = withoutInterpolationShader();
14193
14157
@@ -14196,7 +14160,7 @@ index 18fbc872..c3c883d9 100644
14196
14160
14197
14161
for (let x = -5; x < 5; x++) {
14198
14162
for (let y = -5; y < 5; y++) {
14199
- @@ -142,13 +142 ,13 @@ function init() {
14163
+ @@ -142,13 +149 ,13 @@ function init() {
14200
14164
forceWebGL: forceWebGL,
14201
14165
});
14202
14166
@@ -14660,6 +14624,45 @@ index c3c78ca0..d964d0cd 100644
14660
14624
position.x = matrix.elements[12];
14661
14625
position.y = matrix.elements[13];
14662
14626
position.z = matrix.elements[14];
14627
+ diff --git a/examples-testing/examples/webgpu_instance_path.ts b/examples-testing/examples/webgpu_instance_path.ts
14628
+ index 49879418..0f1977f7 100644
14629
+ --- a/examples-testing/examples/webgpu_instance_path.ts
14630
+ +++ b/examples-testing/examples/webgpu_instance_path.ts
14631
+ @@ -1,4 +1,4 @@
14632
+ -import * as THREE from 'three';
14633
+ +import * as THREE from 'three/webgpu';
14634
+
14635
+ import { OrbitControls } from 'three/addons/controls/OrbitControls.js';
14636
+ import { RoomEnvironment } from 'three/addons/environments/RoomEnvironment.js';
14637
+ @@ -18,7 +18,7 @@ import {
14638
+ color,
14639
+ } from 'three/tsl';
14640
+
14641
+ -let camera, scene, renderer, controls;
14642
+ +let camera: THREE.PerspectiveCamera, scene: THREE.Scene, renderer: THREE.WebGPURenderer, controls: OrbitControls;
14643
+
14644
+ const count = 1000;
14645
+
14646
+ @@ -62,14 +62,14 @@ async function init() {
14647
+ const v = new THREE.Vector3();
14648
+ const c = new THREE.Color();
14649
+
14650
+ - const positions = [];
14651
+ - const times = [];
14652
+ - const seeds = [];
14653
+ - const colors = [];
14654
+ + const positions: number[] = [];
14655
+ + const times: number[] = [];
14656
+ + const seeds: number[] = [];
14657
+ + const colors: number[] = [];
14658
+
14659
+ for (let i = 0; i < count; i++) {
14660
+ const t = i / count;
14661
+ - path.getPointAt(t, v);
14662
+ + path.getPointAt(t, v as unknown as THREE.Vector2);
14663
+
14664
+ v.x += 0.5 - Math.random();
14665
+ v.y += 0.5 - Math.random();
14663
14666
diff --git a/examples-testing/examples/webgpu_instance_points.ts b/examples-testing/examples/webgpu_instance_points.ts
14664
14667
index 4b29d389..c793ca87 100644
14665
14668
--- a/examples-testing/examples/webgpu_instance_points.ts
0 commit comments