@oeave/bakery3 0.0.0-stage → 0.1.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 +562 -2
- package/dist/animation-B1h0Ryvj.d.ts +97 -0
- package/dist/bake/index.d.ts +369 -0
- package/dist/bake/index.js +9 -0
- package/dist/bake/index.js.map +1 -0
- package/dist/bake-DaOlenyx.d.ts +1357 -0
- package/dist/catalog/index.d.ts +100 -0
- package/dist/catalog/index.js +154 -0
- package/dist/catalog/index.js.map +1 -0
- package/dist/catalog.gen-BM-aNf7n.d.ts +733 -0
- package/dist/chunk-25ZXSVQ3.js +1107 -0
- package/dist/chunk-25ZXSVQ3.js.map +1 -0
- package/dist/chunk-3G5QL4F4.js +145 -0
- package/dist/chunk-3G5QL4F4.js.map +1 -0
- package/dist/chunk-4E5VV4QY.js +12 -0
- package/dist/chunk-4E5VV4QY.js.map +1 -0
- package/dist/chunk-54WJDN5R.js +3286 -0
- package/dist/chunk-54WJDN5R.js.map +1 -0
- package/dist/chunk-6NYR73Y7.js +832 -0
- package/dist/chunk-6NYR73Y7.js.map +1 -0
- package/dist/chunk-6YVQANMW.js +1463 -0
- package/dist/chunk-6YVQANMW.js.map +1 -0
- package/dist/chunk-AF5BIELI.js +70 -0
- package/dist/chunk-AF5BIELI.js.map +1 -0
- package/dist/chunk-APBOWWSV.js +92 -0
- package/dist/chunk-APBOWWSV.js.map +1 -0
- package/dist/chunk-ARMTTZXZ.js +1157 -0
- package/dist/chunk-ARMTTZXZ.js.map +1 -0
- package/dist/chunk-CX4WTVGH.js +4492 -0
- package/dist/chunk-CX4WTVGH.js.map +1 -0
- package/dist/chunk-HQTUFVMM.js +1412 -0
- package/dist/chunk-HQTUFVMM.js.map +1 -0
- package/dist/chunk-MD2U6S4N.js +1952 -0
- package/dist/chunk-MD2U6S4N.js.map +1 -0
- package/dist/chunk-S4AJTLLN.js +23 -0
- package/dist/chunk-S4AJTLLN.js.map +1 -0
- package/dist/chunk-TGFNQBKC.js +551 -0
- package/dist/chunk-TGFNQBKC.js.map +1 -0
- package/dist/chunk-V3QINEEG.js +87 -0
- package/dist/chunk-V3QINEEG.js.map +1 -0
- package/dist/chunk-W6WQ5UP7.js +91 -0
- package/dist/chunk-W6WQ5UP7.js.map +1 -0
- package/dist/chunk-WBIAFIHV.js +346 -0
- package/dist/chunk-WBIAFIHV.js.map +1 -0
- package/dist/chunk-ZEBVAIJJ.js +156 -0
- package/dist/chunk-ZEBVAIJJ.js.map +1 -0
- package/dist/devtools/index.d.ts +536 -0
- package/dist/devtools/index.js +15 -0
- package/dist/devtools/index.js.map +1 -0
- package/dist/environments/index.d.ts +93 -0
- package/dist/environments/index.js +382 -0
- package/dist/environments/index.js.map +1 -0
- package/dist/hotspots/index.d.ts +111 -0
- package/dist/hotspots/index.js +285 -0
- package/dist/hotspots/index.js.map +1 -0
- package/dist/index.d.ts +944 -0
- package/dist/index.js +15 -0
- package/dist/index.js.map +1 -0
- package/dist/node/index.cjs +5115 -0
- package/dist/node/index.cjs.map +1 -0
- package/dist/node/index.d.cts +4862 -0
- package/dist/node/index.d.ts +576 -0
- package/dist/node/index.js +1279 -0
- package/dist/node/index.js.map +1 -0
- package/dist/prepare-C5qVvaw4.d.ts +112 -0
- package/dist/presets/index.d.ts +526 -0
- package/dist/presets/index.js +14 -0
- package/dist/presets/index.js.map +1 -0
- package/dist/r3f/index.d.ts +159 -0
- package/dist/r3f/index.js +592 -0
- package/dist/r3f/index.js.map +1 -0
- package/dist/room-S5TLCK4F.js +9 -0
- package/dist/room-S5TLCK4F.js.map +1 -0
- package/dist/rooms.gen-vhj6sFW5.d.ts +1434 -0
- package/dist/session-YCQS4MRH.js +9 -0
- package/dist/session-YCQS4MRH.js.map +1 -0
- package/dist/shapes/index.d.ts +222 -0
- package/dist/shapes/index.js +836 -0
- package/dist/shapes/index.js.map +1 -0
- package/dist/testRun-BIPXaVPb.d.ts +1130 -0
- package/dist/timeline-ChwgD7bT.d.ts +470 -0
- package/dist/tsl/index.d.ts +165 -0
- package/dist/tsl/index.js +310 -0
- package/dist/tsl/index.js.map +1 -0
- package/package.json +170 -4
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export { LIVE, createBakeSession } from './chunk-TGFNQBKC.js';
|
|
2
|
+
import './chunk-HQTUFVMM.js';
|
|
3
|
+
import './chunk-4E5VV4QY.js';
|
|
4
|
+
import './chunk-W6WQ5UP7.js';
|
|
5
|
+
import './chunk-6NYR73Y7.js';
|
|
6
|
+
import './chunk-MD2U6S4N.js';
|
|
7
|
+
import './chunk-3G5QL4F4.js';
|
|
8
|
+
//# sourceMappingURL=session-YCQS4MRH.js.map
|
|
9
|
+
//# sourceMappingURL=session-YCQS4MRH.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"session-YCQS4MRH.js"}
|
|
@@ -0,0 +1,222 @@
|
|
|
1
|
+
import * as THREE from 'three';
|
|
2
|
+
import { WebGPURenderer } from 'three/webgpu';
|
|
3
|
+
import { T as Timeline } from '../timeline-ChwgD7bT.js';
|
|
4
|
+
import '../animation-B1h0Ryvj.js';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* The implementation behind `@oeave/bakery3/shapes`. `index.ts` lists what
|
|
8
|
+
* is public; the rest is shared with the SDK's own tests and tools.
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
type Vec3 = [number, number, number];
|
|
12
|
+
declare const SHAPE_KINDS: readonly ["sphere", "blob", "pebble", "torus", "ring", "knot", "capsule", "box"];
|
|
13
|
+
type ShapeKind = (typeof SHAPE_KINDS)[number];
|
|
14
|
+
/**
|
|
15
|
+
* `glow` emits its color (a real light in the render); `glass` refracts what
|
|
16
|
+
* is behind it; `matte`, `satin` and `metal` are lit surfaces; `rim` is a
|
|
17
|
+
* fresnel emission written in TSL (bright at the silhouette, dark in the
|
|
18
|
+
* middle); `nebula` is emission driven by fractal noise in TSL; `beacon` is a
|
|
19
|
+
* dark body that emits at a handful of fixed points, in TSL.
|
|
20
|
+
*
|
|
21
|
+
* The rest are TSL graphs too. `iris` is a metal whose color turns through
|
|
22
|
+
* the spectrum with the angle it is seen from, like oil on water. `scan` is a
|
|
23
|
+
* dark body crossed by bands of light that are fixed in the WORLD, so a shape
|
|
24
|
+
* that bobs, tumbles or orbits moves through them. `magma` is dark plates
|
|
25
|
+
* with glowing seams (cellular noise). `holo` is a globe's grid of glowing
|
|
26
|
+
* meridians and parallels. `aurora` is soft emission in two colors, folded
|
|
27
|
+
* by sines. `topo` is glowing contour lines at even heights of the shape, so
|
|
28
|
+
* on a blob they map its lumps. `spiral` is a lit surface in two-tone
|
|
29
|
+
* stripes that wind round the shape.
|
|
30
|
+
*/
|
|
31
|
+
declare const SHAPE_FINISHES: readonly ["glow", "glass", "matte", "satin", "metal", "rim", "nebula", "beacon", "iris", "scan", "magma", "holo", "aurora", "topo", "spiral"];
|
|
32
|
+
type ShapeFinish = (typeof SHAPE_FINISHES)[number];
|
|
33
|
+
declare const MOTION_KINDS: readonly ["spin", "tumble", "pulse", "bob", "orbit", "drift", "glow", "tint", "frost"];
|
|
34
|
+
type MotionKind = (typeof MOTION_KINDS)[number];
|
|
35
|
+
/**
|
|
36
|
+
* A motion runs for the whole clip. The cyclic ones (`spin`, `tumble`,
|
|
37
|
+
* `pulse`, `bob`, `orbit`, `glow`) complete whole turns or cycles so the
|
|
38
|
+
* clip loops; the one-way ones (`drift`, `tint`, `frost`) ease from the
|
|
39
|
+
* shape's own value to the one given.
|
|
40
|
+
*/
|
|
41
|
+
type Motion =
|
|
42
|
+
/** Whole turns about one axis. Default y, one turn. */
|
|
43
|
+
{
|
|
44
|
+
kind: 'spin';
|
|
45
|
+
axis?: 'x' | 'y' | 'z';
|
|
46
|
+
turns?: number;
|
|
47
|
+
}
|
|
48
|
+
/** Whole turns about x and z at once. Default one turn. */
|
|
49
|
+
| {
|
|
50
|
+
kind: 'tumble';
|
|
51
|
+
turns?: number;
|
|
52
|
+
}
|
|
53
|
+
/** Scale breathing by ±amount (fraction of size). Default 0.12, two cycles. */
|
|
54
|
+
| {
|
|
55
|
+
kind: 'pulse';
|
|
56
|
+
amount?: number;
|
|
57
|
+
cycles?: number;
|
|
58
|
+
}
|
|
59
|
+
/** Vertical drift by ±amount meters. Default 0.12, one cycle. */
|
|
60
|
+
| {
|
|
61
|
+
kind: 'bob';
|
|
62
|
+
amount?: number;
|
|
63
|
+
cycles?: number;
|
|
64
|
+
}
|
|
65
|
+
/** Circle the composition's center at the shape's own distance (or `radius`). Default one turn. */
|
|
66
|
+
| {
|
|
67
|
+
kind: 'orbit';
|
|
68
|
+
radius?: number;
|
|
69
|
+
turns?: number;
|
|
70
|
+
}
|
|
71
|
+
/** Ease to another point, meters. */
|
|
72
|
+
| {
|
|
73
|
+
kind: 'drift';
|
|
74
|
+
to: Vec3;
|
|
75
|
+
}
|
|
76
|
+
/** Emission breathing by ±amount (fraction of strength); glow shapes only. Default 0.6, two cycles. */
|
|
77
|
+
| {
|
|
78
|
+
kind: 'glow';
|
|
79
|
+
amount?: number;
|
|
80
|
+
cycles?: number;
|
|
81
|
+
}
|
|
82
|
+
/** Ease the color to another hex. */
|
|
83
|
+
| {
|
|
84
|
+
kind: 'tint';
|
|
85
|
+
to: string;
|
|
86
|
+
}
|
|
87
|
+
/** Ease the roughness to `to` (default 0.6): glass frosts over, metal dulls. */
|
|
88
|
+
| {
|
|
89
|
+
kind: 'frost';
|
|
90
|
+
to?: number;
|
|
91
|
+
};
|
|
92
|
+
type Shape = {
|
|
93
|
+
id: string;
|
|
94
|
+
kind: ShapeKind;
|
|
95
|
+
finish: ShapeFinish;
|
|
96
|
+
/** CSS hex. The emission color of a glow, the tint of a glass, the albedo of the rest. */
|
|
97
|
+
color: string;
|
|
98
|
+
/** Center, meters; y up from the floor (y = 0). */
|
|
99
|
+
position: Vec3;
|
|
100
|
+
/** Longest extent, meters. */
|
|
101
|
+
size: number;
|
|
102
|
+
/** Degrees. */
|
|
103
|
+
rotation?: Vec3;
|
|
104
|
+
/** 0–1: how far the surface is pushed by noise. Blobs and pebbles have their own default; the rest none. */
|
|
105
|
+
noise?: number;
|
|
106
|
+
/** Emission strength for the finishes that emit. Default per finish. */
|
|
107
|
+
strength?: number;
|
|
108
|
+
motion?: Motion[];
|
|
109
|
+
};
|
|
110
|
+
type Composition = {
|
|
111
|
+
kind: 'composition';
|
|
112
|
+
shapes: Shape[];
|
|
113
|
+
/** Seeds the noise lattice, so a blob is the same blob in every capture. */
|
|
114
|
+
seed?: number;
|
|
115
|
+
};
|
|
116
|
+
type BuiltShape = {
|
|
117
|
+
spec: Shape;
|
|
118
|
+
mesh: THREE.Mesh;
|
|
119
|
+
/**
|
|
120
|
+
* The viewport-only light inside a glow shape.
|
|
121
|
+
* @internal Driven by `followGlow`; may change without notice.
|
|
122
|
+
*/
|
|
123
|
+
light?: THREE.PointLight;
|
|
124
|
+
/**
|
|
125
|
+
* The viewport-only halo round an emitter in fog.
|
|
126
|
+
* @internal May change without notice.
|
|
127
|
+
*/
|
|
128
|
+
halo?: THREE.Sprite;
|
|
129
|
+
/**
|
|
130
|
+
* The values the motions start from.
|
|
131
|
+
* @internal What the timeline animates from; may change without notice.
|
|
132
|
+
*/
|
|
133
|
+
base: {
|
|
134
|
+
position: Vec3;
|
|
135
|
+
rotation: Vec3;
|
|
136
|
+
strength: number;
|
|
137
|
+
roughness: number;
|
|
138
|
+
color: THREE.Color;
|
|
139
|
+
};
|
|
140
|
+
};
|
|
141
|
+
type BuiltComposition = {
|
|
142
|
+
group: THREE.Group;
|
|
143
|
+
shapes: BuiltShape[];
|
|
144
|
+
};
|
|
145
|
+
/**
|
|
146
|
+
* Build a composition at `at` (the floor point the shapes' y is measured
|
|
147
|
+
* from). Returns the group to add to the scene and the built shapes the
|
|
148
|
+
* timeline and the glow follower work on.
|
|
149
|
+
*/
|
|
150
|
+
declare function createComposition(spec: Composition, at?: Vec3): BuiltComposition;
|
|
151
|
+
/** Each frame: the stand-in light follows the emission the timeline is driving, and the loop's fade. */
|
|
152
|
+
declare function followGlow(built: BuiltComposition): void;
|
|
153
|
+
type Reflections = {
|
|
154
|
+
/** How many shapes took the snapshot. Zero when the scene has its own environment map, or nothing reflects. */
|
|
155
|
+
shapes: number;
|
|
156
|
+
/** Take the snapshot again now (after the setting changed, say). */
|
|
157
|
+
refresh(): Promise<void>;
|
|
158
|
+
/** Once a frame: takes the snapshot again when an emitter has moved or changed its glow since the last one. */
|
|
159
|
+
follow(): void;
|
|
160
|
+
/**
|
|
161
|
+
* True while a snapshot is being taken. The reflective shapes are hidden
|
|
162
|
+
* for that long (they must not reflect themselves), across an await, so a
|
|
163
|
+
* frame drawn meanwhile shows the composition without them: a render loop
|
|
164
|
+
* should keep its last frame up instead of drawing one.
|
|
165
|
+
*/
|
|
166
|
+
readonly busy: boolean;
|
|
167
|
+
/**
|
|
168
|
+
* For filming frame by frame: resolves once no snapshot is in flight and
|
|
169
|
+
* the last one is of the emitters where they are now, with every shape
|
|
170
|
+
* visible again. Await it after a seek and before the shot, or the shot
|
|
171
|
+
* catches the glass hidden.
|
|
172
|
+
*/
|
|
173
|
+
settle(): Promise<void>;
|
|
174
|
+
/** Free the render target. The materials keep no map after this. */
|
|
175
|
+
dispose(): void;
|
|
176
|
+
};
|
|
177
|
+
/**
|
|
178
|
+
* Give the reflective shapes something to reflect in the viewport: the
|
|
179
|
+
* scene as seen from the composition's center (the setting and the
|
|
180
|
+
* composition's own emitters, without the reflective shapes themselves),
|
|
181
|
+
* filtered into a PMREM. Called once after the setting is built; a scene
|
|
182
|
+
* that already has an environment map needs nothing. Call `follow()` on the
|
|
183
|
+
* handle every frame so a moving or breathing emitter is reflected where it
|
|
184
|
+
* is.
|
|
185
|
+
*/
|
|
186
|
+
declare function snapshotReflections(renderer: WebGPURenderer, scene: THREE.Scene, built: BuiltComposition, center: Vec3): Promise<Reflections>;
|
|
187
|
+
/**
|
|
188
|
+
* How a clip loops. `fade` is seconds of fade-out at the end and fade-in at
|
|
189
|
+
* the start (0: the clip loops by itself); `start` is the frame the cut opens
|
|
190
|
+
* on, the first one after the fade-in, so the loop never opens on an empty
|
|
191
|
+
* stage.
|
|
192
|
+
*/
|
|
193
|
+
type Loop = {
|
|
194
|
+
fade: number;
|
|
195
|
+
start: number;
|
|
196
|
+
};
|
|
197
|
+
/**
|
|
198
|
+
* How a clip of `spec` loops: by itself when the camera move (in the
|
|
199
|
+
* timeline's own terms: `orbitY`, `orbitX`, `dolly`) comes back to its start
|
|
200
|
+
* and every motion the shapes actually run is cyclic; otherwise with a fade.
|
|
201
|
+
*/
|
|
202
|
+
declare function compositionLoop(spec: Composition, clip: {
|
|
203
|
+
seconds: number;
|
|
204
|
+
fps: number;
|
|
205
|
+
camera?: {
|
|
206
|
+
orbitY?: number;
|
|
207
|
+
orbitX?: number;
|
|
208
|
+
dolly?: number;
|
|
209
|
+
};
|
|
210
|
+
}): Loop;
|
|
211
|
+
/**
|
|
212
|
+
* Put every shape's motions on the timeline, one keyframe per output frame.
|
|
213
|
+
* The timeline then drives the live meshes on `seek()` and ships the same
|
|
214
|
+
* samples in the manifest: one evaluator, two halves.
|
|
215
|
+
*
|
|
216
|
+
* Pass the clip's `compositionLoop()` so a clip that cannot loop by itself
|
|
217
|
+
* fades the shapes out at its end and in at its start; then open the cut on
|
|
218
|
+
* `loop.start`, not on frame 0.
|
|
219
|
+
*/
|
|
220
|
+
declare function animateComposition(tl: Timeline, built: BuiltComposition, duration: number, fps: number, loop?: Loop): number;
|
|
221
|
+
|
|
222
|
+
export { type BuiltComposition, type BuiltShape, type Composition, type Loop, MOTION_KINDS, type Motion, type MotionKind, type Reflections, SHAPE_FINISHES, SHAPE_KINDS, type Shape, type ShapeFinish, type ShapeKind, type Vec3, animateComposition, compositionLoop, createComposition, followGlow, snapshotReflections };
|