@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.
- package/LICENSE +21 -0
- package/README.md +93 -2
- package/build/deformation-runtime.js +2143 -0
- package/build/deformation-runtime.js.map +7 -0
- package/build/impostor-runtime-needle-engine.js +42 -0
- package/build/impostor-runtime-needle-engine.js.map +7 -0
- package/build/impostor-runtime.js +1333 -0
- package/build/impostor-runtime.js.map +7 -0
- package/build/internal/deformation/cloth-surface.js +288 -0
- package/build/internal/deformation/cloth-surface.js.map +7 -0
- package/build/internal/deformation/fur-surface.js +130 -0
- package/build/internal/deformation/fur-surface.js.map +7 -0
- package/build/internal/deformation/ik-constraints.js +44 -0
- package/build/internal/deformation/ik-constraints.js.map +7 -0
- package/build/internal/deformation/joints-json.js +197 -0
- package/build/internal/deformation/joints-json.js.map +7 -0
- package/build/internal/deformation/limits.js +16 -0
- package/build/internal/deformation/limits.js.map +7 -0
- package/build/internal/deformation/motion-settings.js +12 -0
- package/build/internal/deformation/motion-settings.js.map +7 -0
- package/build/internal/deformation/pin-cloth.js +196 -0
- package/build/internal/deformation/pin-cloth.js.map +7 -0
- package/build/internal/deformation/pin-ik.js +650 -0
- package/build/internal/deformation/pin-ik.js.map +7 -0
- package/build/internal/deformation/pin-types.js +12 -0
- package/build/internal/deformation/pin-types.js.map +7 -0
- package/build/internal/deformation/pin-wiggle.js +249 -0
- package/build/internal/deformation/pin-wiggle.js.map +7 -0
- package/build/internal/deformation/pose-slots.js +84 -0
- package/build/internal/deformation/pose-slots.js.map +7 -0
- package/build/internal/deformation/pose-timeline.js +210 -0
- package/build/internal/deformation/pose-timeline.js.map +7 -0
- package/build/internal/deformation/rig-drivers.js +48 -0
- package/build/internal/deformation/rig-drivers.js.map +7 -0
- package/build/internal/deformation/rig-extension.js +334 -0
- package/build/internal/deformation/rig-extension.js.map +7 -0
- package/build/internal/deformation/rig-runtime.js +2141 -0
- package/build/internal/deformation/rig-runtime.js.map +7 -0
- package/build/internal/deformation/wind.js +34 -0
- package/build/internal/deformation/wind.js.map +7 -0
- package/build/internal/impostor/impostor-metadata.js +77 -0
- package/build/internal/impostor/impostor-metadata.js.map +7 -0
- package/build/internal/impostor/impostor-node-material.js +1331 -0
- package/build/internal/impostor/impostor-node-material.js.map +7 -0
- package/build/internal/impostor/impostor-runtime-support.js +162 -0
- package/build/internal/impostor/impostor-runtime-support.js.map +7 -0
- package/build/internal/impostor/octahedral.js +232 -0
- package/build/internal/impostor/octahedral.js.map +7 -0
- package/build/internal/pixel-impostor/pixel-impostor-display.js +728 -0
- package/build/internal/pixel-impostor/pixel-impostor-display.js.map +7 -0
- package/build/internal/pixel-impostor/pixel-impostor-metadata.js +71 -0
- package/build/internal/pixel-impostor/pixel-impostor-metadata.js.map +7 -0
- package/build/internal/pixel-impostor/pixel-impostor-runtime.js +150 -0
- package/build/internal/pixel-impostor/pixel-impostor-runtime.js.map +7 -0
- package/build/internal/rendering/skin-projection.js +4630 -0
- package/build/internal/rendering/skin-projection.js.map +7 -0
- package/build/internal/rendering/surface-query.js +4519 -0
- package/build/internal/rendering/surface-query.js.map +7 -0
- package/build/internal/rendering/wireframe.js +112 -0
- package/build/internal/rendering/wireframe.js.map +7 -0
- package/build/internal/rendering/wrap-preview-settings.js +126 -0
- package/build/internal/rendering/wrap-preview-settings.js.map +7 -0
- package/build/internal/rendering/wrap-preview.js +5610 -0
- package/build/internal/rendering/wrap-preview.js.map +7 -0
- package/build/internal/rendering/wrap-skin.js +4746 -0
- package/build/internal/rendering/wrap-skin.js.map +7 -0
- package/build/pixel-impostor-runtime.js +876 -0
- package/build/pixel-impostor-runtime.js.map +7 -0
- package/build/types/deformation/cloth-surface.d.ts +39 -0
- package/build/types/deformation/cloth-surface.js +1 -0
- package/build/types/deformation/fur-surface.d.ts +27 -0
- package/build/types/deformation/fur-surface.js +1 -0
- package/build/types/deformation/ik-constraints.d.ts +18 -0
- package/build/types/deformation/ik-constraints.js +1 -0
- package/build/types/deformation/joints-json.d.ts +17 -0
- package/build/types/deformation/joints-json.js +1 -0
- package/build/types/deformation/limits.d.ts +23 -0
- package/build/types/deformation/limits.js +1 -0
- package/build/types/deformation/motion-settings.d.ts +9 -0
- package/build/types/deformation/motion-settings.js +1 -0
- package/build/types/deformation/pin-cloth.d.ts +28 -0
- package/build/types/deformation/pin-cloth.js +1 -0
- package/build/types/deformation/pin-ik.d.ts +37 -0
- package/build/types/deformation/pin-ik.js +1 -0
- package/build/types/deformation/pin-types.d.ts +53 -0
- package/build/types/deformation/pin-types.js +1 -0
- package/build/types/deformation/pin-wiggle.d.ts +16 -0
- package/build/types/deformation/pin-wiggle.js +1 -0
- package/build/types/deformation/pose-slots.d.ts +41 -0
- package/build/types/deformation/pose-slots.js +1 -0
- package/build/types/deformation/pose-timeline.d.ts +65 -0
- package/build/types/deformation/pose-timeline.js +1 -0
- package/build/types/deformation/rig-drivers.d.ts +19 -0
- package/build/types/deformation/rig-drivers.js +1 -0
- package/build/types/deformation/rig-extension.d.ts +33 -0
- package/build/types/deformation/rig-extension.js +1 -0
- package/build/types/deformation/rig-runtime.d.ts +95 -0
- package/build/types/deformation/rig-runtime.js +1 -0
- package/build/types/deformation/wind.d.ts +16 -0
- package/build/types/deformation/wind.js +1 -0
- package/build/types/impostor/impostor-metadata.d.ts +61 -0
- package/build/types/impostor/impostor-metadata.js +1 -0
- package/build/types/impostor/impostor-node-material.d.ts +140 -0
- package/build/types/impostor/impostor-node-material.js +1 -0
- package/build/types/impostor/impostor-runtime-support.d.ts +52 -0
- package/build/types/impostor/impostor-runtime-support.js +1 -0
- package/build/types/impostor/octahedral.d.ts +84 -0
- package/build/types/impostor/octahedral.js +1 -0
- package/build/types/pixel-impostor/pixel-impostor-display.d.ts +48 -0
- package/build/types/pixel-impostor/pixel-impostor-display.js +1 -0
- package/build/types/pixel-impostor/pixel-impostor-metadata.d.ts +34 -0
- package/build/types/pixel-impostor/pixel-impostor-metadata.js +1 -0
- package/build/types/pixel-impostor/pixel-impostor-runtime.d.ts +18 -0
- package/build/types/pixel-impostor/pixel-impostor-runtime.js +1 -0
- package/build/types/public/deformation-runtime.d.ts +3 -0
- package/build/types/public/deformation-runtime.js +1 -0
- package/build/types/public/impostor-runtime-needle-engine.d.ts +31 -0
- package/build/types/public/impostor-runtime-needle-engine.js +1 -0
- package/build/types/public/impostor-runtime.d.ts +6 -0
- package/build/types/public/impostor-runtime.js +1 -0
- package/build/types/public/pixel-impostor-runtime.d.ts +3 -0
- package/build/types/public/pixel-impostor-runtime.js +1 -0
- package/build/types/public/wrap-effects.d.ts +4 -0
- package/build/types/public/wrap-effects.js +1 -0
- package/build/types/rendering/skin-projection.d.ts +44 -0
- package/build/types/rendering/skin-projection.js +1 -0
- package/build/types/rendering/surface-query.d.ts +66 -0
- package/build/types/rendering/surface-query.js +1 -0
- package/build/types/rendering/wireframe.d.ts +25 -0
- package/build/types/rendering/wireframe.js +1 -0
- package/build/types/rendering/wrap-preview-settings.d.ts +22 -0
- package/build/types/rendering/wrap-preview-settings.js +1 -0
- package/build/types/rendering/wrap-preview.d.ts +39 -0
- package/build/types/rendering/wrap-preview.js +1 -0
- package/build/types/rendering/wrap-skin.d.ts +14 -0
- package/build/types/rendering/wrap-skin.js +1 -0
- package/build/wrap-effects.js +5640 -0
- package/build/wrap-effects.js.map +7 -0
- package/package.json +105 -4
- package/src/deformation/cloth-surface.ts +223 -0
- package/src/deformation/fur-surface.ts +129 -0
- package/src/deformation/ik-constraints.ts +37 -0
- package/src/deformation/joints-json.ts +94 -0
- package/src/deformation/limits.ts +25 -0
- package/src/deformation/motion-settings.ts +9 -0
- package/src/deformation/pin-cloth.ts +149 -0
- package/src/deformation/pin-ik.ts +582 -0
- package/src/deformation/pin-types.ts +22 -0
- package/src/deformation/pin-wiggle.ts +119 -0
- package/src/deformation/pose-slots.ts +106 -0
- package/src/deformation/pose-timeline.ts +242 -0
- package/src/deformation/rig-drivers.ts +32 -0
- package/src/deformation/rig-extension.ts +87 -0
- package/src/deformation/rig-runtime.ts +416 -0
- package/src/deformation/wind.ts +36 -0
- package/src/impostor/impostor-metadata.js +137 -0
- package/src/impostor/impostor-node-material.js +1581 -0
- package/src/impostor/impostor-runtime-support.js +139 -0
- package/src/impostor/octahedral.js +280 -0
- package/src/pixel-impostor/pixel-impostor-display.js +794 -0
- package/src/pixel-impostor/pixel-impostor-metadata.js +74 -0
- package/src/pixel-impostor/pixel-impostor-runtime.js +78 -0
- package/src/public/deformation-runtime.ts +3 -0
- package/src/public/impostor-runtime-needle-engine.js +56 -0
- package/src/public/impostor-runtime.js +21 -0
- package/src/public/pixel-impostor-runtime.js +5 -0
- package/src/public/wrap-effects.js +21 -0
- package/src/rendering/skin-projection.js +113 -0
- package/src/rendering/surface-query.js +88 -0
- package/src/rendering/wireframe.js +115 -0
- package/src/rendering/wrap-preview-settings.js +123 -0
- package/src/rendering/wrap-preview.js +645 -0
- package/src/rendering/wrap-skin.js +109 -0
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
// Lightweight UI contract; importing controls must not import shader graphs.
|
|
2
|
+
export const WRAP_PREVIEW_MODES = ['ice', 'force-field', 'tech-cage', 'flames', 'aura', 'outline', 'godrays', 'wind-frosted', 'shroud', 'lava', 'ivy', 'heat-haze'];
|
|
3
|
+
/** @type {Record<string, {key: string, label: string, min: number, max: number, step: number, value: number, title: string, kind?: string}[]>} */
|
|
4
|
+
export const WRAP_PREVIEW_CONTROLS = {
|
|
5
|
+
'heat-haze': [
|
|
6
|
+
{ key: 'strength', label: 'Distortion', min: 0, max: 1, step: 0.01, value: 0.35, title: 'Strength of the bubbling refractive normals.' },
|
|
7
|
+
{ key: 'detail', label: 'Detail', min: 1, max: 16, step: 0.25, value: 5, title: 'Spatial scale of the smooth heat bubbles.' },
|
|
8
|
+
{ key: 'speed', label: 'Speed', min: 0, max: 4, step: 0.05, value: 1, title: 'Upward motion and evolution of the heat distortion.' },
|
|
9
|
+
{ key: 'thickness', label: 'Thickness', min: 0.01, max: 1, step: 0.01, value: 0.15, title: 'Optical thickness of the transmissive hull.' },
|
|
10
|
+
],
|
|
11
|
+
shroud: [
|
|
12
|
+
{ key: 'color', kind: 'color', label: 'Color', min: 0, max: 16777215, step: 1, value: 0x100d18, title: 'Deep shadow cloud color.' },
|
|
13
|
+
{ key: 'coverage', label: 'Coverage', min: 0, max: 1, step: 0.01, value: 0.33, title: 'Fraction of the surface hidden in swirling clouds.' },
|
|
14
|
+
{ key: 'detail', label: 'Detail', min: 1, max: 12, step: 0.25, value: 5.5, title: 'Cloud and eddy scale.' },
|
|
15
|
+
{ key: 'depth', label: 'Cloud depth', min: 0, max: 0.1, step: 0.001, value: 0.016, title: 'Surface-hugging cloud thickness relative to model size.' },
|
|
16
|
+
{ key: 'amplitude', label: 'Vertex curl', min: 0, max: 0.08, step: 0.001, value: 0.063, title: 'Full 3D curl displacement of the cloud vertices. Zero removes the vertex curl calculations from the shader.' },
|
|
17
|
+
{ key: 'fresnel', label: 'Edge fade', min: 0, max: 8, step: 0.05, value: 1.5, title: 'Fade clouds to transparent at grazing angles. Higher values soften more of the silhouette; zero disables the fade.' },
|
|
18
|
+
{ key: 'speed', label: 'Swirl speed', min: 0, max: 4, step: 0.05, value: 2.25, title: 'Cloud circulation speed; no upward flame motion.' },
|
|
19
|
+
{ key: 'opacity', label: 'Opacity', min: 0, max: 1, step: 0.01, value: 0.99, title: 'Maximum shadow opacity per layer.' },
|
|
20
|
+
],
|
|
21
|
+
lava: [
|
|
22
|
+
{ key: 'noise', label: 'Growth noise', min: 0, max: 1, step: 0.01, value: 0.6, title: '3D noise variation in the advancing front. Zero removes the growth-noise graph.' },
|
|
23
|
+
{ key: 'transition', label: 'Transition zone', min: 0.05, max: 0.4, step: 0.01, value: 0.2, title: 'Width of the zone where volcanic plates form and expand.' },
|
|
24
|
+
{ key: 'color', kind: 'color', label: 'Lava color', min: 0, max: 16777215, step: 1, value: 0xff3705, title: 'Molten crack color, graduating to yellow-white in the hottest cores.' },
|
|
25
|
+
{ key: 'fill', label: 'Fill from bottom', min: 0, max: 1, step: 0.01, value: 0.65, title: 'Fill height from the base to the top of the rest-pose hull. Zero hides all lava; one covers all of it.' },
|
|
26
|
+
{ key: 'detail', label: 'Detail', min: 2, max: 24, step: 0.5, value: 12, title: 'Scale of the irregular volcanic plates.' },
|
|
27
|
+
{ key: 'cracks', label: 'Crack width', min: 0.01, max: 0.3, step: 0.005, value: 0.065, title: 'Width of the molten seams between crust plates.' },
|
|
28
|
+
{ key: 'glow', label: 'Heat', min: 0, max: 8, step: 0.1, value: 3, title: 'Emission of the molten cracks.' },
|
|
29
|
+
{ key: 'speed', label: 'Flow speed', min: 0, max: 3, step: 0.05, value: 0.5, title: 'Slow molten heat flow beneath stationary crust.' },
|
|
30
|
+
],
|
|
31
|
+
ivy: [
|
|
32
|
+
{ key: 'noise', label: 'Growth noise', min: 0, max: 1, step: 0.01, value: 0.6, title: '3D variation in vine and leaf growth timing. Zero removes the growth-noise graph.' },
|
|
33
|
+
{ key: 'transition', label: 'Transition zone', min: 0.05, max: 0.4, step: 0.01, value: 0.2, title: 'Width of the zone where twigs extend and leaves unfurl from their roots.' },
|
|
34
|
+
{ key: 'color', kind: 'color', label: 'Leaf color', min: 0, max: 16777215, step: 1, value: 0x397b24, title: 'Leaf green, with lighter veins and younger tips.' },
|
|
35
|
+
{ key: 'growth', label: 'Growth', min: 0, max: 1, step: 0.01, value: 1, title: 'Reveal climbing stems and leaves from the bottom upward.' },
|
|
36
|
+
{ key: 'detail', label: 'Detail', min: 2, max: 24, step: 0.25, value: 10, title: 'Scale of the procedural vines and leaves on the hull.' },
|
|
37
|
+
{ key: 'leafSize', label: 'Leaf size', min: 0.2, max: 1, step: 0.01, value: 0.7, title: 'Lobed leaf size relative to the vine spacing.' },
|
|
38
|
+
{ key: 'speed', label: 'Breeze speed', min: 0, max: 3, step: 0.05, value: 0.6, title: 'Gentle leaf movement; stems stay attached to the hull.' },
|
|
39
|
+
],
|
|
40
|
+
ice: [
|
|
41
|
+
{ key: 'dispersion', label: 'Dispersion', min: 0, max: 2, step: 0.01, value: 0.25, title: 'Spectral refraction through the ice. Zero removes dispersion from the shader.' },
|
|
42
|
+
{ key: 'frost', label: 'Frost', min: 0, max: 1, step: 0.01, value: 0.55, title: 'Cloudiness of the physical ice.' },
|
|
43
|
+
{ key: 'facets', label: 'Facets', min: 0, max: 1, step: 0.01, value: 0.5, title: 'Blend rounded normals into cut-crystal facets.' },
|
|
44
|
+
{ key: 'thickness', label: 'Thickness', min: 0.02, max: 1, step: 0.01, value: 0.35, title: 'Optical thickness relative to model size.' },
|
|
45
|
+
],
|
|
46
|
+
'force-field': [
|
|
47
|
+
{ key: 'color', kind: 'color', label: 'Color', min: 0, max: 16777215, step: 1, value: 0x2bd4ef, title: 'Energy color of both hex field layers.' },
|
|
48
|
+
{ key: 'density', label: 'Hex density', min: 4, max: 40, step: 1, value: 26, title: 'Scale of the biplanar hex grid on both field layers.' },
|
|
49
|
+
{ key: 'speed', label: 'Speed', min: 0, max: 4, step: 0.05, value: 1.75, title: 'Speed of the per-hex energy pulses and shifting outer patches.' },
|
|
50
|
+
{ key: 'glow', label: 'Glow', min: 0.1, max: 5, step: 0.1, value: 0.4, title: 'Field and Fresnel brightness.' },
|
|
51
|
+
{ key: 'detail', label: 'Detail', min: 1, max: 12, step: 0.25, value: 4, title: 'Spatial detail of curl motion and outer patches, independent of hex density.' },
|
|
52
|
+
{ key: 'noise', label: 'Noise strength', min: 0, max: 2, step: 0.05, value: 1, title: 'Curl displacement and outer-patch noise. Zero removes noise calculations from the shader.' },
|
|
53
|
+
{ key: 'fresnel', label: 'Fresnel', min: 0.25, max: 8, step: 0.05, value: 3, title: 'Concentrate the glow toward grazing edges. Higher values make a tighter rim.' },
|
|
54
|
+
],
|
|
55
|
+
'tech-cage': [
|
|
56
|
+
{ key: 'color', kind: 'color', label: 'Color', min: 0, max: 16777215, step: 1, value: 0x52e6ff, title: 'Color of the cage wires and vertex nodes.' },
|
|
57
|
+
{ key: 'amplitude', label: 'Curl strength', min: 0, max: 0.2, step: 0.005, value: 0.035, title: 'Shared curl displacement of cage vertices and node centers, relative to model size.' },
|
|
58
|
+
{ key: 'speed', label: 'Speed', min: 0, max: 4, step: 0.05, value: 0.7, title: 'Speed of the animated 3D curl field.' },
|
|
59
|
+
{ key: 'nodeSize', label: 'Node size', min: 0.002, max: 0.04, step: 0.001, value: 0.009, title: 'Radius of the instanced smooth icospheres, relative to model size.' },
|
|
60
|
+
{ key: 'width', label: 'Wire width', min: 0.25, max: 4, step: 0.25, value: 1.25, title: 'Antialiased wire width in screen pixels.' },
|
|
61
|
+
],
|
|
62
|
+
flames: [
|
|
63
|
+
{ key: 'color', kind: 'color', label: 'Cool', min: 0, max: 16777215, step: 1, value: 0xff3c00, title: 'Cooling plume tips and weak wisps in the stylized temperature estimate.' },
|
|
64
|
+
{ key: 'warmColor', kind: 'color', label: 'Warm', min: 0, max: 16777215, step: 1, value: 0xffb52a, title: 'Middle of the flame temperature gradient.' },
|
|
65
|
+
{ key: 'hotColor', kind: 'color', label: 'Hot', min: 0, max: 16777215, step: 1, value: 0xfff4d6, title: 'Hot reaction region just beyond the emitting surface; the plume cools toward its tips.' },
|
|
66
|
+
{ key: 'radialUp', label: 'Radial up', min: 0, max: 1, step: 0.01, value: 0, title: '0: vertical world up. 1: outward and upward from the wrap’s bottom-center floor point.' },
|
|
67
|
+
{ key: 'upThreshold', label: 'Upward threshold', min: -1, max: 0.95, step: 0.05, value: 0.05, title: 'Outward geometry-normal alignment with the selected up direction. Lower values include more side faces.' },
|
|
68
|
+
{ key: 'height', label: 'Flame height', min: 0, max: 1, step: 0.01, value: 0.35, title: 'Upward flame displacement relative to model size.' },
|
|
69
|
+
{ key: 'speed', label: 'Speed', min: 0, max: 4, step: 0.05, value: 1.4, title: 'Upward flow speed of the aura.' },
|
|
70
|
+
{ key: 'scale', label: 'Flame detail', min: 1, max: 12, step: 0.25, value: 5, title: 'Spatial frequency of the flame tongues.' },
|
|
71
|
+
],
|
|
72
|
+
aura: [
|
|
73
|
+
{ key: 'color', kind: 'color', label: 'Color', min: 0, max: 16777215, step: 1, value: 0xffd52a, title: 'Aura color.' },
|
|
74
|
+
{ key: 'radialUp', label: 'Radial up', min: 0, max: 1, step: 0.01, value: 0.68, title: 'Blend vertical up into outward rays from the bottom-center floor point.' },
|
|
75
|
+
{ key: 'upThreshold', label: 'Upward threshold', min: -1, max: 0.95, step: 0.05, value: -0.2, title: 'Outward geometry-normal alignment required to emit spikes.' },
|
|
76
|
+
{ key: 'height', label: 'Spike height', min: 0, max: 1, step: 0.01, value: 0.39, title: 'Length of the pointed aura tongues relative to model size.' },
|
|
77
|
+
{ key: 'speed', label: 'Speed', min: 0, max: 4, step: 0.05, value: 2.85, title: 'General spike pulsing and shape variation, independent of inward travel and bending.' },
|
|
78
|
+
{ key: 'wanderSpeed', label: 'Inward travel speed', min: -4, max: 4, step: 0.05, value: 2.45, title: 'Polar spike travel speed. Negative reverses toward the base; zero stops travel without stopping the other animation.' },
|
|
79
|
+
{ key: 'bendStrength', label: 'Bend strength', min: 0, max: 0.5, step: 0.01, value: 0.1, title: 'Strength of the separate travelling shell bend. Zero disables the bend.' },
|
|
80
|
+
{ key: 'bendSpeed', label: 'Bend speed', min: 0, max: 4, step: 0.05, value: 4, title: 'Speed of the shell bend, independent of spike travel.' },
|
|
81
|
+
{ key: 'scale', label: 'Detail', min: 1, max: 12, step: 0.25, value: 6.75, title: 'Spatial frequency of the pointed energy tongues.' },
|
|
82
|
+
{ key: 'fresnel', label: 'Fresnel', min: 0.25, max: 12, step: 0.05, value: 5, title: 'Concentrate flat golden energy around the silhouette.' },
|
|
83
|
+
{ key: 'opacity', label: 'Opacity', min: 0, max: 1, step: 0.01, value: 0.17, title: 'Opacity of the flat-color aura shell.' },
|
|
84
|
+
],
|
|
85
|
+
outline: [
|
|
86
|
+
{ key: 'color', kind: 'color', label: 'Color', min: 0, max: 16777215, step: 1, value: 0xffffff, title: 'Solid inner outline color.' },
|
|
87
|
+
{ key: 'expand', label: 'Normal expand', min: 0, max: 0.2, step: 0.001, value: 0.01, title: 'Inner shell expansion along smooth normals, relative to model size.' },
|
|
88
|
+
{ key: 'borderColor', kind: 'color', label: 'Border color', min: 0, max: 16777215, step: 1, value: 0x000000, title: 'Solid outer outline color.' },
|
|
89
|
+
{ key: 'borderOffset', label: 'Border offset', min: 0, max: 0.1, step: 0.001, value: 0.005, title: 'Additional normal expansion beyond the inner shell.' },
|
|
90
|
+
],
|
|
91
|
+
godrays: [
|
|
92
|
+
{ key: 'azimuth', kind: 'direction', label: 'Direction', min: -180, max: 180, step: 1, value: 25, title: 'Drag to rotate the ray direction. Arrow keys rotate; Home resets.' },
|
|
93
|
+
{ key: 'elevation', kind: 'hidden', label: 'Elevation', min: -89, max: 89, step: 1, value: 55, title: '' },
|
|
94
|
+
{ key: 'angle', label: 'Angle', min: 1, max: 80, step: 1, value: 25, title: 'Angular spread of the directional rays.' },
|
|
95
|
+
{ key: 'length', label: 'Length', min: 0, max: 2, step: 0.01, value: 0.6, title: 'Ray length relative to the wrap size.' },
|
|
96
|
+
{ key: 'opacity', label: 'Strength', min: 0, max: 1, step: 0.01, value: 0.65, title: 'Multiplicative darkening of the rays.' },
|
|
97
|
+
{ key: 'fresnel', label: 'Edge softness', min: 0.25, max: 5, step: 0.05, value: 1.5, title: 'Fade grazing edges smoothly.' },
|
|
98
|
+
],
|
|
99
|
+
'wind-frosted': [
|
|
100
|
+
{ key: 'azimuth', kind: 'direction', label: 'Direction', min: -180, max: 180, step: 1, value: 25, title: 'Direction the freezing wind travels. Icicles point away with the wind.' },
|
|
101
|
+
{ key: 'elevation', kind: 'hidden', label: 'Elevation', min: -89, max: 89, step: 1, value: -25, title: '' },
|
|
102
|
+
{ key: 'coverage', label: 'Coverage', min: 0, max: 1, step: 0.01, value: 0.55, title: 'Amount of directional snow and frost coverage.' },
|
|
103
|
+
{ key: 'normalOffset', label: 'Windward offset', min: 0, max: 0.2, step: 0.001, value: 0, title: 'Push the wind-facing coating outward along its normals, relative to model size.' },
|
|
104
|
+
{ key: 'height', label: 'Icicle length', min: 0, max: 0.5, step: 0.01, value: 0.12, title: 'Length of sharp downwind icicles relative to model size.' },
|
|
105
|
+
{ key: 'scale', label: 'Detail', min: 1, max: 12, step: 0.25, value: 5, title: 'Detail of frost patches and pointed icicles.' },
|
|
106
|
+
],
|
|
107
|
+
};
|
|
108
|
+
export function createWrapPreviewValues() {
|
|
109
|
+
return Object.fromEntries(Object.entries(WRAP_PREVIEW_CONTROLS).map(([mode, controls]) => [mode,
|
|
110
|
+
Object.fromEntries(controls.map(control => [control.key, control.value])),
|
|
111
|
+
]));
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
/** Includes older reports whose wrap stages live inside material groups.
|
|
115
|
+
* @param {unknown} topology
|
|
116
|
+
* @returns {boolean}
|
|
117
|
+
*/
|
|
118
|
+
export function isWrapTopology(topology) {
|
|
119
|
+
if (!topology || typeof topology !== 'object') return false;
|
|
120
|
+
if ('mode' in topology && topology.mode === 'hull') return true;
|
|
121
|
+
return 'groups' in topology && Array.isArray(topology.groups)
|
|
122
|
+
&& topology.groups.some(group => group && typeof group === 'object' && 'report' in group && isWrapTopology(group.report));
|
|
123
|
+
}
|