From 28aa0caebeaee320955486d3daeedaea6b363d5f Mon Sep 17 00:00:00 2001 From: Nathan Bierema Date: Mon, 11 Nov 2024 09:33:37 -0500 Subject: [PATCH 1/4] LDrawLoader: Add WebGPU support. --- types/three/examples/jsm/loaders/LDrawLoader.d.ts | 10 ++++++++++ .../jsm/materials/LDrawConditionalLineMaterial.d.ts | 9 +++++++++ .../materials/LDrawConditionalLineNodeMaterial.d.ts | 9 +++++++++ 3 files changed, 28 insertions(+) create mode 100644 types/three/examples/jsm/materials/LDrawConditionalLineMaterial.d.ts create mode 100644 types/three/examples/jsm/materials/LDrawConditionalLineNodeMaterial.d.ts diff --git a/types/three/examples/jsm/loaders/LDrawLoader.d.ts b/types/three/examples/jsm/loaders/LDrawLoader.d.ts index 8c30b3966..4fee24299 100644 --- a/types/three/examples/jsm/loaders/LDrawLoader.d.ts +++ b/types/three/examples/jsm/loaders/LDrawLoader.d.ts @@ -1,13 +1,23 @@ import { Group, Loader, LoadingManager, Material } from "three"; +import { LDrawConditionalLineMaterial } from "../materials/LDrawConditionalLineMaterial.js"; +import { LDrawConditionalLineMaterial as LDrawConditionalLineNodeMaterial } from "../materials/LDrawConditionalLineNodeMaterial.js"; export class LDrawLoader extends Loader { materials: Material[]; materialsLibrary: Record; + fileMap: Record; + smoothNormals: boolean; + ConditionalLineMaterial: typeof LDrawConditionalLineMaterial | typeof LDrawConditionalLineNodeMaterial | null; + constructor(manager?: LoadingManager); + setConditionalLineMaterial( + type: typeof LDrawConditionalLineMaterial | typeof LDrawConditionalLineNodeMaterial, + ): this; + preloadMaterials(url: string): Promise; setFileMap(fileMap: Record): void; setMaterials(materials: Material[]): void; diff --git a/types/three/examples/jsm/materials/LDrawConditionalLineMaterial.d.ts b/types/three/examples/jsm/materials/LDrawConditionalLineMaterial.d.ts new file mode 100644 index 000000000..43ed9411a --- /dev/null +++ b/types/three/examples/jsm/materials/LDrawConditionalLineMaterial.d.ts @@ -0,0 +1,9 @@ +import { ShaderMaterial, ShaderMaterialParameters } from "three"; + +declare class LDrawConditionalLineMaterial extends ShaderMaterial { + readonly isLDrawConditionalLineMaterial: true; + + constructor(parameters?: ShaderMaterialParameters); +} + +export { LDrawConditionalLineMaterial }; diff --git a/types/three/examples/jsm/materials/LDrawConditionalLineNodeMaterial.d.ts b/types/three/examples/jsm/materials/LDrawConditionalLineNodeMaterial.d.ts new file mode 100644 index 000000000..bd49be43e --- /dev/null +++ b/types/three/examples/jsm/materials/LDrawConditionalLineNodeMaterial.d.ts @@ -0,0 +1,9 @@ +import { NodeMaterial, NodeMaterialParameters } from "three/tsl"; + +declare class LDrawConditionalLineMaterial extends NodeMaterial { + readonly isLDrawConditionalLineMaterial: true; + + constructor(parameters?: NodeMaterialParameters); +} + +export { LDrawConditionalLineMaterial }; From b9e105b1be76b7709947908b2597064b0377e60c Mon Sep 17 00:00:00 2001 From: Nathan Bierema Date: Mon, 11 Nov 2024 09:33:55 -0500 Subject: [PATCH 2/4] Update three.js --- three.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/three.js b/three.js index 751d9ec13..d067dfd7f 160000 --- a/three.js +++ b/three.js @@ -1 +1 @@ -Subproject commit 751d9ec135a25c2236c210e45e8d866024043b77 +Subproject commit d067dfd7f5861fdb783f6fffdcd92a18a15df46f From 3dc021112c789a33fbb8741f4c77695dc4dc269d Mon Sep 17 00:00:00 2001 From: Nathan Bierema Date: Mon, 11 Nov 2024 09:39:15 -0500 Subject: [PATCH 3/4] Update --- types/three/examples/jsm/Addons.d.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/types/three/examples/jsm/Addons.d.ts b/types/three/examples/jsm/Addons.d.ts index 45fc66bf8..d53c15d44 100644 --- a/types/three/examples/jsm/Addons.d.ts +++ b/types/three/examples/jsm/Addons.d.ts @@ -127,7 +127,9 @@ export * from "./loaders/VRMLLoader.js"; export * from "./loaders/VTKLoader.js"; export * from "./loaders/XYZLoader.js"; +export * from "./materials/LDrawConditionalLineMaterial.js"; export * from "./materials/MeshGouraudMaterial.js"; +export * from "./materials/MeshPostProcessingMaterial.js"; export * from "./math/Capsule.js"; export * from "./math/ColorConverter.js"; From e9e8711f2dcf14f791210abc3bf54c2b2dff33cd Mon Sep 17 00:00:00 2001 From: Nathan Bierema Date: Mon, 11 Nov 2024 09:42:36 -0500 Subject: [PATCH 4/4] Update --- .../nodes/MeshNormalNodeMaterial.d.ts | 4 +-- .../src/materials/nodes/NodeMaterials.d.ts | 35 ++++++++++--------- 2 files changed, 21 insertions(+), 18 deletions(-) diff --git a/types/three/src/materials/nodes/MeshNormalNodeMaterial.d.ts b/types/three/src/materials/nodes/MeshNormalNodeMaterial.d.ts index 761998bac..6c398b4c3 100644 --- a/types/three/src/materials/nodes/MeshNormalNodeMaterial.d.ts +++ b/types/three/src/materials/nodes/MeshNormalNodeMaterial.d.ts @@ -4,7 +4,7 @@ import { Texture } from "../../textures/Texture.js"; import { MeshNormalMaterialParameters } from "../MeshNormalMaterial.js"; import NodeMaterial, { NodeMaterialParameters } from "./NodeMaterial.js"; -export interface MeshBasicNodeMaterialParameters extends NodeMaterialParameters, MeshNormalMaterialParameters { +export interface MeshNormalNodeMaterialParameters extends NodeMaterialParameters, MeshNormalMaterialParameters { } export default class MeshNormalNodeMaterial extends NodeMaterial { @@ -24,5 +24,5 @@ export default class MeshNormalNodeMaterial extends NodeMaterial { wireframeLinewidth: number; flatShading: boolean; - constructor(parameters?: MeshBasicNodeMaterialParameters); + constructor(parameters?: MeshNormalNodeMaterialParameters); } diff --git a/types/three/src/materials/nodes/NodeMaterials.d.ts b/types/three/src/materials/nodes/NodeMaterials.d.ts index 395273cd9..00a976e39 100644 --- a/types/three/src/materials/nodes/NodeMaterials.d.ts +++ b/types/three/src/materials/nodes/NodeMaterials.d.ts @@ -1,18 +1,21 @@ -export { default as InstancedPointsNodeMaterial } from "./InstancedPointsNodeMaterial.js"; -export { default as Line2NodeMaterial } from "./Line2NodeMaterial.js"; -export { default as LineBasicNodeMaterial } from "./LineBasicNodeMaterial.js"; -export { default as LineDashedNodeMaterial } from "./LineDashedNodeMaterial.js"; -export { default as MeshBasicNodeMaterial } from "./MeshBasicNodeMaterial.js"; -export { default as MeshLambertNodeMaterial } from "./MeshLambertNodeMaterial.js"; -export { default as MeshMatcapNodeMaterial } from "./MeshMatcapNodeMaterial.js"; -export { default as MeshNormalNodeMaterial } from "./MeshNormalNodeMaterial.js"; -export { default as MeshPhongNodeMaterial } from "./MeshPhongNodeMaterial.js"; -export { default as MeshPhysicalNodeMaterial } from "./MeshPhysicalNodeMaterial.js"; +export { + default as InstancedPointsNodeMaterial, + InstancedPointsNodeMaterialParameters, +} from "./InstancedPointsNodeMaterial.js"; +export { default as Line2NodeMaterial, Line2NodeMaterialParameters } from "./Line2NodeMaterial.js"; +export { default as LineBasicNodeMaterial, LineBasicNodeMaterialParameters } from "./LineBasicNodeMaterial.js"; +export { default as LineDashedNodeMaterial, LineDashedNodeMaterialParameters } from "./LineDashedNodeMaterial.js"; +export { default as MeshBasicNodeMaterial, MeshBasicNodeMaterialParameters } from "./MeshBasicNodeMaterial.js"; +export { default as MeshLambertNodeMaterial, MeshLambertNodeMaterialParameters } from "./MeshLambertNodeMaterial.js"; +export { default as MeshMatcapNodeMaterial, MeshMatcapNodeMaterialParameters } from "./MeshMatcapNodeMaterial.js"; +export { default as MeshNormalNodeMaterial, MeshNormalNodeMaterialParameters } from "./MeshNormalNodeMaterial.js"; +export { default as MeshPhongNodeMaterial, MeshPhongNodeMaterialParameters } from "./MeshPhongNodeMaterial.js"; +export { default as MeshPhysicalNodeMaterial, MeshPhysicalNodeMaterialParameters } from "./MeshPhysicalNodeMaterial.js"; export { default as MeshSSSNodeMaterial } from "./MeshSSSNodeMaterial.js"; -export { default as MeshStandardNodeMaterial } from "./MeshStandardNodeMaterial.js"; -export { default as MeshToonNodeMaterial } from "./MeshToonNodeMaterial.js"; -export { default as NodeMaterial } from "./NodeMaterial.js"; -export { default as PointsNodeMaterial } from "./PointsNodeMaterial.js"; -export { default as ShadowNodeMaterial } from "./ShadowNodeMaterial.js"; -export { default as SpriteNodeMaterial } from "./SpriteNodeMaterial.js"; +export { default as MeshStandardNodeMaterial, MeshStandardNodeMaterialParameters } from "./MeshStandardNodeMaterial.js"; +export { default as MeshToonNodeMaterial, MeshToonNodeMaterialParameters } from "./MeshToonNodeMaterial.js"; +export { default as NodeMaterial, NodeMaterialParameters } from "./NodeMaterial.js"; +export { default as PointsNodeMaterial, PointsNodeMaterialParameters } from "./PointsNodeMaterial.js"; +export { default as ShadowNodeMaterial, ShadowNodeMaterialParameters } from "./ShadowNodeMaterial.js"; +export { default as SpriteNodeMaterial, SpriteNodeMaterialParameters } from "./SpriteNodeMaterial.js"; export { default as VolumeNodeMaterial } from "./VolumeNodeMaterial.js";