From db706f2ed8dc627d7f16cea214b9a9ca1cdf36e3 Mon Sep 17 00:00:00 2001 From: Nathan Bierema Date: Wed, 23 Oct 2024 22:13:08 -0400 Subject: [PATCH] TSL: Deprecated .temp() (#1304) * TSL: Deprecated .temp() * Update three.js * Update * Add examples * Update patch and delete examples * I guess * Add src * Update patch and delete src --- examples-testing/index.js | 1 + src-testing/changes.patch | 4 ++-- three.js | 2 +- types/three/src/nodes/core/VarNode.d.ts | 13 ++++++++++++- 4 files changed, 16 insertions(+), 4 deletions(-) diff --git a/examples-testing/index.js b/examples-testing/index.js index a50b35681..9a1a78a8f 100644 --- a/examples-testing/index.js +++ b/examples-testing/index.js @@ -68,6 +68,7 @@ const exceptionList = [ 'webgpu_equirectangular', 'webgpu_instance_mesh', 'webgpu_instance_points', + 'webgpu_instance_sprites', 'webgpu_instance_uniform', 'webgpu_lightprobe_cubecamera', 'webgpu_lights_custom', diff --git a/src-testing/changes.patch b/src-testing/changes.patch index bb339e1a4..fd0fe0ba2 100644 --- a/src-testing/changes.patch +++ b/src-testing/changes.patch @@ -6654,7 +6654,7 @@ index 520a3c91..524d188c 100644 } else { bindings.push(instanceGroup); diff --git a/src-testing/src/renderers/common/nodes/NodeLibrary.ts b/src-testing/src/renderers/common/nodes/NodeLibrary.ts -index d631572a..dc0c0a05 100644 +index 15931016..2128aa79 100644 --- a/src-testing/src/renderers/common/nodes/NodeLibrary.ts +++ b/src-testing/src/renderers/common/nodes/NodeLibrary.ts @@ -1,4 +1,21 @@ @@ -6724,7 +6724,7 @@ index d631572a..dc0c0a05 100644 - addMaterial(materialNodeClass, materialClass) { + addMaterial(materialNodeClass: { new (): NodeMaterial }, materialClass: { new (): Material }) { - this.addType(materialNodeClass, materialClass.name, this.materialNodes); + this.addType(materialNodeClass, materialClass.type, this.materialNodes); } - getLightNodeClass(light) { diff --git a/three.js b/three.js index 076ff0768..935589336 160000 --- a/three.js +++ b/three.js @@ -1 +1 @@ -Subproject commit 076ff07681da2a2f15ac5234029c287d6c265f21 +Subproject commit 93558933627b6edbea3fb8994a37f3f1b84b99f7 diff --git a/types/three/src/nodes/core/VarNode.d.ts b/types/three/src/nodes/core/VarNode.d.ts index 346c00fae..327df482a 100644 --- a/types/three/src/nodes/core/VarNode.d.ts +++ b/types/three/src/nodes/core/VarNode.d.ts @@ -10,11 +10,22 @@ export default class VarNode extends Node { constructor(node: Node, name?: string | null); } +declare module "../tsl/TSLCore.js" { + interface NodeElements { + toVar: (node: NodeRepresentation, name?: string | null) => ShaderNodeObject; + } +} + +/** + * @deprecated Use ".toVar()" instead. + */ export const temp: (node: NodeRepresentation, name?: string | null) => ShaderNodeObject; declare module "../tsl/TSLCore.js" { interface NodeElements { + /** + * @deprecated Use ".toVar()" instead. + */ temp: typeof temp; - toVar: typeof temp; } }