Skip to content

Commit 6785e43

Browse files
authored
Global: Remove deprecated code. (#1680)
* Global: Remove deprecated code. * Update three.js * Update * Add examples * Update patch and delete examples * Update
1 parent 0d3b7f1 commit 6785e43

File tree

12 files changed

+15
-136
lines changed

12 files changed

+15
-136
lines changed

examples-testing/changes.patch

Lines changed: 10 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -1354,7 +1354,7 @@ index ff6d6e2b..105aeb07 100644
13541354
save(new Blob([buffer], { type: 'application/octet-stream' }), filename);
13551355
}
13561356
diff --git a/examples-testing/examples/misc_exporter_usdz.ts b/examples-testing/examples/misc_exporter_usdz.ts
1357-
index 9a14919b..2d52e37b 100644
1357+
index f1ce6548..5ec818dd 100644
13581358
--- a/examples-testing/examples/misc_exporter_usdz.ts
13591359
+++ b/examples-testing/examples/misc_exporter_usdz.ts
13601360
@@ -7,7 +7,7 @@ import { GLTFLoader } from 'three/addons/loaders/GLTFLoader.js';
@@ -1384,7 +1384,7 @@ index 9a14919b..2d52e37b 100644
13841384
const gradient = context.createRadialGradient(
13851385
canvas.width / 2,
13861386
canvas.height / 2,
1387-
@@ -118,7 +118,7 @@ function onWindowResize() {
1387+
@@ -119,7 +119,7 @@ function onWindowResize() {
13881388
}
13891389

13901390
function exportUSDZ() {
@@ -4051,32 +4051,10 @@ index a8195417..46230b4a 100644
40514051

40524052
render();
40534053
diff --git a/examples-testing/examples/webgl_geometries.ts b/examples-testing/examples/webgl_geometries.ts
4054-
index 2b2d0261..d5820b37 100644
4054+
index 0eb50120..a8181348 100644
40554055
--- a/examples-testing/examples/webgl_geometries.ts
40564056
+++ b/examples-testing/examples/webgl_geometries.ts
4057-
@@ -2,7 +2,7 @@ import * as THREE from 'three';
4058-
4059-
import Stats from 'three/addons/libs/stats.module.js';
4060-
4061-
-let camera, scene, renderer, stats;
4062-
+let camera: THREE.PerspectiveCamera, scene: THREE.Scene, renderer: THREE.WebGLRenderer, stats: Stats;
4063-
4064-
init();
4065-
4066-
@@ -127,7 +127,7 @@ function render() {
4067-
camera.lookAt(scene.position);
4068-
4069-
scene.traverse(function (object) {
4070-
- if (object.isMesh === true) {
4071-
+ if ((object as THREE.Mesh).isMesh === true) {
4072-
object.rotation.x = timer * 5;
4073-
object.rotation.y = timer * 2.5;
4074-
}
4075-
diff --git a/examples-testing/examples/webgl_geometries_parametric.ts b/examples-testing/examples/webgl_geometries_parametric.ts
4076-
index b9a0f520..fe7792cf 100644
4077-
--- a/examples-testing/examples/webgl_geometries_parametric.ts
4078-
+++ b/examples-testing/examples/webgl_geometries_parametric.ts
4079-
@@ -5,12 +5,12 @@ import Stats from 'three/addons/libs/stats.module.js';
4057+
@@ -5,7 +5,7 @@ import Stats from 'three/addons/libs/stats.module.js';
40804058
import { ParametricGeometry } from 'three/addons/geometries/ParametricGeometry.js';
40814059
import { plane, klein, mobius } from 'three/addons/geometries/ParametricFunctions.js';
40824060

@@ -4085,13 +4063,7 @@ index b9a0f520..fe7792cf 100644
40854063

40864064
init();
40874065

4088-
function init() {
4089-
- const container = document.getElementById('container');
4090-
+ const container = document.getElementById('container')!;
4091-
4092-
camera = new THREE.PerspectiveCamera(45, window.innerWidth / window.innerHeight, 1, 2000);
4093-
camera.position.y = 400;
4094-
@@ -93,7 +93,7 @@ function render() {
4066+
@@ -155,7 +155,7 @@ function render() {
40954067
camera.lookAt(scene.position);
40964068

40974069
scene.traverse(function (object) {
@@ -8136,7 +8108,7 @@ index 1ecf95f2..2373eb7e 100644
81368108
let needsUpdate = false;
81378109

81388110
diff --git a/examples-testing/examples/webgl_materials_blending.ts b/examples-testing/examples/webgl_materials_blending.ts
8139-
index 11cc009b..7f7fd73c 100644
8111+
index fb2e6a91..6063485e 100644
81408112
--- a/examples-testing/examples/webgl_materials_blending.ts
81418113
+++ b/examples-testing/examples/webgl_materials_blending.ts
81428114
@@ -1,7 +1,7 @@
@@ -8176,7 +8148,7 @@ index 11cc009b..7f7fd73c 100644
81768148
for (let i = 0; i < blendings.length; i++) {
81778149
const blending = blendings[i];
81788150

8179-
@@ -115,9 +115,9 @@ function onWindowResize() {
8151+
@@ -117,9 +117,9 @@ function onWindowResize() {
81808152
camera.updateProjectionMatrix();
81818153
}
81828154

@@ -8280,7 +8252,7 @@ index a09c2157..00fe46b6 100644
82808252

82818253
mesh.position.y = -0.5;
82828254
diff --git a/examples-testing/examples/webgl_materials_car.ts b/examples-testing/examples/webgl_materials_car.ts
8283-
index e810f7b7..5f71ea26 100644
8255+
index 4a0cd187..74be14c4 100644
82848256
--- a/examples-testing/examples/webgl_materials_car.ts
82858257
+++ b/examples-testing/examples/webgl_materials_car.ts
82868258
@@ -8,16 +8,16 @@ import { GLTFLoader } from 'three/addons/loaders/GLTFLoader.js';
@@ -8641,7 +8613,7 @@ index c3f3f4f7..4ae4cb95 100644
86418613
roughness: params.roughness,
86428614
envMapIntensity: 1.0,
86438615
diff --git a/examples-testing/examples/webgl_materials_envmaps_groundprojected.ts b/examples-testing/examples/webgl_materials_envmaps_groundprojected.ts
8644-
index 48e0077f..09c67188 100644
8616+
index 2c917caf..915aadca 100644
86458617
--- a/examples-testing/examples/webgl_materials_envmaps_groundprojected.ts
86468618
+++ b/examples-testing/examples/webgl_materials_envmaps_groundprojected.ts
86478619
@@ -13,7 +13,7 @@ const params = {
@@ -18468,7 +18440,7 @@ index feec1fd5..fb8b6727 100644
1846818440
init();
1846918441

1847018442
diff --git a/examples-testing/examples/webgpu_tsl_vfx_flames.ts b/examples-testing/examples/webgpu_tsl_vfx_flames.ts
18471-
index aefe757e..95d55f3c 100644
18443+
index c4808ba0..f8ad5737 100644
1847218444
--- a/examples-testing/examples/webgpu_tsl_vfx_flames.ts
1847318445
+++ b/examples-testing/examples/webgpu_tsl_vfx_flames.ts
1847418446
@@ -1,4 +1,4 @@

three.js

Submodule three.js updated 83 files

types/three/examples/jsm/capabilities/WebGL.d.ts

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,4 @@ export default class WebGL {
33
static isColorSpaceAvailable(colorSpace: PredefinedColorSpace): boolean;
44
static getWebGL2ErrorMessage(): HTMLElement;
55
static getErrorMessage(version: number): HTMLElement;
6-
7-
/**
8-
* @deprecated isWebGLAvailable() has been deprecated and will be removed in r178. Use isWebGL2Available() instead.
9-
*/
10-
static isWebGLAvailable(): boolean;
11-
12-
/**
13-
* @deprecated getWebGLErrorMessage() has been deprecated and will be removed in r178. Use getWebGL2ErrorMessage()
14-
* instead.
15-
*/
16-
static getWebGLErrorMessage(): HTMLElement;
176
}

types/three/src/Three.TSL.d.ts

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,6 @@ export const colorSpaceToWorking: typeof TSL.colorSpaceToWorking;
118118
export const colorToDirection: typeof TSL.colorToDirection;
119119
export const compute: typeof TSL.compute;
120120
export const computeSkinning: typeof TSL.computeSkinning;
121-
export const cond: typeof TSL.cond;
122121
export const Const: typeof TSL.Const;
123122
export const context: typeof TSL.context;
124123
export const convert: typeof TSL.convert;
@@ -237,7 +236,6 @@ export const globalId: typeof TSL.globalId;
237236
export const log: typeof TSL.log;
238237
export const log2: typeof TSL.log2;
239238
export const logarithmicDepthToViewZ: typeof TSL.logarithmicDepthToViewZ;
240-
export const loop: typeof TSL.loop;
241239
export const luminance: typeof TSL.luminance;
242240
export const mediumpModelViewMatrix: typeof TSL.mediumpModelViewMatrix;
243241
export const mat2: typeof TSL.mat2;
@@ -405,7 +403,6 @@ export const refract: typeof TSL.refract;
405403
export const refractVector: typeof TSL.refractVector;
406404
export const refractView: typeof TSL.refractView;
407405
export const reinhardToneMapping: typeof TSL.reinhardToneMapping;
408-
export const remainder: typeof TSL.remainder;
409406
export const remap: typeof TSL.remap;
410407
export const remapClamp: typeof TSL.remapClamp;
411408
export const renderGroup: typeof TSL.renderGroup;
@@ -503,14 +500,12 @@ export const triNoise3D: typeof TSL.triNoise3D;
503500
export const triplanarTexture: typeof TSL.triplanarTexture;
504501
export const triplanarTextures: typeof TSL.triplanarTextures;
505502
export const trunc: typeof TSL.trunc;
506-
export const tslFn: typeof TSL.tslFn;
507503
export const uint: typeof TSL.uint;
508504
export const uniform: typeof TSL.uniform;
509505
export const uniformCubeTexture: typeof TSL.uniformCubeTexture;
510506
export const uniformArray: typeof TSL.uniformArray;
511507
export const uniformGroup: typeof TSL.uniformGroup;
512508
export const uniformTexture: typeof TSL.uniformTexture;
513-
export const uniforms: typeof TSL.uniforms;
514509
export const unpremultiplyAlpha: typeof TSL.unpremultiplyAlpha;
515510
export const userData: typeof TSL.userData;
516511
export const uv: typeof TSL.uv;
@@ -532,7 +527,6 @@ export const viewZToLogarithmicDepth: typeof TSL.viewZToLogarithmicDepth;
532527
export const viewZToOrthographicDepth: typeof TSL.viewZToOrthographicDepth;
533528
export const viewZToPerspectiveDepth: typeof TSL.viewZToPerspectiveDepth;
534529
export const viewport: typeof TSL.viewport;
535-
export const viewportBottomLeft: typeof TSL.viewportBottomLeft;
536530
export const viewportCoordinate: typeof TSL.viewportCoordinate;
537531
export const viewportDepthTexture: typeof TSL.viewportDepthTexture;
538532
export const viewportLinearDepth: typeof TSL.viewportLinearDepth;
@@ -542,7 +536,6 @@ export const viewportSafeUV: typeof TSL.viewportSafeUV;
542536
export const viewportSharedTexture: typeof TSL.viewportSharedTexture;
543537
export const viewportSize: typeof TSL.viewportSize;
544538
export const viewportTexture: typeof TSL.viewportTexture;
545-
export const viewportTopLeft: typeof TSL.viewportTopLeft;
546539
export const viewportUV: typeof TSL.viewportUV;
547540
export const wgsl: typeof TSL.wgsl;
548541
export const wgslFn: typeof TSL.wgslFn;

types/three/src/nodes/accessors/UniformArrayNode.d.ts

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,3 @@ declare class UniformArrayNode extends BufferNode<unknown[]> {
2424
export default UniformArrayNode;
2525

2626
export const uniformArray: (values: unknown[], nodeType?: string | null) => ShaderNodeObject<UniformArrayNode>;
27-
28-
/**
29-
* @deprecated uniforms() has been renamed to uniformArray().
30-
*/
31-
export const uniforms: (values: unknown[], nodeType?: string | null) => ShaderNodeObject<UniformArrayNode>;

types/three/src/nodes/core/StackNode.d.ts

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -21,16 +21,6 @@ declare class StackNode extends Node {
2121
Case(...params: Node[]): this;
2222

2323
Default(method: () => void): this;
24-
25-
/**
26-
* @deprecated Use {@link StackNode#ElseIf Else()} instead.
27-
*/
28-
elseif(boolNode: Node, method: () => void): this;
29-
30-
/**
31-
* @deprecated Use {@link StackNode#Else Else()} instead.
32-
*/
33-
else(method: () => void): this;
3424
}
3525

3626
export default StackNode;

types/three/src/nodes/display/ScreenNode.d.ts

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -41,13 +41,3 @@ export const viewportUV: ShaderNodeObject<Node>;
4141
* @deprecated "viewportResolution" is deprecated. Use "screenSize" instead.
4242
*/
4343
export const viewportResolution: ShaderNodeObject<ScreenNode>;
44-
45-
/**
46-
* @deprecated "viewportTopLeft" is deprecated. Use "viewportUV" instead.
47-
*/
48-
export const viewportTopLeft: ShaderNodeObject<ScreenNode>;
49-
50-
/**
51-
* @deprecated "viewportBottomLeft" is deprecated. Use "viewportUV.flipY()" instead.
52-
*/
53-
export const viewportBottomLeft: ShaderNodeObject<ScreenNode>;

types/three/src/nodes/math/ConditionalNode.d.ts

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -22,18 +22,3 @@ declare module "../tsl/TSLCore.js" {
2222
select: typeof select;
2323
}
2424
}
25-
26-
/**
27-
* @deprecated cond() has been renamed to select()
28-
*/
29-
export const cond: (
30-
condNode: Node,
31-
ifNode: Node | number,
32-
elseNode?: Node | number | null,
33-
) => ShaderNodeObject<Node>;
34-
35-
declare module "../tsl/TSLCore.js" {
36-
interface NodeElements {
37-
cond: typeof cond;
38-
}
39-
}

types/three/src/nodes/math/OperatorNode.d.ts

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -116,26 +116,13 @@ declare module "../tsl/TSLCore.js" {
116116
}
117117
}
118118

119-
/**
120-
* @deprecated .remainder() has been renamed to .modInt().
121-
*/
122-
export const remainder: (
123-
aNode: OperatorNodeParameter,
124-
bNode: OperatorNodeParameter,
125-
...params: OperatorNodeParameter[]
126-
) => ShaderNodeObject<OperatorNode>;
127-
128119
/**
129120
* @deprecated "modInt()" is deprecated. Use "mod( int( ... ) )" instead.
130121
*/
131122
export const modInt: (a: OperatorNodeParameter, b: OperatorNodeParameter) => ShaderNodeObject<OperatorNode>;
132123

133124
declare module "../tsl/TSLCore.js" {
134125
interface NodeElements {
135-
/**
136-
* @deprecated .remainder() has been renamed to .modInt().
137-
*/
138-
remainder: typeof remainder;
139126
/**
140127
* @deprecated "modInt()" is deprecated. Use "mod( int( ... ) )" instead.
141128
*/

types/three/src/nodes/tsl/TSLCore.d.ts

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -435,20 +435,3 @@ export const split: (node: Node, channels?: string) => ShaderNodeObject<Node>;
435435
* @deprecated append() has been renamed to Stack().
436436
*/
437437
export const append: (node: Node) => Node;
438-
439-
/**
440-
* @deprecated tslFn() has been renamed to Fn()
441-
*/
442-
export function tslFn<R extends Node = ShaderNodeObject<Node>>(jsFunc: () => R): () => R;
443-
/**
444-
* @deprecated tslFn() has been renamed to Fn()
445-
*/
446-
export function tslFn<T extends any[], R extends Node = ShaderNodeObject<Node>>(
447-
jsFunc: (args: T) => R,
448-
): (...args: ProxiedTuple<T>) => R;
449-
/**
450-
* @deprecated tslFn() has been renamed to Fn()
451-
*/
452-
export function tslFn<T extends { [key: string]: unknown }, R extends Node = ShaderNodeObject<Node>>(
453-
jsFunc: (args: T) => R,
454-
): (args: ProxiedObject<T>) => R;

0 commit comments

Comments
 (0)