@needle-tools/three-mesh-effects 0.0.0-stage → 0.1.0-alpha.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (173) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +93 -2
  3. package/build/deformation-runtime.js +2143 -0
  4. package/build/deformation-runtime.js.map +7 -0
  5. package/build/impostor-runtime-needle-engine.js +42 -0
  6. package/build/impostor-runtime-needle-engine.js.map +7 -0
  7. package/build/impostor-runtime.js +1333 -0
  8. package/build/impostor-runtime.js.map +7 -0
  9. package/build/internal/deformation/cloth-surface.js +288 -0
  10. package/build/internal/deformation/cloth-surface.js.map +7 -0
  11. package/build/internal/deformation/fur-surface.js +130 -0
  12. package/build/internal/deformation/fur-surface.js.map +7 -0
  13. package/build/internal/deformation/ik-constraints.js +44 -0
  14. package/build/internal/deformation/ik-constraints.js.map +7 -0
  15. package/build/internal/deformation/joints-json.js +197 -0
  16. package/build/internal/deformation/joints-json.js.map +7 -0
  17. package/build/internal/deformation/limits.js +16 -0
  18. package/build/internal/deformation/limits.js.map +7 -0
  19. package/build/internal/deformation/motion-settings.js +12 -0
  20. package/build/internal/deformation/motion-settings.js.map +7 -0
  21. package/build/internal/deformation/pin-cloth.js +196 -0
  22. package/build/internal/deformation/pin-cloth.js.map +7 -0
  23. package/build/internal/deformation/pin-ik.js +650 -0
  24. package/build/internal/deformation/pin-ik.js.map +7 -0
  25. package/build/internal/deformation/pin-types.js +12 -0
  26. package/build/internal/deformation/pin-types.js.map +7 -0
  27. package/build/internal/deformation/pin-wiggle.js +249 -0
  28. package/build/internal/deformation/pin-wiggle.js.map +7 -0
  29. package/build/internal/deformation/pose-slots.js +84 -0
  30. package/build/internal/deformation/pose-slots.js.map +7 -0
  31. package/build/internal/deformation/pose-timeline.js +210 -0
  32. package/build/internal/deformation/pose-timeline.js.map +7 -0
  33. package/build/internal/deformation/rig-drivers.js +48 -0
  34. package/build/internal/deformation/rig-drivers.js.map +7 -0
  35. package/build/internal/deformation/rig-extension.js +334 -0
  36. package/build/internal/deformation/rig-extension.js.map +7 -0
  37. package/build/internal/deformation/rig-runtime.js +2141 -0
  38. package/build/internal/deformation/rig-runtime.js.map +7 -0
  39. package/build/internal/deformation/wind.js +34 -0
  40. package/build/internal/deformation/wind.js.map +7 -0
  41. package/build/internal/impostor/impostor-metadata.js +77 -0
  42. package/build/internal/impostor/impostor-metadata.js.map +7 -0
  43. package/build/internal/impostor/impostor-node-material.js +1331 -0
  44. package/build/internal/impostor/impostor-node-material.js.map +7 -0
  45. package/build/internal/impostor/impostor-runtime-support.js +162 -0
  46. package/build/internal/impostor/impostor-runtime-support.js.map +7 -0
  47. package/build/internal/impostor/octahedral.js +232 -0
  48. package/build/internal/impostor/octahedral.js.map +7 -0
  49. package/build/internal/pixel-impostor/pixel-impostor-display.js +728 -0
  50. package/build/internal/pixel-impostor/pixel-impostor-display.js.map +7 -0
  51. package/build/internal/pixel-impostor/pixel-impostor-metadata.js +71 -0
  52. package/build/internal/pixel-impostor/pixel-impostor-metadata.js.map +7 -0
  53. package/build/internal/pixel-impostor/pixel-impostor-runtime.js +150 -0
  54. package/build/internal/pixel-impostor/pixel-impostor-runtime.js.map +7 -0
  55. package/build/internal/rendering/skin-projection.js +4630 -0
  56. package/build/internal/rendering/skin-projection.js.map +7 -0
  57. package/build/internal/rendering/surface-query.js +4519 -0
  58. package/build/internal/rendering/surface-query.js.map +7 -0
  59. package/build/internal/rendering/wireframe.js +112 -0
  60. package/build/internal/rendering/wireframe.js.map +7 -0
  61. package/build/internal/rendering/wrap-preview-settings.js +126 -0
  62. package/build/internal/rendering/wrap-preview-settings.js.map +7 -0
  63. package/build/internal/rendering/wrap-preview.js +5610 -0
  64. package/build/internal/rendering/wrap-preview.js.map +7 -0
  65. package/build/internal/rendering/wrap-skin.js +4746 -0
  66. package/build/internal/rendering/wrap-skin.js.map +7 -0
  67. package/build/pixel-impostor-runtime.js +876 -0
  68. package/build/pixel-impostor-runtime.js.map +7 -0
  69. package/build/types/deformation/cloth-surface.d.ts +39 -0
  70. package/build/types/deformation/cloth-surface.js +1 -0
  71. package/build/types/deformation/fur-surface.d.ts +27 -0
  72. package/build/types/deformation/fur-surface.js +1 -0
  73. package/build/types/deformation/ik-constraints.d.ts +18 -0
  74. package/build/types/deformation/ik-constraints.js +1 -0
  75. package/build/types/deformation/joints-json.d.ts +17 -0
  76. package/build/types/deformation/joints-json.js +1 -0
  77. package/build/types/deformation/limits.d.ts +23 -0
  78. package/build/types/deformation/limits.js +1 -0
  79. package/build/types/deformation/motion-settings.d.ts +9 -0
  80. package/build/types/deformation/motion-settings.js +1 -0
  81. package/build/types/deformation/pin-cloth.d.ts +28 -0
  82. package/build/types/deformation/pin-cloth.js +1 -0
  83. package/build/types/deformation/pin-ik.d.ts +37 -0
  84. package/build/types/deformation/pin-ik.js +1 -0
  85. package/build/types/deformation/pin-types.d.ts +53 -0
  86. package/build/types/deformation/pin-types.js +1 -0
  87. package/build/types/deformation/pin-wiggle.d.ts +16 -0
  88. package/build/types/deformation/pin-wiggle.js +1 -0
  89. package/build/types/deformation/pose-slots.d.ts +41 -0
  90. package/build/types/deformation/pose-slots.js +1 -0
  91. package/build/types/deformation/pose-timeline.d.ts +65 -0
  92. package/build/types/deformation/pose-timeline.js +1 -0
  93. package/build/types/deformation/rig-drivers.d.ts +19 -0
  94. package/build/types/deformation/rig-drivers.js +1 -0
  95. package/build/types/deformation/rig-extension.d.ts +33 -0
  96. package/build/types/deformation/rig-extension.js +1 -0
  97. package/build/types/deformation/rig-runtime.d.ts +95 -0
  98. package/build/types/deformation/rig-runtime.js +1 -0
  99. package/build/types/deformation/wind.d.ts +16 -0
  100. package/build/types/deformation/wind.js +1 -0
  101. package/build/types/impostor/impostor-metadata.d.ts +61 -0
  102. package/build/types/impostor/impostor-metadata.js +1 -0
  103. package/build/types/impostor/impostor-node-material.d.ts +140 -0
  104. package/build/types/impostor/impostor-node-material.js +1 -0
  105. package/build/types/impostor/impostor-runtime-support.d.ts +52 -0
  106. package/build/types/impostor/impostor-runtime-support.js +1 -0
  107. package/build/types/impostor/octahedral.d.ts +84 -0
  108. package/build/types/impostor/octahedral.js +1 -0
  109. package/build/types/pixel-impostor/pixel-impostor-display.d.ts +48 -0
  110. package/build/types/pixel-impostor/pixel-impostor-display.js +1 -0
  111. package/build/types/pixel-impostor/pixel-impostor-metadata.d.ts +34 -0
  112. package/build/types/pixel-impostor/pixel-impostor-metadata.js +1 -0
  113. package/build/types/pixel-impostor/pixel-impostor-runtime.d.ts +18 -0
  114. package/build/types/pixel-impostor/pixel-impostor-runtime.js +1 -0
  115. package/build/types/public/deformation-runtime.d.ts +3 -0
  116. package/build/types/public/deformation-runtime.js +1 -0
  117. package/build/types/public/impostor-runtime-needle-engine.d.ts +31 -0
  118. package/build/types/public/impostor-runtime-needle-engine.js +1 -0
  119. package/build/types/public/impostor-runtime.d.ts +6 -0
  120. package/build/types/public/impostor-runtime.js +1 -0
  121. package/build/types/public/pixel-impostor-runtime.d.ts +3 -0
  122. package/build/types/public/pixel-impostor-runtime.js +1 -0
  123. package/build/types/public/wrap-effects.d.ts +4 -0
  124. package/build/types/public/wrap-effects.js +1 -0
  125. package/build/types/rendering/skin-projection.d.ts +44 -0
  126. package/build/types/rendering/skin-projection.js +1 -0
  127. package/build/types/rendering/surface-query.d.ts +66 -0
  128. package/build/types/rendering/surface-query.js +1 -0
  129. package/build/types/rendering/wireframe.d.ts +25 -0
  130. package/build/types/rendering/wireframe.js +1 -0
  131. package/build/types/rendering/wrap-preview-settings.d.ts +22 -0
  132. package/build/types/rendering/wrap-preview-settings.js +1 -0
  133. package/build/types/rendering/wrap-preview.d.ts +39 -0
  134. package/build/types/rendering/wrap-preview.js +1 -0
  135. package/build/types/rendering/wrap-skin.d.ts +14 -0
  136. package/build/types/rendering/wrap-skin.js +1 -0
  137. package/build/wrap-effects.js +5640 -0
  138. package/build/wrap-effects.js.map +7 -0
  139. package/package.json +105 -4
  140. package/src/deformation/cloth-surface.ts +223 -0
  141. package/src/deformation/fur-surface.ts +129 -0
  142. package/src/deformation/ik-constraints.ts +37 -0
  143. package/src/deformation/joints-json.ts +94 -0
  144. package/src/deformation/limits.ts +25 -0
  145. package/src/deformation/motion-settings.ts +9 -0
  146. package/src/deformation/pin-cloth.ts +149 -0
  147. package/src/deformation/pin-ik.ts +582 -0
  148. package/src/deformation/pin-types.ts +22 -0
  149. package/src/deformation/pin-wiggle.ts +119 -0
  150. package/src/deformation/pose-slots.ts +106 -0
  151. package/src/deformation/pose-timeline.ts +242 -0
  152. package/src/deformation/rig-drivers.ts +32 -0
  153. package/src/deformation/rig-extension.ts +87 -0
  154. package/src/deformation/rig-runtime.ts +416 -0
  155. package/src/deformation/wind.ts +36 -0
  156. package/src/impostor/impostor-metadata.js +137 -0
  157. package/src/impostor/impostor-node-material.js +1581 -0
  158. package/src/impostor/impostor-runtime-support.js +139 -0
  159. package/src/impostor/octahedral.js +280 -0
  160. package/src/pixel-impostor/pixel-impostor-display.js +794 -0
  161. package/src/pixel-impostor/pixel-impostor-metadata.js +74 -0
  162. package/src/pixel-impostor/pixel-impostor-runtime.js +78 -0
  163. package/src/public/deformation-runtime.ts +3 -0
  164. package/src/public/impostor-runtime-needle-engine.js +56 -0
  165. package/src/public/impostor-runtime.js +21 -0
  166. package/src/public/pixel-impostor-runtime.js +5 -0
  167. package/src/public/wrap-effects.js +21 -0
  168. package/src/rendering/skin-projection.js +113 -0
  169. package/src/rendering/surface-query.js +88 -0
  170. package/src/rendering/wireframe.js +115 -0
  171. package/src/rendering/wrap-preview-settings.js +123 -0
  172. package/src/rendering/wrap-preview.js +645 -0
  173. package/src/rendering/wrap-skin.js +109 -0
@@ -0,0 +1,31 @@
1
+ /**
2
+ * Registers impostor loading for all subsequent Needle Engine glTF imports.
3
+ * Keep the returned plugin if it needs to be unregistered later.
4
+ *
5
+ * @param {ConstructorParameters<typeof NeedleEngineImpostorLoaderPlugin>[0]=} options
6
+ */
7
+ export function registerNeedleEngineImpostorLoader(options?: ConstructorParameters<typeof NeedleEngineImpostorLoaderPlugin>[0] | undefined): NeedleEngineImpostorLoaderPlugin;
8
+ /** @param {NeedleEngineImpostorLoaderPlugin} plugin */
9
+ export function unregisterNeedleEngineImpostorLoader(plugin: NeedleEngineImpostorLoaderPlugin): void;
10
+ /** @typedef {import('@needle-tools/engine').INeedleGLTFExtensionPlugin} INeedleGLTFExtensionPlugin */
11
+ /**
12
+ * Needle Engine adapter that installs the impostor Three.js loader plugin on
13
+ * every GLTFLoader created by the engine.
14
+ *
15
+ * @implements {INeedleGLTFExtensionPlugin}
16
+ */
17
+ export class NeedleEngineImpostorLoaderPlugin implements INeedleGLTFExtensionPlugin {
18
+ /** @param {Parameters<typeof registerNeedleImpostorLoader>[1]=} options */
19
+ constructor(options?: Parameters<typeof registerNeedleImpostorLoader>[1] | undefined);
20
+ name: string;
21
+ /** @type {Parameters<typeof registerNeedleImpostorLoader>[1]} */
22
+ options: Parameters<typeof registerNeedleImpostorLoader>[1];
23
+ /**
24
+ * @param {import('three/addons/loaders/GLTFLoader.js').GLTFLoader} loader
25
+ * @param {string} _url
26
+ * @param {import('@needle-tools/engine').Context} context
27
+ */
28
+ onImport: (loader: import("three/addons/loaders/GLTFLoader.js").GLTFLoader, _url: string, context: import("@needle-tools/engine").Context) => void;
29
+ }
30
+ export type INeedleGLTFExtensionPlugin = import("@needle-tools/engine").INeedleGLTFExtensionPlugin;
31
+ import { registerNeedleImpostorLoader } from '@needle-tools/three-mesh-effects/impostor-runtime';
@@ -0,0 +1 @@
1
+ export * from '../../../src/public/impostor-runtime-needle-engine.js';
@@ -0,0 +1,6 @@
1
+ export type ImpostorDescriptor = import("../impostor/impostor-metadata.js").ImpostorDescriptor;
2
+ export type ImpostorRuntimeFeatures = import("../impostor/impostor-node-material.js").ImpostorRuntimeFeatures;
3
+ export type ResolvedImpostorRuntimeFeatures = import("../impostor/impostor-node-material.js").ResolvedImpostorRuntimeFeatures;
4
+ export type ImpostorRenderer = import("../impostor/impostor-node-material.js").ImpostorRenderer;
5
+ export { DEFAULT_IMPOSTOR_RUNTIME_FEATURES, IMPOSTOR_RUNTIME_SAMPLE_LIMITS, NeedleImpostorLoaderPlugin, createPbrImpostorNodeMaterial, registerNeedleImpostorLoader, rendererSupportsImpostorNodeMaterials, resolveImpostorRuntimeFeatures, upgradeImpostorScene } from "../impostor/impostor-node-material.js";
6
+ export { NEEDLE_MESH_IMPOSTOR, parseImpostorDescriptor } from "../impostor/impostor-metadata.js";
@@ -0,0 +1 @@
1
+ export * from '../../../src/public/impostor-runtime.js';
@@ -0,0 +1,3 @@
1
+ export { NeedlePixelImpostorLoaderPlugin, registerNeedlePixelImpostorLoader } from "../pixel-impostor/pixel-impostor-runtime.js";
2
+ export { NEEDLE_PIXEL_IMPOSTOR, parsePixelImpostorDescriptor } from "../pixel-impostor/pixel-impostor-metadata.js";
3
+ export { createPixelImpostorDisplay, createPixelImpostorRaycastPreview } from "../pixel-impostor/pixel-impostor-display.js";
@@ -0,0 +1 @@
1
+ export * from '../../../src/public/pixel-impostor-runtime.js';
@@ -0,0 +1,4 @@
1
+ export { captureWrapSkinPose } from "../rendering/wrap-skin.js";
2
+ export { createWrapPreview, prepareIceNormalAttributes, prepareAuraGeometry, prepareRayGeometry } from "../rendering/wrap-preview.js";
3
+ export { WRAP_PREVIEW_MODES, WRAP_PREVIEW_CONTROLS, createWrapPreviewValues, isWrapTopology } from "../rendering/wrap-preview-settings.js";
4
+ export { createBarycentricWireframeGeometry, createPreviewWireframeMaterial, applyPreviewWireframeBlendMode, parseWireframeBlendMode } from "../rendering/wireframe.js";
@@ -0,0 +1 @@
1
+ export * from '../../../src/public/wrap-effects.js';
@@ -0,0 +1,44 @@
1
+ /** @typedef {{size: number, data: Float32Array}} SkinAttribute */
2
+ /** @typedef {{positions: Float32Array, indices: Uint32Array, attributes: Map<string, SkinAttribute>}} SkinGeometry */
3
+ /** @param {SkinGeometry[]} meshes @returns {SkinGeometry} */
4
+ export function mergeSkinGeometry(meshes: SkinGeometry[]): SkinGeometry;
5
+ /** Reusable triangle barycentrics for both weight transfer and pose validation.
6
+ * @param {SkinGeometry} surface
7
+ * @param {{fastBuild?: boolean}} [options] A fast build suits a query made for a few thousand lookups.
8
+ */
9
+ export function skinSurface(surface: SkinGeometry, options?: {
10
+ fastBuild?: boolean;
11
+ }): {
12
+ dispose: () => void;
13
+ /** @param {ArrayLike<number>} position */
14
+ closest(position: ArrayLike<number>): {
15
+ vertices: number[];
16
+ bary: import("three").Vector3Tuple;
17
+ point: number[];
18
+ face: number;
19
+ };
20
+ };
21
+ /** Transfer the closest source triangle's attributes. Joint IDs are categorical:
22
+ * accumulate contributions per ID, keep the strongest four, then normalize.
23
+ * Snapping is useful for point wraps, but reconstructed topology must retain
24
+ * its positions: independently snapping its vertices can invert or collapse
25
+ * triangles even though every individual vertex lands on the source.
26
+ * @param {SkinGeometry} source @param {{positions: Float32Array, indices: Uint32Array}} target
27
+ * @param {{snapPositions?: boolean}} [options]
28
+ * @returns {SkinGeometry}
29
+ */
30
+ export function projectSkinGeometry(source: SkinGeometry, target: {
31
+ positions: Float32Array;
32
+ indices: Uint32Array;
33
+ }, options?: {
34
+ snapPositions?: boolean;
35
+ }): SkinGeometry;
36
+ export type SkinAttribute = {
37
+ size: number;
38
+ data: Float32Array;
39
+ };
40
+ export type SkinGeometry = {
41
+ positions: Float32Array;
42
+ indices: Uint32Array;
43
+ attributes: Map<string, SkinAttribute>;
44
+ };
@@ -0,0 +1 @@
1
+ export * from '../../../src/rendering/skin-projection.js';
@@ -0,0 +1,66 @@
1
+ /**
2
+ * @param {QueryMesh} mesh
3
+ * @param {{fastBuild?:boolean, geometryOnly?:boolean}=} options Fast builds use centroid-average splits; geometry-only queries omit UV/normal interpolation in ray hits.
4
+ */
5
+ export function createSurfaceQuery(mesh: QueryMesh, options?: {
6
+ fastBuild?: boolean;
7
+ geometryOnly?: boolean;
8
+ } | undefined): {
9
+ geometry: BufferGeometry<import("three").NormalBufferAttributes, import("three").BufferGeometryEventMap>;
10
+ bvh: MeshBVH;
11
+ /**
12
+ * @param {ArrayLike<number>} value
13
+ * @param {number=} maxDistance
14
+ */
15
+ closestPoint(value: ArrayLike<number>, maxDistance?: number | undefined): {
16
+ point: number[];
17
+ distance: number;
18
+ faceIndex: number;
19
+ } | null;
20
+ /**
21
+ * @param {ArrayLike<number>} origin
22
+ * @param {ArrayLike<number>} rayDirection
23
+ * @param {number} near
24
+ * @param {number} far
25
+ * @param {'front' | 'back'} side
26
+ */
27
+ raycastFirst(origin: ArrayLike<number>, rayDirection: ArrayLike<number>, near: number, far: number, side?: "front" | "back"): import("three").Intersection<import("three").Object3D<import("three").Object3DEventMap>> | null;
28
+ dispose(): void;
29
+ };
30
+ /**
31
+ * Wraps a prebuilt BVH with the allocation-reusing query API used by the wrap skin preview and baker. The geometry and BVH must use indirect indexing so face IDs stay
32
+ * aligned with the source triangle arrays.
33
+ *
34
+ * @param {BufferGeometry} geometry
35
+ * @param {MeshBVH} bvh
36
+ */
37
+ export function createSurfaceQueryFromBvh(geometry: BufferGeometry, bvh: MeshBVH): {
38
+ geometry: BufferGeometry<import("three").NormalBufferAttributes, import("three").BufferGeometryEventMap>;
39
+ bvh: MeshBVH;
40
+ /**
41
+ * @param {ArrayLike<number>} value
42
+ * @param {number=} maxDistance
43
+ */
44
+ closestPoint(value: ArrayLike<number>, maxDistance?: number | undefined): {
45
+ point: number[];
46
+ distance: number;
47
+ faceIndex: number;
48
+ } | null;
49
+ /**
50
+ * @param {ArrayLike<number>} origin
51
+ * @param {ArrayLike<number>} rayDirection
52
+ * @param {number} near
53
+ * @param {number} far
54
+ * @param {'front' | 'back'} side
55
+ */
56
+ raycastFirst(origin: ArrayLike<number>, rayDirection: ArrayLike<number>, near: number, far: number, side?: "front" | "back"): import("three").Intersection<import("three").Object3D<import("three").Object3DEventMap>> | null;
57
+ dispose(): void;
58
+ };
59
+ export type QueryMesh = {
60
+ positions: Float32Array;
61
+ indices: Uint32Array;
62
+ normals?: Float32Array;
63
+ uvs?: Float32Array;
64
+ };
65
+ import { BufferGeometry } from 'three';
66
+ import { MeshBVH } from 'three-mesh-bvh';
@@ -0,0 +1 @@
1
+ export * from '../../../src/rendering/surface-query.js';
@@ -0,0 +1,25 @@
1
+ /** @typedef {'black' | 'white' | 'invert'} WireframeBlendMode */
2
+ /**
3
+ * Produces a triangle overlay with a screen-space barycentric edge mask. Unlike
4
+ * hardware line primitives this supports stable, adjustable pixel thickness.
5
+ * @param {THREE.Material} sourceMaterial
6
+ * @param {boolean} isImpostor
7
+ * @param {number} thickness
8
+ * @param {WireframeBlendMode} blendMode
9
+ */
10
+ export function createPreviewWireframeMaterial(sourceMaterial: THREE.Material, isImpostor: boolean, thickness: number, blendMode: WireframeBlendMode): MeshBasicNodeMaterial;
11
+ /** @param {string} value @returns {WireframeBlendMode} */
12
+ export function parseWireframeBlendMode(value: string): WireframeBlendMode;
13
+ /**
14
+ * @param {THREE.Material} material
15
+ * @param {WireframeBlendMode} mode
16
+ */
17
+ export function applyPreviewWireframeBlendMode(material: THREE.Material, mode: WireframeBlendMode): void;
18
+ /**
19
+ * @param {THREE.BufferGeometry} source
20
+ * @returns {THREE.BufferGeometry}
21
+ */
22
+ export function createBarycentricWireframeGeometry(source: THREE.BufferGeometry): THREE.BufferGeometry;
23
+ export type WireframeBlendMode = "black" | "white" | "invert";
24
+ import * as THREE from 'three';
25
+ import { MeshBasicNodeMaterial } from 'three/webgpu';
@@ -0,0 +1 @@
1
+ export * from '../../../src/rendering/wireframe.js';
@@ -0,0 +1,22 @@
1
+ export function createWrapPreviewValues(): {
2
+ [k: string]: {
3
+ [k: string]: number;
4
+ };
5
+ };
6
+ /** Includes older reports whose wrap stages live inside material groups.
7
+ * @param {unknown} topology
8
+ * @returns {boolean}
9
+ */
10
+ export function isWrapTopology(topology: unknown): boolean;
11
+ export const WRAP_PREVIEW_MODES: string[];
12
+ /** @type {Record<string, {key: string, label: string, min: number, max: number, step: number, value: number, title: string, kind?: string}[]>} */
13
+ export const WRAP_PREVIEW_CONTROLS: Record<string, {
14
+ key: string;
15
+ label: string;
16
+ min: number;
17
+ max: number;
18
+ step: number;
19
+ value: number;
20
+ title: string;
21
+ kind?: string;
22
+ }[]>;
@@ -0,0 +1 @@
1
+ export * from '../../../src/rendering/wrap-preview-settings.js';
@@ -0,0 +1,39 @@
1
+ /** Ice normal streams adapted from pocket-sun/src/lib/frozenSpecimenIce.ts. */
2
+ /** @param {THREE.BufferGeometry} source */
3
+ export function prepareIceNormalAttributes(source: THREE.BufferGeometry): THREE.BufferGeometry<THREE.NormalBufferAttributes, THREE.BufferGeometryEventMap>;
4
+ /** Preview-only tessellation: continuous normals prevent cracks between flames.
5
+ * The baked/exported low-poly geometry is never modified.
6
+ * @param {THREE.BufferGeometry} source
7
+ */
8
+ export function prepareAuraGeometry(source: THREE.BufferGeometry): THREE.BufferGeometry<THREE.NormalBufferAttributes, THREE.BufferGeometryEventMap>;
9
+ /** Open extrusion curtains, with no end caps or displaced surface patches.
10
+ * Adjacent face normals let the shader select only directional silhouette edges.
11
+ * @param {THREE.BufferGeometry} source
12
+ */
13
+ export function prepareRayGeometry(source: THREE.BufferGeometry): THREE.BufferGeometry<THREE.NormalBufferAttributes, THREE.BufferGeometryEventMap>;
14
+ /**
15
+ * Borrowed originals are never mutated or disposed. All generated geometry,
16
+ * materials, and instances belong to this effect, not the GLB. Call `dispose()`
17
+ * before unloading the source or wrap. `update(values)` returns false when a
18
+ * compile-time shader variant changed; create a new effect in that case.
19
+ * @param {THREE.Object3D} asset
20
+ * @param {THREE.Object3D} original
21
+ * @param {string} mode
22
+ * @param {Record<string, number>} values
23
+ * @param {{animate?: boolean,
24
+ * geometry?: (source: THREE.BufferGeometry) => THREE.BufferGeometry,
25
+ * material?: (source: THREE.Material, impostor: boolean, width: number, blend: 'white') => MeshBasicNodeMaterial}=} options
26
+ */
27
+ export function createWrapPreview(asset: THREE.Object3D, original: THREE.Object3D, mode: string, values: Record<string, number>, options?: {
28
+ animate?: boolean;
29
+ geometry?: (source: THREE.BufferGeometry) => THREE.BufferGeometry;
30
+ material?: (source: THREE.Material, impostor: boolean, width: number, blend: "white") => MeshBasicNodeMaterial;
31
+ } | undefined): {
32
+ group: THREE.Group<THREE.Object3DEventMap>;
33
+ syncAnimation(): void;
34
+ /** @param {Record<string, number>} next */
35
+ update(next: Record<string, number>): boolean;
36
+ dispose(): void;
37
+ };
38
+ import * as THREE from 'three';
39
+ import { MeshBasicNodeMaterial } from 'three/webgpu';
@@ -0,0 +1 @@
1
+ export * from '../../../src/rendering/wrap-preview.js';
@@ -0,0 +1,14 @@
1
+ /** @param {THREE.Object3D} root */
2
+ export function captureWrapSkinPose(root: THREE.Object3D): void;
3
+ /** Project preview surfaces to a source rig in the wrap's local frame.
4
+ * The rig is borrowed from the cloned original, never from the source viewer.
5
+ * @param {THREE.Object3D} original @param {THREE.Object3D} copy @param {THREE.Object3D} asset
6
+ * @param {boolean} [animate]
7
+ */
8
+ export function createWrapSkin(original: THREE.Object3D, copy: THREE.Object3D, asset: THREE.Object3D, animate?: boolean): {
9
+ /** @param {THREE.BufferGeometry} geometry @param {THREE.Material | THREE.Material[]} material */
10
+ mesh(geometry: THREE.BufferGeometry, material: THREE.Material | THREE.Material[]): THREE.SkinnedMesh<THREE.BufferGeometry<THREE.NormalBufferAttributes, THREE.BufferGeometryEventMap>, THREE.Material<THREE.MaterialEventMap> | THREE.Material<THREE.MaterialEventMap>[], THREE.Object3DEventMap>;
11
+ update(): void;
12
+ dispose(): void;
13
+ } | null;
14
+ import * as THREE from 'three';
@@ -0,0 +1 @@
1
+ export * from '../../../src/rendering/wrap-skin.js';