@casmo/tree.js 0.0.0-stage → 0.1.1
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 +485 -2
- package/dist/bake/index.d.ts +39 -0
- package/dist/bake/index.d.ts.map +1 -0
- package/dist/definition/defaults.d.ts +9 -0
- package/dist/definition/defaults.d.ts.map +1 -0
- package/dist/definition/index.d.ts +5 -0
- package/dist/definition/index.d.ts.map +1 -0
- package/dist/definition/migrations.d.ts +12 -0
- package/dist/definition/migrations.d.ts.map +1 -0
- package/dist/definition/parse.d.ts +30 -0
- package/dist/definition/parse.d.ts.map +1 -0
- package/dist/definition/schema.d.ts +13 -0
- package/dist/definition/schema.d.ts.map +1 -0
- package/dist/definition/types.d.ts +217 -0
- package/dist/definition/types.d.ts.map +1 -0
- package/dist/effects/effects.d.ts +46 -0
- package/dist/effects/effects.d.ts.map +1 -0
- package/dist/effects/glow.d.ts +19 -0
- package/dist/effects/glow.d.ts.map +1 -0
- package/dist/effects/grade.d.ts +19 -0
- package/dist/effects/grade.d.ts.map +1 -0
- package/dist/effects/index.d.ts +7 -0
- package/dist/effects/index.d.ts.map +1 -0
- package/dist/effects/mask.d.ts +44 -0
- package/dist/effects/mask.d.ts.map +1 -0
- package/dist/effects/outline.d.ts +18 -0
- package/dist/effects/outline.d.ts.map +1 -0
- package/dist/effects/suggested.d.ts +13 -0
- package/dist/effects/suggested.d.ts.map +1 -0
- package/dist/effects.js +249 -0
- package/dist/effects.js.map +1 -0
- package/dist/forest/Forest.d.ts +156 -0
- package/dist/forest/Forest.d.ts.map +1 -0
- package/dist/forest/index.d.ts +14 -0
- package/dist/forest/index.d.ts.map +1 -0
- package/dist/forest/nodes.d.ts +31 -0
- package/dist/forest/nodes.d.ts.map +1 -0
- package/dist/forest/placement.d.ts +52 -0
- package/dist/forest/placement.d.ts.map +1 -0
- package/dist/forest-OX9WvAwh.js +3057 -0
- package/dist/forest-OX9WvAwh.js.map +1 -0
- package/dist/generator/attributes.d.ts +20 -0
- package/dist/generator/attributes.d.ts.map +1 -0
- package/dist/generator/branches.d.ts +12 -0
- package/dist/generator/branches.d.ts.map +1 -0
- package/dist/generator/frames.d.ts +21 -0
- package/dist/generator/frames.d.ts.map +1 -0
- package/dist/generator/growth.d.ts +15 -0
- package/dist/generator/growth.d.ts.map +1 -0
- package/dist/generator/index.d.ts +22 -0
- package/dist/generator/index.d.ts.map +1 -0
- package/dist/generator/leaf-shapes.d.ts +10 -0
- package/dist/generator/leaf-shapes.d.ts.map +1 -0
- package/dist/generator/leaves.d.ts +14 -0
- package/dist/generator/leaves.d.ts.map +1 -0
- package/dist/generator/mesh.d.ts +11 -0
- package/dist/generator/mesh.d.ts.map +1 -0
- package/dist/generator/sculpt.d.ts +28 -0
- package/dist/generator/sculpt.d.ts.map +1 -0
- package/dist/generator/trunk.d.ts +6 -0
- package/dist/generator/trunk.d.ts.map +1 -0
- package/dist/generator/types.d.ts +126 -0
- package/dist/generator/types.d.ts.map +1 -0
- package/dist/generator/vec.d.ts +12 -0
- package/dist/generator/vec.d.ts.map +1 -0
- package/dist/generator/wind.d.ts +27 -0
- package/dist/generator/wind.d.ts.map +1 -0
- package/dist/growth/evaluate.d.ts +32 -0
- package/dist/growth/evaluate.d.ts.map +1 -0
- package/dist/growth/index.d.ts +3 -0
- package/dist/growth/index.d.ts.map +1 -0
- package/dist/growth/tsl.d.ts +12 -0
- package/dist/growth/tsl.d.ts.map +1 -0
- package/dist/index.d.ts +14 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +198 -0
- package/dist/index.js.map +1 -0
- package/dist/materials/index.d.ts +18 -0
- package/dist/materials/index.d.ts.map +1 -0
- package/dist/materials/maps.d.ts +23 -0
- package/dist/materials/maps.d.ts.map +1 -0
- package/dist/materials/shading.d.ts +18 -0
- package/dist/materials/shading.d.ts.map +1 -0
- package/dist/materials/toon.d.ts +12 -0
- package/dist/materials/toon.d.ts.map +1 -0
- package/dist/math/index.d.ts +23 -0
- package/dist/math/index.d.ts.map +1 -0
- package/dist/profiles-BAiyeFlh.js +113 -0
- package/dist/profiles-BAiyeFlh.js.map +1 -0
- package/dist/random/index.d.ts +37 -0
- package/dist/random/index.d.ts.map +1 -0
- package/dist/react/Forest.d.ts +54 -0
- package/dist/react/Forest.d.ts.map +1 -0
- package/dist/react/Tree.d.ts +41 -0
- package/dist/react/Tree.d.ts.map +1 -0
- package/dist/react/Wind.d.ts +17 -0
- package/dist/react/Wind.d.ts.map +1 -0
- package/dist/react/index.d.ts +6 -0
- package/dist/react/index.d.ts.map +1 -0
- package/dist/react/useTreeStyle.d.ts +15 -0
- package/dist/react/useTreeStyle.d.ts.map +1 -0
- package/dist/react.js +239 -0
- package/dist/react.js.map +1 -0
- package/dist/renderer/index.d.ts +7 -0
- package/dist/renderer/index.d.ts.map +1 -0
- package/dist/season/check.d.ts +3 -0
- package/dist/season/check.d.ts.map +1 -0
- package/dist/season/index.d.ts +4 -0
- package/dist/season/index.d.ts.map +1 -0
- package/dist/season/nodes.d.ts +32 -0
- package/dist/season/nodes.d.ts.map +1 -0
- package/dist/season/profile.d.ts +78 -0
- package/dist/season/profile.d.ts.map +1 -0
- package/dist/season/profiles.d.ts +40 -0
- package/dist/season/profiles.d.ts.map +1 -0
- package/dist/styles/low-poly/index.d.ts +16 -0
- package/dist/styles/low-poly/index.d.ts.map +1 -0
- package/dist/styles/low-poly.js +165 -0
- package/dist/styles/low-poly.js.map +1 -0
- package/dist/styles/realistic/index.d.ts +23 -0
- package/dist/styles/realistic/index.d.ts.map +1 -0
- package/dist/styles/realistic.js +206 -0
- package/dist/styles/realistic.js.map +1 -0
- package/dist/styles/registry.d.ts +17 -0
- package/dist/styles/registry.d.ts.map +1 -0
- package/dist/styles/stylized/index.d.ts +17 -0
- package/dist/styles/stylized/index.d.ts.map +1 -0
- package/dist/styles/stylized.js +266 -0
- package/dist/styles/stylized.js.map +1 -0
- package/dist/styles/types.d.ts +12 -0
- package/dist/styles/types.d.ts.map +1 -0
- package/dist/textures/index.d.ts +44 -0
- package/dist/textures/index.d.ts.map +1 -0
- package/dist/textures/realistic/bark-normal.png +0 -0
- package/dist/textures/realistic/bark.png +0 -0
- package/dist/textures/realistic/leaf.png +0 -0
- package/dist/textures/realistic/needles.png +0 -0
- package/dist/tree/Tree.d.ts +70 -0
- package/dist/tree/Tree.d.ts.map +1 -0
- package/dist/tree/index.d.ts +14 -0
- package/dist/tree/index.d.ts.map +1 -0
- package/dist/types-BZjHhNz7.js +20 -0
- package/dist/types-BZjHhNz7.js.map +1 -0
- package/dist/wind/Wind.d.ts +54 -0
- package/dist/wind/Wind.d.ts.map +1 -0
- package/dist/wind/index.d.ts +4 -0
- package/dist/wind/index.d.ts.map +1 -0
- package/dist/wind/node.d.ts +38 -0
- package/dist/wind/node.d.ts.map +1 -0
- package/dist/wind/response.d.ts +27 -0
- package/dist/wind/response.d.ts.map +1 -0
- package/package.json +107 -4
package/dist/react.js
ADDED
|
@@ -0,0 +1,239 @@
|
|
|
1
|
+
import { D as clampGrowth, H as wrapSeason, a as forestTreeKey, c as createTree, f as sceneWind, s as loadStyle, t as createForest } from "./forest-OX9WvAwh.js";
|
|
2
|
+
import { use, useEffect, useLayoutEffect, useMemo, useState } from "react";
|
|
3
|
+
import { jsx } from "react/jsx-runtime";
|
|
4
|
+
// src/react/useTreeStyle.ts
|
|
5
|
+
var cache = /* @__PURE__ */ new Map();
|
|
6
|
+
function styleResource(name) {
|
|
7
|
+
let promise = cache.get(name);
|
|
8
|
+
if (!promise) {
|
|
9
|
+
promise = loadStyle(name);
|
|
10
|
+
cache.set(name, promise);
|
|
11
|
+
promise.catch(() => cache.delete(name));
|
|
12
|
+
}
|
|
13
|
+
return promise;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Loads a built-in Style with a dynamic import and returns it. Suspends (React Suspense) while
|
|
17
|
+
* it downloads, so wrap the component in `<Suspense>`. Unknown names throw to the nearest error boundary.
|
|
18
|
+
*
|
|
19
|
+
* ```tsx
|
|
20
|
+
* const lowPoly = useTreeStyle('low-poly');
|
|
21
|
+
* return <Tree style={lowPoly} form="conifer" seed={7} />;
|
|
22
|
+
* ```
|
|
23
|
+
*/
|
|
24
|
+
function useTreeStyle(name) {
|
|
25
|
+
return use(styleResource(name));
|
|
26
|
+
}
|
|
27
|
+
/** Starts loading a Style ahead of time (e.g. on hover), without suspending. */
|
|
28
|
+
function preloadTreeStyle(name) {
|
|
29
|
+
styleResource(name).catch(() => {});
|
|
30
|
+
}
|
|
31
|
+
// src/react/Tree.tsx
|
|
32
|
+
/** Trees this module has disposed of (React StrictMode re-runs effects on the same memoised tree). */
|
|
33
|
+
var disposed$1 = /* @__PURE__ */ new WeakSet();
|
|
34
|
+
/**
|
|
35
|
+
* A procedural tree. Growth, Season, Wind and shadow props only update the existing tree; a new
|
|
36
|
+
* `seed`, `definition` (by value) or `style`/`form` regenerates it. The tree is disposed
|
|
37
|
+
* of on unmount.
|
|
38
|
+
*/
|
|
39
|
+
function Tree({ definition, style, form = "broadleaf", seed = 0, growth = 1, season = 0, wind, castShadow = true, receiveShadow = true, ref, ...groupProps }) {
|
|
40
|
+
const styleObject = definition === void 0 && typeof style === "string" ? useTreeStyle(style) : style;
|
|
41
|
+
const source = definition ?? (typeof styleObject === "object" ? styleObject[form] : void 0);
|
|
42
|
+
if (source === void 0) throw new Error("<Tree> needs a `definition` or a `style`.");
|
|
43
|
+
const key = JSON.stringify(source);
|
|
44
|
+
const [generation, setGeneration] = useState(0);
|
|
45
|
+
const tree = useMemo(() => createTree(JSON.parse(key), {
|
|
46
|
+
seed,
|
|
47
|
+
wind,
|
|
48
|
+
growth,
|
|
49
|
+
season
|
|
50
|
+
}), [
|
|
51
|
+
key,
|
|
52
|
+
seed,
|
|
53
|
+
generation
|
|
54
|
+
]);
|
|
55
|
+
useEffect(() => {
|
|
56
|
+
if (disposed$1.has(tree)) setGeneration((g) => g + 1);
|
|
57
|
+
return () => {
|
|
58
|
+
disposed$1.add(tree);
|
|
59
|
+
tree.dispose();
|
|
60
|
+
};
|
|
61
|
+
}, [tree]);
|
|
62
|
+
useLayoutEffect(() => {
|
|
63
|
+
tree.wind = wind ?? sceneWind;
|
|
64
|
+
}, [tree, wind]);
|
|
65
|
+
useLayoutEffect(() => {
|
|
66
|
+
tree.growth = growth;
|
|
67
|
+
}, [tree, growth]);
|
|
68
|
+
useLayoutEffect(() => {
|
|
69
|
+
tree.season = season;
|
|
70
|
+
}, [tree, season]);
|
|
71
|
+
useLayoutEffect(() => {
|
|
72
|
+
for (const mesh of [tree.wood, tree.leaves]) {
|
|
73
|
+
mesh.castShadow = castShadow;
|
|
74
|
+
mesh.receiveShadow = receiveShadow;
|
|
75
|
+
}
|
|
76
|
+
}, [
|
|
77
|
+
tree,
|
|
78
|
+
castShadow,
|
|
79
|
+
receiveShadow
|
|
80
|
+
]);
|
|
81
|
+
return /* @__PURE__ */ jsx("primitive", {
|
|
82
|
+
object: tree,
|
|
83
|
+
ref,
|
|
84
|
+
...groupProps
|
|
85
|
+
});
|
|
86
|
+
}
|
|
87
|
+
// src/react/Wind.tsx
|
|
88
|
+
/**
|
|
89
|
+
* Declares the Wind. Renders nothing; it writes the Wind's uniforms (no recompile), and puts back the
|
|
90
|
+
* direction, strength and clock it found when it unmounts.
|
|
91
|
+
*/
|
|
92
|
+
function Wind({ direction, strength, time = null, wind = sceneWind }) {
|
|
93
|
+
const [x, y, z] = direction === void 0 ? [] : Array.isArray(direction) ? direction : direction.toArray();
|
|
94
|
+
useLayoutEffect(() => {
|
|
95
|
+
const previous = {
|
|
96
|
+
direction: wind.direction,
|
|
97
|
+
strength: wind.strength,
|
|
98
|
+
time: wind.time
|
|
99
|
+
};
|
|
100
|
+
return () => {
|
|
101
|
+
wind.set(previous);
|
|
102
|
+
wind.time = previous.time;
|
|
103
|
+
};
|
|
104
|
+
}, [wind]);
|
|
105
|
+
useLayoutEffect(() => {
|
|
106
|
+
if (x !== void 0) wind.direction = [
|
|
107
|
+
x,
|
|
108
|
+
y,
|
|
109
|
+
z
|
|
110
|
+
];
|
|
111
|
+
}, [
|
|
112
|
+
wind,
|
|
113
|
+
x,
|
|
114
|
+
y,
|
|
115
|
+
z
|
|
116
|
+
]);
|
|
117
|
+
useLayoutEffect(() => {
|
|
118
|
+
if (strength !== void 0) wind.strength = strength;
|
|
119
|
+
}, [wind, strength]);
|
|
120
|
+
useLayoutEffect(() => {
|
|
121
|
+
wind.time = time;
|
|
122
|
+
}, [wind, time]);
|
|
123
|
+
return null;
|
|
124
|
+
}
|
|
125
|
+
// src/react/Forest.tsx
|
|
126
|
+
/** Forests this module has disposed of (React StrictMode re-runs effects on the same memoised forest). */
|
|
127
|
+
var disposed = /* @__PURE__ */ new WeakSet();
|
|
128
|
+
/** The placement without the React-only per-tree state. */
|
|
129
|
+
function placementOf(p) {
|
|
130
|
+
const placement = { ...p };
|
|
131
|
+
delete placement.growth;
|
|
132
|
+
delete placement.season;
|
|
133
|
+
return placement;
|
|
134
|
+
}
|
|
135
|
+
/** What makes a tree stand where it does; a change re-plants the tree. */
|
|
136
|
+
function pose(p) {
|
|
137
|
+
const v = p.position;
|
|
138
|
+
const position = Array.isArray(v) ? [
|
|
139
|
+
v[0],
|
|
140
|
+
v[1],
|
|
141
|
+
v[2]
|
|
142
|
+
] : [
|
|
143
|
+
v.x,
|
|
144
|
+
v.y,
|
|
145
|
+
v.z
|
|
146
|
+
];
|
|
147
|
+
return JSON.stringify([
|
|
148
|
+
position,
|
|
149
|
+
p.rotation ?? 0,
|
|
150
|
+
p.scale ?? 1
|
|
151
|
+
]);
|
|
152
|
+
}
|
|
153
|
+
/**
|
|
154
|
+
* Brings `forest` in line with `placements`: cuts trees that are no longer placed, plants new ones,
|
|
155
|
+
* re-plants moved ones, and writes Growth/Season only where they differ. Untouched trees are not rewritten.
|
|
156
|
+
*/
|
|
157
|
+
function syncForest(forest, placements, growth, season) {
|
|
158
|
+
if (forest.growth !== clampGrowth(growth)) forest.growth = growth;
|
|
159
|
+
if (forest.season !== wrapSeason(season)) forest.season = season;
|
|
160
|
+
const wanted = /* @__PURE__ */ new Map();
|
|
161
|
+
for (const p of placements) {
|
|
162
|
+
const key = forestTreeKey(p);
|
|
163
|
+
if (wanted.has(key)) throw new Error(`<Forest> placements have two trees with key "${key}"`);
|
|
164
|
+
wanted.set(key, p);
|
|
165
|
+
}
|
|
166
|
+
for (const tree of forest.trees) {
|
|
167
|
+
const p = wanted.get(tree.key);
|
|
168
|
+
if (!p || pose(p) !== pose(tree.placement)) forest.removeTree(tree);
|
|
169
|
+
}
|
|
170
|
+
for (const [key, p] of wanted) {
|
|
171
|
+
const tree = forest.get(key) ?? forest.addTree(placementOf(p));
|
|
172
|
+
const g = p.growth ?? growth;
|
|
173
|
+
const s = p.season ?? season;
|
|
174
|
+
if (tree.growth !== clampGrowth(g)) tree.growth = g;
|
|
175
|
+
if (tree.season !== wrapSeason(s)) tree.season = s;
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
/**
|
|
179
|
+
* Many trees of one Definition, drawn instanced (a `Forest`). Changing `placements` plants or cuts
|
|
180
|
+
* only the affected trees; Growth, Season, Wind and shadow props only update instance data, uniforms
|
|
181
|
+
* and meshes. A new `definition` (by value), `style`/`form`, `variants` or `seed` rebuilds the forest.
|
|
182
|
+
* The forest is disposed of on unmount.
|
|
183
|
+
*/
|
|
184
|
+
function Forest({ definition, style, form = "broadleaf", variants = 4, seed = 0, placements, growth = 1, season = 0, wind, castShadow = true, receiveShadow = true, ref, ...groupProps }) {
|
|
185
|
+
const styleObject = definition === void 0 && typeof style === "string" ? useTreeStyle(style) : style;
|
|
186
|
+
const source = definition ?? (typeof styleObject === "object" ? styleObject[form] : void 0);
|
|
187
|
+
if (source === void 0) throw new Error("<Forest> needs a `definition` or a `style`.");
|
|
188
|
+
const key = JSON.stringify(source);
|
|
189
|
+
const [generation, setGeneration] = useState(0);
|
|
190
|
+
const forest = useMemo(() => createForest(JSON.parse(key), [], {
|
|
191
|
+
variants,
|
|
192
|
+
seed,
|
|
193
|
+
wind,
|
|
194
|
+
growth,
|
|
195
|
+
season
|
|
196
|
+
}), [
|
|
197
|
+
key,
|
|
198
|
+
variants,
|
|
199
|
+
seed,
|
|
200
|
+
generation
|
|
201
|
+
]);
|
|
202
|
+
useEffect(() => {
|
|
203
|
+
if (disposed.has(forest)) setGeneration((g) => g + 1);
|
|
204
|
+
return () => {
|
|
205
|
+
disposed.add(forest);
|
|
206
|
+
forest.dispose();
|
|
207
|
+
};
|
|
208
|
+
}, [forest]);
|
|
209
|
+
useLayoutEffect(() => {
|
|
210
|
+
forest.wind = wind ?? sceneWind;
|
|
211
|
+
}, [forest, wind]);
|
|
212
|
+
useLayoutEffect(() => {
|
|
213
|
+
syncForest(forest, placements, growth, season);
|
|
214
|
+
}, [
|
|
215
|
+
forest,
|
|
216
|
+
placements,
|
|
217
|
+
growth,
|
|
218
|
+
season
|
|
219
|
+
]);
|
|
220
|
+
useLayoutEffect(() => {
|
|
221
|
+
for (const variant of forest.variants) for (const mesh of [variant.wood, variant.leaves]) {
|
|
222
|
+
mesh.castShadow = castShadow;
|
|
223
|
+
mesh.receiveShadow = receiveShadow;
|
|
224
|
+
}
|
|
225
|
+
}, [
|
|
226
|
+
forest,
|
|
227
|
+
castShadow,
|
|
228
|
+
receiveShadow,
|
|
229
|
+
placements
|
|
230
|
+
]);
|
|
231
|
+
return /* @__PURE__ */ jsx("primitive", {
|
|
232
|
+
object: forest,
|
|
233
|
+
ref,
|
|
234
|
+
...groupProps
|
|
235
|
+
});
|
|
236
|
+
}
|
|
237
|
+
export { Forest, Tree, Wind, preloadTreeStyle, useTreeStyle };
|
|
238
|
+
|
|
239
|
+
//# sourceMappingURL=react.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"react.js","names":["disposed"],"sources":["../src/react/useTreeStyle.ts","../src/react/Tree.tsx","../src/react/Wind.tsx","../src/react/Forest.tsx"],"sourcesContent":["import { use } from 'react';\nimport { loadStyle, type StyleName } from '../styles/registry';\nimport type { TreeStyle } from '../styles/types';\n\n// One promise per Style name, so every render (and every component) suspends on the same load.\nconst cache = new Map<string, Promise<TreeStyle>>();\n\nfunction styleResource(name: StyleName): Promise<TreeStyle> {\n let promise = cache.get(name);\n if (!promise) {\n promise = loadStyle(name);\n cache.set(name, promise);\n // A failed load is not cached, so a later render can retry (the error still reaches the error boundary).\n promise.catch(() => cache.delete(name));\n }\n return promise;\n}\n\n/**\n * Loads a built-in Style with a dynamic import and returns it. Suspends (React Suspense) while\n * it downloads, so wrap the component in `<Suspense>`. Unknown names throw to the nearest error boundary.\n *\n * ```tsx\n * const lowPoly = useTreeStyle('low-poly');\n * return <Tree style={lowPoly} form=\"conifer\" seed={7} />;\n * ```\n */\nexport function useTreeStyle(name: StyleName): TreeStyle {\n return use(styleResource(name));\n}\n\n/** Starts loading a Style ahead of time (e.g. on hover), without suspending. */\nexport function preloadTreeStyle(name: StyleName): void {\n void styleResource(name).catch(() => {});\n}\n","import { useEffect, useLayoutEffect, useMemo, useState, type Ref } from 'react';\nimport type { ThreeElements } from '@react-three/fiber';\nimport type { TreeDefinition, TreeDefinitionInput, TreeForm } from '../definition';\nimport type { TreeStyle } from '../styles/types';\nimport type { StyleName } from '../styles/registry';\nimport { createTree, type Tree as TreeObject } from '../tree';\nimport { sceneWind, type Wind as WindObject } from '../wind';\nimport { useTreeStyle } from './useTreeStyle';\n\ntype GroupProps = Omit<ThreeElements['group'], 'args' | 'object' | 'children' | 'ref' | 'castShadow' | 'receiveShadow' | 'dispose'>;\n\nexport interface TreeProps extends GroupProps {\n /** The Tree Definition to grow (plain object or parsed JSON). Takes precedence over `style`. */\n definition?: TreeDefinitionInput | TreeDefinition;\n /**\n * A Style: its Definition for `form` is grown. Pass the object from {@link useTreeStyle}, or a\n * built-in Style name, which is loaded on demand (the component suspends until it is there).\n */\n style?: TreeStyle | StyleName;\n /** Which of the Style's Forms to grow. Default 'broadleaf'. */\n form?: TreeForm;\n /** Picks one individual tree within the Definition's ranges. Default 0. Changing it regenerates the tree. */\n seed?: number;\n /** Growth 0 (sapling) .. 1 (default). Only updates a uniform. */\n growth?: number;\n /** Season 0 .. 1 (wraps). Only updates a uniform. */\n season?: number;\n /** The Wind this tree sways with. Default: the scene-wide `sceneWind` (what `<Wind>` sets). */\n wind?: WindObject;\n /** Whether the tree casts shadows. Default true. */\n castShadow?: boolean;\n /** Whether the tree receives shadows. Default true. */\n receiveShadow?: boolean;\n /** Receives the tree.js `Tree` object (a three.js Group). */\n ref?: Ref<TreeObject>;\n}\n\n/** Trees this module has disposed of (React StrictMode re-runs effects on the same memoised tree). */\nconst disposed = new WeakSet<TreeObject>();\n\n/**\n * A procedural tree. Growth, Season, Wind and shadow props only update the existing tree; a new\n * `seed`, `definition` (by value) or `style`/`form` regenerates it. The tree is disposed\n * of on unmount.\n */\nexport function Tree({\n definition,\n style,\n form = 'broadleaf',\n seed = 0,\n growth = 1,\n season = 0,\n wind,\n castShadow = true,\n receiveShadow = true,\n ref,\n ...groupProps\n}: TreeProps) {\n // `use()` (behind useTreeStyle) may be called conditionally, so a style name suspends right here.\n const styleObject = definition === undefined && typeof style === 'string' ? useTreeStyle(style) : style;\n const source = definition ?? (typeof styleObject === 'object' ? styleObject[form] : undefined);\n if (source === undefined) throw new Error('<Tree> needs a `definition` or a `style`.');\n // Compare Definitions by value, so an inline object literal does not regenerate on every render.\n const key = JSON.stringify(source);\n\n // Bumped when StrictMode disposed the memoised tree, to grow a fresh one.\n const [generation, setGeneration] = useState(0);\n const tree = useMemo(\n () => createTree(JSON.parse(key) as TreeDefinitionInput, { seed, wind, growth, season }),\n // growth/season/wind are only the starting values; the effects below keep them in sync.\n [key, seed, generation],\n );\n\n useEffect(() => {\n if (disposed.has(tree)) setGeneration((g) => g + 1);\n return () => {\n disposed.add(tree);\n tree.dispose();\n };\n }, [tree]);\n\n useLayoutEffect(() => {\n tree.wind = wind ?? sceneWind;\n }, [tree, wind]);\n\n useLayoutEffect(() => {\n tree.growth = growth;\n }, [tree, growth]);\n\n useLayoutEffect(() => {\n tree.season = season;\n }, [tree, season]);\n\n useLayoutEffect(() => {\n for (const mesh of [tree.wood, tree.leaves]) {\n mesh.castShadow = castShadow;\n mesh.receiveShadow = receiveShadow;\n }\n }, [tree, castShadow, receiveShadow]);\n\n return <primitive object={tree} ref={ref} {...groupProps} />;\n}\n","import { useLayoutEffect } from 'react';\nimport { sceneWind, type Wind as WindObject, type WindDirection } from '../wind';\n\nexport interface WindProps {\n /** World-space direction the wind blows towards (any non-zero length). Unset: leave as is (default +X). */\n direction?: WindDirection;\n /** 0 = calm, 1 = strong wind, more for storms. Unset: leave as is (default 0). */\n strength?: number;\n /** Pins the Wind clock to this many seconds (pause, screenshots). Unset: the renderer clock. */\n time?: number | null;\n /** The Wind to drive. Default: the scene-wide `sceneWind` every `<Tree>` sways with. */\n wind?: WindObject;\n}\n\n/**\n * Declares the Wind. Renders nothing; it writes the Wind's uniforms (no recompile), and puts back the\n * direction, strength and clock it found when it unmounts.\n */\nexport function Wind({ direction, strength, time = null, wind = sceneWind }: WindProps): null {\n // Depend on the components, so a new array literal with the same values does nothing.\n const [x, y, z] = direction === undefined ? [] : Array.isArray(direction) ? direction : (direction as { toArray(): number[] }).toArray();\n\n useLayoutEffect(() => {\n const previous = { direction: wind.direction, strength: wind.strength, time: wind.time };\n return () => {\n wind.set(previous);\n wind.time = previous.time;\n };\n }, [wind]);\n\n useLayoutEffect(() => {\n if (x !== undefined) wind.direction = [x, y!, z!];\n }, [wind, x, y, z]);\n\n useLayoutEffect(() => {\n if (strength !== undefined) wind.strength = strength;\n }, [wind, strength]);\n\n useLayoutEffect(() => {\n wind.time = time;\n }, [wind, time]);\n\n return null;\n}\n","import { useEffect, useLayoutEffect, useMemo, useState, type Ref } from 'react';\nimport type { ThreeElements } from '@react-three/fiber';\nimport type { TreeDefinition, TreeDefinitionInput, TreeForm } from '../definition';\nimport type { TreeStyle } from '../styles/types';\nimport type { StyleName } from '../styles/registry';\nimport { createForest, type Forest as ForestObject } from '../forest';\nimport { forestTreeKey, type ForestPlacement } from '../forest/placement';\nimport { clampGrowth } from '../growth/evaluate';\nimport { wrapSeason } from '../season/profile';\nimport { sceneWind, type Wind as WindObject } from '../wind';\nimport { useTreeStyle } from './useTreeStyle';\n\ntype GroupProps = Omit<ThreeElements['group'], 'args' | 'object' | 'children' | 'ref' | 'castShadow' | 'receiveShadow' | 'dispose'>;\n\n/** Where one tree of a `<Forest>` stands, optionally with its own Growth and Season. */\nexport interface ForestTreePlacement extends ForestPlacement {\n /** This tree's Growth, 0..1. Default: the forest's `growth`. */\n growth?: number;\n /** This tree's Season, 0..1 (wraps). Default: the forest's `season`. */\n season?: number;\n}\n\nexport interface ForestProps extends GroupProps {\n /** The Tree Definition every tree is grown from (plain object or parsed JSON). Takes precedence over `style`. */\n definition?: TreeDefinitionInput | TreeDefinition;\n /** A Style (object from {@link useTreeStyle}, or a built-in Style name, loaded on demand: suspends). */\n style?: TreeStyle | StyleName;\n /** Which of the Style's Forms to grow. Default 'broadleaf'. */\n form?: TreeForm;\n /** How many Variants (distinct trees, each drawn instanced). Default 4. Changing it rebuilds the forest. */\n variants?: number;\n /** The forest seed. Default 0. Changing it rebuilds the forest. */\n seed?: number;\n /**\n * The trees. Trees are matched by key (their `id`, or their position without one), so adding or\n * removing placements only plants or cuts those trees; the others keep their look and instance data.\n */\n placements: readonly ForestTreePlacement[];\n /** Growth of every tree without its own `growth`, 0..1. Default 1. Only rewrites instance data. */\n growth?: number;\n /** Season of every tree without its own `season`, 0..1 (wraps). Default 0. Only rewrites instance data. */\n season?: number;\n /** The Wind the forest sways with. Default: the scene-wide `sceneWind` (what `<Wind>` sets). */\n wind?: WindObject;\n /** Whether the trees cast shadows. Default true. */\n castShadow?: boolean;\n /** Whether the trees receive shadows. Default true. */\n receiveShadow?: boolean;\n /** Receives the tree.js `Forest` object (a three.js Group). */\n ref?: Ref<ForestObject>;\n}\n\n/** Forests this module has disposed of (React StrictMode re-runs effects on the same memoised forest). */\nconst disposed = new WeakSet<ForestObject>();\n\n/** The placement without the React-only per-tree state. */\nfunction placementOf(p: ForestTreePlacement): ForestPlacement {\n const placement = { ...p };\n delete placement.growth;\n delete placement.season;\n return placement;\n}\n\n/** What makes a tree stand where it does; a change re-plants the tree. */\nfunction pose(p: ForestPlacement): string {\n const v = p.position;\n const position = Array.isArray(v) ? [v[0], v[1], v[2]] : [(v as { x: number }).x, (v as { y: number }).y, (v as { z: number }).z];\n return JSON.stringify([position, p.rotation ?? 0, p.scale ?? 1]);\n}\n\n/**\n * Brings `forest` in line with `placements`: cuts trees that are no longer placed, plants new ones,\n * re-plants moved ones, and writes Growth/Season only where they differ. Untouched trees are not rewritten.\n */\nfunction syncForest(forest: ForestObject, placements: readonly ForestTreePlacement[], growth: number, season: number): void {\n if (forest.growth !== clampGrowth(growth)) forest.growth = growth;\n if (forest.season !== wrapSeason(season)) forest.season = season;\n\n const wanted = new Map<string, ForestTreePlacement>();\n for (const p of placements) {\n const key = forestTreeKey(p);\n if (wanted.has(key)) throw new Error(`<Forest> placements have two trees with key \"${key}\"`);\n wanted.set(key, p);\n }\n for (const tree of forest.trees) {\n const p = wanted.get(tree.key);\n if (!p || pose(p) !== pose(tree.placement)) forest.removeTree(tree);\n }\n for (const [key, p] of wanted) {\n const tree = forest.get(key) ?? forest.addTree(placementOf(p));\n const g = p.growth ?? growth;\n const s = p.season ?? season;\n if (tree.growth !== clampGrowth(g)) tree.growth = g;\n if (tree.season !== wrapSeason(s)) tree.season = s;\n }\n}\n\n/**\n * Many trees of one Definition, drawn instanced (a `Forest`). Changing `placements` plants or cuts\n * only the affected trees; Growth, Season, Wind and shadow props only update instance data, uniforms\n * and meshes. A new `definition` (by value), `style`/`form`, `variants` or `seed` rebuilds the forest.\n * The forest is disposed of on unmount.\n */\nexport function Forest({\n definition,\n style,\n form = 'broadleaf',\n variants = 4,\n seed = 0,\n placements,\n growth = 1,\n season = 0,\n wind,\n castShadow = true,\n receiveShadow = true,\n ref,\n ...groupProps\n}: ForestProps) {\n const styleObject = definition === undefined && typeof style === 'string' ? useTreeStyle(style) : style;\n const source = definition ?? (typeof styleObject === 'object' ? styleObject[form] : undefined);\n if (source === undefined) throw new Error('<Forest> needs a `definition` or a `style`.');\n const key = JSON.stringify(source);\n\n const [generation, setGeneration] = useState(0);\n const forest = useMemo(\n () => createForest(JSON.parse(key) as TreeDefinitionInput, [], { variants, seed, wind, growth, season }),\n // placements/growth/season/wind are synced by the layout effects below.\n [key, variants, seed, generation],\n );\n\n useEffect(() => {\n if (disposed.has(forest)) setGeneration((g) => g + 1);\n return () => {\n disposed.add(forest);\n forest.dispose();\n };\n }, [forest]);\n\n useLayoutEffect(() => {\n forest.wind = wind ?? sceneWind;\n }, [forest, wind]);\n\n useLayoutEffect(() => {\n syncForest(forest, placements, growth, season);\n }, [forest, placements, growth, season]);\n\n useLayoutEffect(() => {\n for (const variant of forest.variants) {\n for (const mesh of [variant.wood, variant.leaves]) {\n mesh.castShadow = castShadow;\n mesh.receiveShadow = receiveShadow;\n }\n }\n }, [forest, castShadow, receiveShadow, placements]);\n\n return <primitive object={forest} ref={ref} {...groupProps} />;\n}\n"],"mappings":";;;;AAKA,IAAM,wBAAQ,IAAI,IAAgC;AAElD,SAAS,cAAc,MAAqC;CAC1D,IAAI,UAAU,MAAM,IAAI,IAAI;CAC5B,IAAI,CAAC,SAAS;EACZ,UAAU,UAAU,IAAI;EACxB,MAAM,IAAI,MAAM,OAAO;EAEvB,QAAQ,YAAY,MAAM,OAAO,IAAI,CAAC;CACxC;CACA,OAAO;AACT;;;;;;;;;;AAWA,SAAgB,aAAa,MAA4B;CACvD,OAAO,IAAI,cAAc,IAAI,CAAC;AAChC;;AAGA,SAAgB,iBAAiB,MAAuB;CACtD,cAAmB,IAAI,CAAC,CAAC,YAAY,CAAC,CAAC;AACzC;;;ACIA,IAAMA,6BAAW,IAAI,QAAoB;;;;;;AAOzC,SAAgB,KAAK,EACnB,YACA,OACA,OA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C;EACpD,aAAa;GACX,SAAS,IAAI,MAAM;GACnB,OAAO,QAAQ;EACjB;CACF,GAAG,CAAC,MAAM,CAAC;CAEX,sBAAsB;EACpB,OAAO,OAAO,QAAQ;CACxB,GAAG,CAAC,QAAQ,IAAI,CAAC;CAEjB,sBAAsB;EACpB,WAAW,QAAQ,YAAY,QAAQ,MAAM;CAC/C,GAAG;EAAC;EAAQ;EAAY;EAAQ;CAAM,CAAC;CAEvC,sBAAsB;EACpB,KAAK,MAAM,WAAW,OAAO,UAC3B,KAAK,MAAM,QAAQ,CAAC,QAAQ,MAAM,QAAQ,MAAM,GAAG;GACjD,KAAK,aAAa;GAClB,KAAK,gBAAgB;EACvB;CAEJ,GAAG;EAAC;EAAQ;EAAY;EAAe;CAAU,CAAC;CAElD,OAAO,oBAAC,aAAD;EAAW,QAAQ;EAAa;EAAK,GAAI;CAAa,CAAA;AAC/D"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/** Thrown when a tree is drawn by anything other than `WebGPURenderer` (ADR 0002). */
|
|
2
|
+
export declare class UnsupportedRendererError extends Error {
|
|
3
|
+
constructor(what: string);
|
|
4
|
+
}
|
|
5
|
+
/** Throws {@link UnsupportedRendererError} unless `renderer` is a `WebGPURenderer` (either backend). */
|
|
6
|
+
export declare function assertWebGPURenderer(renderer: unknown): void;
|
|
7
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/renderer/index.ts"],"names":[],"mappings":"AAAA,sFAAsF;AACtF,qBAAa,wBAAyB,SAAQ,KAAK;gBACrC,IAAI,EAAE,MAAM;CAQzB;AAOD,wGAAwG;AACxG,wBAAgB,oBAAoB,CAAC,QAAQ,EAAE,OAAO,GAAG,IAAI,CAI5D"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"check.d.ts","sourceRoot":"","sources":["../../src/season/check.ts"],"names":[],"mappings":"AAEA,8FAA8F;AAC9F,wBAAgB,aAAa,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAGnD"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/season/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAC;AAC1B,cAAc,YAAY,CAAC;AAC3B,cAAc,SAAS,CAAC"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { type Node as FloatNode, type NodeMaterial, type UniformNode } from 'three/webgpu';
|
|
2
|
+
import type { SeasonProfileDefinition } from '../definition';
|
|
3
|
+
/** A float uniform (`.value` is the Season). */
|
|
4
|
+
export type SeasonUniform = UniformNode<'float', number>;
|
|
5
|
+
type Node = any;
|
|
6
|
+
/** The Season nodes of one tree's leaves; `S` is the Season input node (a uniform by default). */
|
|
7
|
+
export interface SeasonNodes<S extends FloatNode<'float'> = SeasonUniform> {
|
|
8
|
+
/** Season 0..1 (first day of spring .. last day of winter). For a uniform: write `.value`; nothing recompiles. */
|
|
9
|
+
season: S;
|
|
10
|
+
/** Leaf colour (vec3, linear) at this leaf's shifted Season, or the blossom colour for a blossom. */
|
|
11
|
+
color: Node;
|
|
12
|
+
/** True while the leaf is shown (coverage above its rank, or a blossom). For `maskNode`. */
|
|
13
|
+
visible: Node;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Builds the TSL nodes that evaluate a Season Profile per leaf, from the `aSeason` vertex
|
|
17
|
+
* attribute (Seed timing shift, coverage rank, blossom rank). The TSL twin of `leafSeason`.
|
|
18
|
+
* Evaluated in the vertex stage (constant per leaf) and passed on as varyings.
|
|
19
|
+
*
|
|
20
|
+
* `season` is the Season input: a new uniform by default, or any float node (a Forest passes its
|
|
21
|
+
* per-instance Season attribute).
|
|
22
|
+
*/
|
|
23
|
+
export declare function createSeasonNodes(profile: SeasonProfileDefinition): SeasonNodes;
|
|
24
|
+
export declare function createSeasonNodes<S extends FloatNode<'float'>>(profile: SeasonProfileDefinition, season: S): SeasonNodes<S>;
|
|
25
|
+
/**
|
|
26
|
+
* Hooks Season into a leaf material: `colorNode` (times the vertex-colour tint, and times the
|
|
27
|
+
* material's existing `colorNode`, such as a leaf card texture with alpha) and `maskNode`, which
|
|
28
|
+
* also cuts fallen leaves out of the shadow pass.
|
|
29
|
+
*/
|
|
30
|
+
export declare function applySeasonToLeafMaterial(material: NodeMaterial, nodes: Pick<SeasonNodes, 'color' | 'visible'>): void;
|
|
31
|
+
export {};
|
|
32
|
+
//# sourceMappingURL=nodes.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"nodes.d.ts","sourceRoot":"","sources":["../../src/season/nodes.ts"],"names":[],"mappings":"AAAA,OAAO,EAAS,KAAK,IAAI,IAAI,SAAS,EAAE,KAAK,YAAY,EAAE,KAAK,WAAW,EAAE,MAAM,cAAc,CAAC;AAElG,OAAO,KAAK,EAAY,uBAAuB,EAAE,MAAM,eAAe,CAAC;AAGvE,gDAAgD;AAChD,MAAM,MAAM,aAAa,GAAG,WAAW,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;AAIzD,KAAK,IAAI,GAAG,GAAG,CAAC;AAkBhB,kGAAkG;AAClG,MAAM,WAAW,WAAW,CAAC,CAAC,SAAS,SAAS,CAAC,OAAO,CAAC,GAAG,aAAa;IACvE,kHAAkH;IAClH,MAAM,EAAE,CAAC,CAAC;IACV,qGAAqG;IACrG,KAAK,EAAE,IAAI,CAAC;IACZ,4FAA4F;IAC5F,OAAO,EAAE,IAAI,CAAC;CACf;AAED;;;;;;;GAOG;AACH,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,uBAAuB,GAAG,WAAW,CAAC;AACjF,wBAAgB,iBAAiB,CAAC,CAAC,SAAS,SAAS,CAAC,OAAO,CAAC,EAAE,OAAO,EAAE,uBAAuB,EAAE,MAAM,EAAE,CAAC,GAAG,WAAW,CAAC,CAAC,CAAC,CAAC;AAoB7H;;;;GAIG;AACH,wBAAgB,yBAAyB,CAAC,QAAQ,EAAE,YAAY,EAAE,KAAK,EAAE,IAAI,CAAC,WAAW,EAAE,OAAO,GAAG,SAAS,CAAC,GAAG,IAAI,CAGrH"}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import type { HexColor, Keyframe, SeasonProfileDefinition, VariationDefinition } from '../definition';
|
|
2
|
+
/**
|
|
3
|
+
* Pure JS evaluator of the Season Profile: the CPU twin of the TSL nodes in `./nodes.ts`.
|
|
4
|
+
* No three.js, Node-safe. The Baked Tree export uses it to bake Season into geometry and
|
|
5
|
+
* colours; the shader evaluates exactly the same maths per leaf.
|
|
6
|
+
*/
|
|
7
|
+
/** Linear RGB, 0..1 per channel. */
|
|
8
|
+
export type RGB = [number, number, number];
|
|
9
|
+
/** Smallest keyframe span used as a divisor (two keys at the same `t` make a step). */
|
|
10
|
+
export declare const KEYFRAME_EPSILON = 0.00001;
|
|
11
|
+
/** Interpolation weight of the segment `t0..t1` at `s` (0 before, 1 after). */
|
|
12
|
+
export declare function segmentWeight(s: number, t0: number, t1: number): number;
|
|
13
|
+
/**
|
|
14
|
+
* Samples a keyframe track at Season `s`: linear between keys, holding the first value
|
|
15
|
+
* before the first key and the last value after the last one. Computed as a chain of
|
|
16
|
+
* mixes (one per segment), the same chain the shader runs.
|
|
17
|
+
*/
|
|
18
|
+
export declare function sampleTrack<V extends number | number[]>(track: readonly Keyframe<V>[], s: number): V;
|
|
19
|
+
/** Brings any Season into 0..1: values inside 0..1 (including 1, the last day of winter) are kept, others wrap around the year. */
|
|
20
|
+
export declare function wrapSeason(s: number): number;
|
|
21
|
+
/** sRGB transfer curve -> linear, per channel (as three.js `SRGBToLinear`). */
|
|
22
|
+
export declare function srgbToLinear(c: number): number;
|
|
23
|
+
/** `#rrggbb` -> linear RGB. */
|
|
24
|
+
export declare function hexToLinear(hex: HexColor): RGB;
|
|
25
|
+
/** The Season Profile's values at one Season. Colours are linear RGB. */
|
|
26
|
+
export interface SeasonState {
|
|
27
|
+
/** The Season the tracks were sampled at (after shift and wrap). */
|
|
28
|
+
season: number;
|
|
29
|
+
leafColor: RGB;
|
|
30
|
+
/** 0 = bare .. 1 = full. */
|
|
31
|
+
leafCoverage: number;
|
|
32
|
+
/** 0 = none .. 1 = full bloom. */
|
|
33
|
+
blossom: number;
|
|
34
|
+
blossomColor: RGB;
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Evaluates the Season Profile at `season`, shifted by `shift` (a Seed's timing offset,
|
|
38
|
+
* see {@link seasonShift}) and wrapped around the year.
|
|
39
|
+
*/
|
|
40
|
+
export declare function evaluateSeason(profile: SeasonProfileDefinition, season: number, shift?: number): SeasonState;
|
|
41
|
+
/**
|
|
42
|
+
* One part's Season timing: the `aSeason` vertex attribute (vec3: x, y, z) with names.
|
|
43
|
+
* Wood has the tree's shift and zero ranks.
|
|
44
|
+
*/
|
|
45
|
+
export interface PartSeason {
|
|
46
|
+
/** Timing shift (Season units) from the Seed: tree shift + per-leaf jitter, within ± `variation.season`. */
|
|
47
|
+
shift: number;
|
|
48
|
+
/** 0..1: the leaf shows while leaf coverage > this. */
|
|
49
|
+
coverageRank: number;
|
|
50
|
+
/** 0..1: the leaf is a blossom while blossom > this. */
|
|
51
|
+
blossomRank: number;
|
|
52
|
+
}
|
|
53
|
+
/** The {@link PartSeason} of vertex `vertex` in `aSeason` attribute data (3 floats per vertex). */
|
|
54
|
+
export declare function partSeasonAt(aSeason: ArrayLike<number>, vertex: number): PartSeason;
|
|
55
|
+
/**
|
|
56
|
+
* A Seed's Season timing shift for the whole tree: within ± half of `variation.season`.
|
|
57
|
+
* Per-leaf jitter ({@link leafSeasonAttribute}) takes the other half, so a leaf stays within the range.
|
|
58
|
+
*/
|
|
59
|
+
export declare function seasonShift(seed: number, variation: Pick<VariationDefinition, 'season'>): number;
|
|
60
|
+
/** The Season timing (`aSeason` attribute) of one leaf; see {@link PartSeason}. */
|
|
61
|
+
export declare function leafSeasonAttribute(seed: number, variation: Pick<VariationDefinition, 'season'>, leafId: string): PartSeason;
|
|
62
|
+
/** `aSeason` for wood vertices: the tree's timing shift, no ranks. */
|
|
63
|
+
export declare function woodSeasonAttribute(seed: number, variation: Pick<VariationDefinition, 'season'>): PartSeason;
|
|
64
|
+
/** One leaf at one Season. */
|
|
65
|
+
export interface LeafSeasonState {
|
|
66
|
+
/** False when the leaf has fallen (or not yet grown) and is not a blossom. */
|
|
67
|
+
visible: boolean;
|
|
68
|
+
/** True when the leaf shows as a blossom. */
|
|
69
|
+
blossom: boolean;
|
|
70
|
+
/** Linear RGB before the Seed's per-leaf tint (vertex colour) is multiplied in. */
|
|
71
|
+
color: RGB;
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* Evaluates one leaf from its Season timing (`aSeason` attribute, see {@link partSeasonAt}): the
|
|
75
|
+
* exact CPU twin of the leaf shader (see `createSeasonNodes`). Use it to bake a tree at a Season.
|
|
76
|
+
*/
|
|
77
|
+
export declare function leafSeason(profile: SeasonProfileDefinition, season: number, part: PartSeason): LeafSeasonState;
|
|
78
|
+
//# sourceMappingURL=profile.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"profile.d.ts","sourceRoot":"","sources":["../../src/season/profile.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,QAAQ,EAAE,uBAAuB,EAAE,mBAAmB,EAAE,MAAM,eAAe,CAAC;AAItG;;;;GAIG;AAEH,oCAAoC;AACpC,MAAM,MAAM,GAAG,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;AAE3C,uFAAuF;AACvF,eAAO,MAAM,gBAAgB,UAAO,CAAC;AAErC,+EAA+E;AAC/E,wBAAgB,aAAa,CAAC,CAAC,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,GAAG,MAAM,CAEvE;AAOD;;;;GAIG;AACH,wBAAgB,WAAW,CAAC,CAAC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I,CAAC,mBAAmB,EAAE,QAAQ,CAAC,EAC9C,MAAM,EAAE,MAAM,GACb,UAAU,CAOZ;AAED,sEAAsE;AACtE,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,IAAI,CAAC,mBAAmB,EAAE,QAAQ,CAAC,GAAG,UAAU,CAE5G;AAED,8BAA8B;AAC9B,MAAM,WAAW,eAAe;IAC9B,8EAA8E;IAC9E,OAAO,EAAE,OAAO,CAAC;IACjB,6CAA6C;IAC7C,OAAO,EAAE,OAAO,CAAC;IACjB,mFAAmF;IACnF,KAAK,EAAE,GAAG,CAAC;CACZ;AAED;;;GAGG;AACH,wBAAgB,UAAU,CAAC,OAAO,EAAE,uBAAuB,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,UAAU,GAAG,eAAe,CAQ9G"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Ready-made Season Profiles for the Styles (Season: 0 spring, 0.25 summer, 0.5 autumn,
|
|
3
|
+
* 0.75 winter, 1 last day of winter).
|
|
4
|
+
* - `deciduous`: broadleaf; fresh green in spring, deep green in summer, orange and red in
|
|
5
|
+
* autumn while the leaves fall, bare in winter, buds return at the very end of winter.
|
|
6
|
+
* - `evergreen`: conifer; full all year, only darkens a little in winter.
|
|
7
|
+
*/
|
|
8
|
+
export declare const SEASON_PROFILES: {
|
|
9
|
+
deciduous: {
|
|
10
|
+
leafColor: {
|
|
11
|
+
t: number;
|
|
12
|
+
value: string;
|
|
13
|
+
}[];
|
|
14
|
+
leafCoverage: {
|
|
15
|
+
t: number;
|
|
16
|
+
value: number;
|
|
17
|
+
}[];
|
|
18
|
+
blossom: {
|
|
19
|
+
t: number;
|
|
20
|
+
value: number;
|
|
21
|
+
}[];
|
|
22
|
+
blossomColor: string;
|
|
23
|
+
};
|
|
24
|
+
evergreen: {
|
|
25
|
+
leafColor: {
|
|
26
|
+
t: number;
|
|
27
|
+
value: string;
|
|
28
|
+
}[];
|
|
29
|
+
leafCoverage: {
|
|
30
|
+
t: number;
|
|
31
|
+
value: number;
|
|
32
|
+
}[];
|
|
33
|
+
blossom: {
|
|
34
|
+
t: number;
|
|
35
|
+
value: number;
|
|
36
|
+
}[];
|
|
37
|
+
blossomColor: string;
|
|
38
|
+
};
|
|
39
|
+
};
|
|
40
|
+
//# sourceMappingURL=profiles.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"profiles.d.ts","sourceRoot":"","sources":["../../src/season/profiles.ts"],"names":[],"mappings":"AAEA;;;;;;GAMG;AACH,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAmCuB,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { type TreeDefinition } from '../../definition/types';
|
|
2
|
+
import type { TreeStyle } from '../types';
|
|
3
|
+
/**
|
|
4
|
+
* Low-poly broadleaf: a short, stout trunk and a few branches, crowned by faceted foliage
|
|
5
|
+
* clumps. Deciduous Season Profile: fresh green in spring, autumn colours, bare in winter.
|
|
6
|
+
*/
|
|
7
|
+
export declare const broadleaf: TreeDefinition;
|
|
8
|
+
/**
|
|
9
|
+
* Low-poly conifer: a straight trunk with drooping whorls that shrink towards the top
|
|
10
|
+
* (the conifer Form), covered in faceted needle tufts. Evergreen Season Profile: it only darkens a little in winter.
|
|
11
|
+
*/
|
|
12
|
+
export declare const conifer: TreeDefinition;
|
|
13
|
+
/** The low-poly Style. */
|
|
14
|
+
declare const lowPoly: TreeStyle;
|
|
15
|
+
export default lowPoly;
|
|
16
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/styles/low-poly/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAA0B,KAAK,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAErF,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAE1C;;;GAGG;AACH,eAAO,MAAM,SAAS,EAAE,cAmBvB,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,OAAO,EAAE,cAkBrB,CAAC;AAEF,0BAA0B;AAC1B,QAAA,MAAM,OAAO,EAAE,SAAoD,CAAC;AACpE,eAAe,OAAO,CAAC"}
|
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
import "../types-BZjHhNz7.js";
|
|
2
|
+
import { t as SEASON_PROFILES } from "../profiles-BAiyeFlh.js";
|
|
3
|
+
// src/styles/low-poly/index.ts
|
|
4
|
+
/**
|
|
5
|
+
* Low-poly broadleaf: a short, stout trunk and a few branches, crowned by faceted foliage
|
|
6
|
+
* clumps. Deciduous Season Profile: fresh green in spring, autumn colours, bare in winter.
|
|
7
|
+
*/
|
|
8
|
+
var broadleaf = {
|
|
9
|
+
schemaVersion: 2,
|
|
10
|
+
name: "Low-poly broadleaf",
|
|
11
|
+
form: "broadleaf",
|
|
12
|
+
trunk: {
|
|
13
|
+
length: 3,
|
|
14
|
+
radius: .22,
|
|
15
|
+
taper: .5,
|
|
16
|
+
sides: 5,
|
|
17
|
+
sections: 3,
|
|
18
|
+
lengthVariation: .15,
|
|
19
|
+
bend: .12
|
|
20
|
+
},
|
|
21
|
+
branches: [{
|
|
22
|
+
count: 5,
|
|
23
|
+
start: .5,
|
|
24
|
+
end: .92,
|
|
25
|
+
angle: 42,
|
|
26
|
+
angleVariation: .2,
|
|
27
|
+
spiral: 137.5,
|
|
28
|
+
length: .5,
|
|
29
|
+
lengthVariation: .2,
|
|
30
|
+
radius: .55,
|
|
31
|
+
taper: .45,
|
|
32
|
+
sides: 4,
|
|
33
|
+
sections: 2,
|
|
34
|
+
bend: .12,
|
|
35
|
+
gravity: .15
|
|
36
|
+
}, {
|
|
37
|
+
count: 3,
|
|
38
|
+
start: .35,
|
|
39
|
+
end: 1,
|
|
40
|
+
angle: 38,
|
|
41
|
+
angleVariation: .25,
|
|
42
|
+
spiral: 120,
|
|
43
|
+
length: .55,
|
|
44
|
+
lengthVariation: .25,
|
|
45
|
+
radius: .6,
|
|
46
|
+
taper: .4,
|
|
47
|
+
sides: 3,
|
|
48
|
+
sections: 1,
|
|
49
|
+
bend: .1,
|
|
50
|
+
gravity: .1
|
|
51
|
+
}],
|
|
52
|
+
leaves: {
|
|
53
|
+
count: 2,
|
|
54
|
+
shape: "clump",
|
|
55
|
+
size: 1,
|
|
56
|
+
sizeVariation: .25,
|
|
57
|
+
start: .55,
|
|
58
|
+
angle: 25
|
|
59
|
+
},
|
|
60
|
+
materials: {
|
|
61
|
+
shading: "flat",
|
|
62
|
+
bark: {
|
|
63
|
+
color: "#7a5233",
|
|
64
|
+
roughness: 1,
|
|
65
|
+
map: null,
|
|
66
|
+
normalMap: null
|
|
67
|
+
},
|
|
68
|
+
leaf: {
|
|
69
|
+
roughness: 1,
|
|
70
|
+
map: null,
|
|
71
|
+
alphaTest: .5
|
|
72
|
+
}
|
|
73
|
+
},
|
|
74
|
+
season: SEASON_PROFILES.deciduous,
|
|
75
|
+
wind: {
|
|
76
|
+
trunk: .15,
|
|
77
|
+
branches: .4,
|
|
78
|
+
leaves: .5,
|
|
79
|
+
frequency: 1
|
|
80
|
+
},
|
|
81
|
+
variation: {
|
|
82
|
+
color: .12,
|
|
83
|
+
growth: .1,
|
|
84
|
+
season: .05
|
|
85
|
+
},
|
|
86
|
+
sculpts: []
|
|
87
|
+
};
|
|
88
|
+
/**
|
|
89
|
+
* Low-poly conifer: a straight trunk with drooping whorls that shrink towards the top
|
|
90
|
+
* (the conifer Form), covered in faceted needle tufts. Evergreen Season Profile: it only darkens a little in winter.
|
|
91
|
+
*/
|
|
92
|
+
var conifer = {
|
|
93
|
+
schemaVersion: 2,
|
|
94
|
+
name: "Low-poly conifer",
|
|
95
|
+
form: "conifer",
|
|
96
|
+
trunk: {
|
|
97
|
+
length: 5,
|
|
98
|
+
radius: .2,
|
|
99
|
+
taper: .15,
|
|
100
|
+
sides: 5,
|
|
101
|
+
sections: 4,
|
|
102
|
+
lengthVariation: .15,
|
|
103
|
+
bend: .03
|
|
104
|
+
},
|
|
105
|
+
branches: [{
|
|
106
|
+
count: 24,
|
|
107
|
+
start: .18,
|
|
108
|
+
end: .97,
|
|
109
|
+
angle: 95,
|
|
110
|
+
angleVariation: .08,
|
|
111
|
+
spiral: 137.5,
|
|
112
|
+
length: .42,
|
|
113
|
+
lengthVariation: .15,
|
|
114
|
+
radius: .4,
|
|
115
|
+
taper: .3,
|
|
116
|
+
sides: 3,
|
|
117
|
+
sections: 2,
|
|
118
|
+
bend: .05,
|
|
119
|
+
gravity: -.08
|
|
120
|
+
}],
|
|
121
|
+
leaves: {
|
|
122
|
+
count: 7,
|
|
123
|
+
shape: "needle",
|
|
124
|
+
size: .65,
|
|
125
|
+
sizeVariation: .2,
|
|
126
|
+
start: 0,
|
|
127
|
+
angle: 35
|
|
128
|
+
},
|
|
129
|
+
materials: {
|
|
130
|
+
shading: "flat",
|
|
131
|
+
bark: {
|
|
132
|
+
color: "#5c4030",
|
|
133
|
+
roughness: 1,
|
|
134
|
+
map: null,
|
|
135
|
+
normalMap: null
|
|
136
|
+
},
|
|
137
|
+
leaf: {
|
|
138
|
+
roughness: 1,
|
|
139
|
+
map: null,
|
|
140
|
+
alphaTest: .5
|
|
141
|
+
}
|
|
142
|
+
},
|
|
143
|
+
season: SEASON_PROFILES.evergreen,
|
|
144
|
+
wind: {
|
|
145
|
+
trunk: .1,
|
|
146
|
+
branches: .3,
|
|
147
|
+
leaves: .3,
|
|
148
|
+
frequency: .8
|
|
149
|
+
},
|
|
150
|
+
variation: {
|
|
151
|
+
color: .08,
|
|
152
|
+
growth: .1,
|
|
153
|
+
season: .05
|
|
154
|
+
},
|
|
155
|
+
sculpts: []
|
|
156
|
+
};
|
|
157
|
+
/** The low-poly Style. */
|
|
158
|
+
var lowPoly = {
|
|
159
|
+
name: "low-poly",
|
|
160
|
+
broadleaf,
|
|
161
|
+
conifer
|
|
162
|
+
};
|
|
163
|
+
export { broadleaf, conifer, lowPoly as default };
|
|
164
|
+
|
|
165
|
+
//# sourceMappingURL=low-poly.js.map
|