webgpu-grass 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.
Files changed (51) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +647 -2
  3. package/lib/distance.d.ts +48 -0
  4. package/lib/distance.d.ts.map +1 -0
  5. package/lib/distance.js +134 -0
  6. package/lib/distance.js.map +1 -0
  7. package/lib/engine.d.ts +402 -0
  8. package/lib/engine.d.ts.map +1 -0
  9. package/lib/engine.js +3247 -0
  10. package/lib/engine.js.map +1 -0
  11. package/lib/field.d.ts +133 -0
  12. package/lib/field.d.ts.map +1 -0
  13. package/lib/field.js +244 -0
  14. package/lib/field.js.map +1 -0
  15. package/lib/flowers.d.ts +138 -0
  16. package/lib/flowers.d.ts.map +1 -0
  17. package/lib/flowers.js +117 -0
  18. package/lib/flowers.js.map +1 -0
  19. package/lib/index.d.ts +11 -0
  20. package/lib/index.d.ts.map +1 -0
  21. package/lib/index.js +14 -0
  22. package/lib/index.js.map +1 -0
  23. package/lib/mix.d.ts +17 -0
  24. package/lib/mix.d.ts.map +1 -0
  25. package/lib/mix.js +95 -0
  26. package/lib/mix.js.map +1 -0
  27. package/lib/mixshare.d.ts +42 -0
  28. package/lib/mixshare.d.ts.map +1 -0
  29. package/lib/mixshare.js +144 -0
  30. package/lib/mixshare.js.map +1 -0
  31. package/lib/noise.d.ts +4 -0
  32. package/lib/noise.d.ts.map +1 -0
  33. package/lib/noise.js +49 -0
  34. package/lib/noise.js.map +1 -0
  35. package/lib/placement.d.ts +39 -0
  36. package/lib/placement.d.ts.map +1 -0
  37. package/lib/placement.js +67 -0
  38. package/lib/placement.js.map +1 -0
  39. package/lib/rank.d.ts +36 -0
  40. package/lib/rank.d.ts.map +1 -0
  41. package/lib/rank.js +158 -0
  42. package/lib/rank.js.map +1 -0
  43. package/lib/species.d.ts +408 -0
  44. package/lib/species.d.ts.map +1 -0
  45. package/lib/species.js +672 -0
  46. package/lib/species.js.map +1 -0
  47. package/lib/transitions.d.ts +72 -0
  48. package/lib/transitions.d.ts.map +1 -0
  49. package/lib/transitions.js +123 -0
  50. package/lib/transitions.js.map +1 -0
  51. package/package.json +60 -3
package/lib/species.js ADDED
@@ -0,0 +1,672 @@
1
+ // A species: what one kind of grass is. Its shape and behaviour, as plain
2
+ // data, so a stand of grass is described and not programmed.
3
+ //
4
+ // Everything here is read by the shaders from one table (`packSpecies`), a
5
+ // row to a species. Adding a species adds a row; nothing in the shaders
6
+ // names one.
7
+ import * as THREE from "three/webgpu";
8
+ import { MAX_BLOOMS } from "./flowers.js";
9
+ /** Rows in the table. A map's species numbers are below this; `NO_GRASS` is not. */
10
+ export const MAX_SPECIES = 16;
11
+ export const SPECIES_SLOTS = 20;
12
+ const TIP_CODE = { point: 0, cut: 1, square: 2 };
13
+ /** One uniform-array entry to a slot, a row to a species: made once, then written into by `packSpecies`. */
14
+ export function makeSpeciesTable() {
15
+ return Array.from({ length: MAX_SPECIES * SPECIES_SLOTS }, () => new THREE.Vector4());
16
+ }
17
+ /**
18
+ * Write the species into the table the shaders read. The slots:
19
+ *
20
+ * 0 height, heightSpread, density, tufted
21
+ * 1 width, widthSpread, splay, droop
22
+ * 2 tip (0 point, 1 cut, 2 square), twist, seedHead, stiffness
23
+ * 3 clump, disorder, rootShade, variation
24
+ * 4 colour (linear r, g, b), sheen
25
+ * 5 tipTint r, g, b, dry
26
+ * 6 seedTint r, g, b, lay
27
+ * 7 the picture's layer (-1 for none), its strength, its mode (0 detail, 1 colour), cut-out
28
+ * 8 the ground's picture: how much shows (0 if it has none), its tile (m)
29
+ * (and in z, w: patchSize, patchTall)
30
+ * 9 the ground's picture's own mean colour (linear r, g, b), patches are colonies (0), blotches (1) or runners (2)
31
+ * 10 patchTint r, g, b, patch
32
+ * 11 patchSite, edgeBlend, cutTip, seedShare
33
+ * 12 tussock, stem, flower, clumpScale
34
+ * 13 its flowers (`blooms`, four to a slot from here): their rows in the flower table (-1 for none)
35
+ * 14 flowers to the square metre
36
+ * 15 the share of ground
37
+ * 16 where they take (-1 hollows .. 1 crowns)
38
+ * 17 where: 0 in drifts, 1 only in the species' patches, 2 in drifts on its tussocks
39
+ * 18 mosaic, mosaicSize, patchEdge, scorch
40
+ * 19 soil r, g, b
41
+ *
42
+ * `layers` gives each picture's name its layer in the leaf texture, `flowerAt` each flower's name its
43
+ * row in the flower table (`packFlowers`).
44
+ */
45
+ export function packSpecies(list, table, layers = new Map(), ground = [], flowerAt = new Map()) {
46
+ if (list.length > MAX_SPECIES)
47
+ throw new Error(`At most ${MAX_SPECIES} species, got ${list.length}`);
48
+ const c = new THREE.Color();
49
+ for (let k = 0; k < MAX_SPECIES; k++) {
50
+ const s = list[k];
51
+ const row = k * SPECIES_SLOTS;
52
+ if (!s) {
53
+ for (let i = 0; i < SPECIES_SLOTS; i++)
54
+ table[row + i].set(0, 0, 0, 0);
55
+ continue;
56
+ }
57
+ c.set(s.color);
58
+ table[row].set(s.height, s.heightSpread, s.density, s.tufted ? 1 : 0);
59
+ table[row + 1].set(s.width, s.widthSpread, s.splay, s.droop);
60
+ table[row + 2].set(TIP_CODE[s.tip], s.twist, s.seedHead, s.stiffness);
61
+ table[row + 3].set(s.clump, s.disorder, s.rootShade, s.variation);
62
+ table[row + 4].set(c.r, c.g, c.b, s.sheen);
63
+ table[row + 5].set(s.tipTint[0], s.tipTint[1], s.tipTint[2], s.dry);
64
+ table[row + 6].set(s.seedTint[0], s.seedTint[1], s.seedTint[2], s.lay);
65
+ const layer = layers.get(s.leafTexture) ?? -1;
66
+ table[row + 7].set(layer, layer < 0 ? 0 : s.textureStrength, s.textureMode === "color" ? 1 : 0, layer >= 0 && s.textureCutout ? 1 : 0);
67
+ const under = ground[k] ?? null;
68
+ table[row + 8].set(under ? s.groundDetail : 0, Math.max(0.05, s.groundTile), Math.max(0.02, s.patchSize), s.patchTall);
69
+ table[row + 11].set(Math.min(1, Math.max(-1, s.patchSite)), Math.max(0, s.edgeBlend), Math.min(1, Math.max(0, s.cutTip)), Math.min(1, Math.max(0, s.seedShare ?? 1)));
70
+ const ids = [-1, -1, -1, -1];
71
+ const perM2 = [0, 0, 0, 0];
72
+ const cover = [0, 0, 0, 0];
73
+ const site = [0, 0, 0, 0];
74
+ const inPatches = [0, 0, 0, 0];
75
+ (s.blooms ?? []).slice(0, MAX_BLOOMS).forEach((b, j) => {
76
+ const at = flowerAt.get(b.flower);
77
+ if (at === undefined || !(b.perM2 > 0))
78
+ return;
79
+ ids[j] = at;
80
+ perM2[j] = b.perM2;
81
+ cover[j] = Math.min(1, Math.max(0, b.cover));
82
+ site[j] = Math.min(1, Math.max(-1, b.site ?? 0));
83
+ inPatches[j] = b.where === "patches" ? 1 : b.where === "tussocks" ? 2 : 0;
84
+ });
85
+ table[row + 13].set(ids[0], ids[1], ids[2], ids[3]);
86
+ table[row + 14].set(perM2[0], perM2[1], perM2[2], perM2[3]);
87
+ table[row + 15].set(cover[0], cover[1], cover[2], cover[3]);
88
+ table[row + 16].set(site[0], site[1], site[2], site[3]);
89
+ table[row + 17].set(inPatches[0], inPatches[1], inPatches[2], inPatches[3]);
90
+ const soil = s.soil ?? [1, 1, 1];
91
+ table[row + 19].set(Math.max(0, soil[0]), Math.max(0, soil[1]), Math.max(0, soil[2]), 0);
92
+ table[row + 18].set(Math.min(0.3, Math.max(0, s.mosaic ?? 0)), Math.max(0.1, s.mosaicSize ?? 0.9), Math.min(1, Math.max(-1, s.patchEdge ?? 0)), Math.min(1, Math.max(0, s.scorch ?? 0)));
93
+ table[row + 12].set(Math.min(1, Math.max(0, s.tussock)), Math.min(1, Math.max(0, s.stem)), Math.min(1, Math.max(0, s.flower)), Math.min(4, Math.max(0.25, s.clumpScale ?? 1)));
94
+ table[row + 10].set(s.patchTint[0], s.patchTint[1], s.patchTint[2], Math.min(1, Math.max(0, s.patch)));
95
+ table[row + 9].set(under?.mean[0] ?? 1, under?.mean[1] ?? 1, under?.mean[2] ?? 1, s.patchKind === "blotches" ? 1 : s.patchKind === "runners" ? 2 : 0);
96
+ }
97
+ }
98
+ /** A plain leaf: what a species written before leaves had pictures is given. */
99
+ const NO_TEXTURE = { leafTexture: "", textureMode: "detail", textureStrength: 1, textureCutout: false };
100
+ /** What a species written before these were settings is given: a plain leaf, standing as it grew. */
101
+ const NO_PATCHES = { tussock: 0, stem: 0, flower: 0, seedShare: 1, clumpScale: 1, blooms: [], cutTip: 0, edgeBlend: 0, patchKind: "colonies", patchSite: 0, patch: 0, patchSize: 0.4, patchTint: [1.1, 1.12, 0.88], patchTall: 1 };
102
+ const ADDED_LATER = { ...NO_TEXTURE, ...NO_PATCHES, lay: 0, groundDetail: 1, groundTile: 0.6 };
103
+ /**
104
+ * Six stands to start from, short to tall. They are the surfaces of a golf
105
+ * course as Couch Golf Club draws them, turned into rows, with a hay meadow
106
+ * added to show the range. They are starting points for the lab, not
107
+ * botany: no row here has been set against a photograph of a named grass.
108
+ * Their leaves are a real leaf's breadth, 2 to 5 mm (the game drew few
109
+ * leaves and made them several times that), which they can be because the
110
+ * ground under them carries what leaves cannot be drawn.
111
+ */
112
+ export const STARTER_SPECIES = [
113
+ {
114
+ name: "Close-mown turf",
115
+ height: 0.0085, heightSpread: 0.1, density: 1, tufted: false,
116
+ width: 0.0018, widthSpread: 0.0008, tip: "square", splay: 0.3, droop: 0.3, twist: 0, seedHead: 0,
117
+ stiffness: 1, clump: 0, disorder: 0.3,
118
+ color: "#5a9a3c", tipTint: [1.06, 1.06, 0.96], seedTint: [1, 1, 1], rootShade: 0.72, variation: 0.2, dry: 0.01, sheen: 0,
119
+ ...NO_TEXTURE,
120
+ ...NO_PATCHES,
121
+ groundDetail: 1,
122
+ groundTile: 0.6,
123
+ lay: 1,
124
+ },
125
+ {
126
+ name: "Mown sward",
127
+ height: 0.03, heightSpread: 0.16, density: 1, tufted: false,
128
+ width: 0.0022, widthSpread: 0.001, tip: "cut", splay: 1, droop: 1, twist: 1, seedHead: 0,
129
+ stiffness: 1, clump: 0, disorder: 0.4,
130
+ color: "#4f8d38", tipTint: [1.07, 1.06, 0.94], seedTint: [1, 1, 1], rootShade: 0.66, variation: 0.22, dry: 0.02, sheen: 0.4,
131
+ ...NO_TEXTURE,
132
+ ...NO_PATCHES,
133
+ groundDetail: 1,
134
+ groundTile: 0.6,
135
+ lay: 0.5,
136
+ },
137
+ {
138
+ name: "Rough",
139
+ height: 0.06, heightSpread: 0.4, density: 1, tufted: true,
140
+ width: 0.003, widthSpread: 0.002, tip: "point", splay: 1, droop: 1, twist: 1, seedHead: 0,
141
+ stiffness: 0.75, clump: 1, disorder: 1,
142
+ color: "#447a33", tipTint: [1.12, 1.08, 0.86], seedTint: [1, 1, 1], rootShade: 0.55, variation: 0.24, dry: 0.035, sheen: 1,
143
+ ...NO_TEXTURE,
144
+ ...NO_PATCHES,
145
+ groundDetail: 1,
146
+ groundTile: 0.6,
147
+ lay: 0,
148
+ },
149
+ {
150
+ name: "Deep rough",
151
+ height: 0.1, heightSpread: 0.4, density: 1, tufted: true,
152
+ width: 0.0035, widthSpread: 0.0025, tip: "point", splay: 1, droop: 1, twist: 1, seedHead: 0,
153
+ stiffness: 0.4, clump: 1, disorder: 1,
154
+ color: "#3a6a2e", tipTint: [1.12, 1.08, 0.86], seedTint: [1, 1, 1], rootShade: 0.45, variation: 0.24, dry: 0.05, sheen: 1,
155
+ ...NO_TEXTURE,
156
+ ...NO_PATCHES,
157
+ groundDetail: 1,
158
+ groundTile: 0.6,
159
+ lay: 0,
160
+ },
161
+ {
162
+ name: "Fescue in seed",
163
+ height: 0.2, heightSpread: 0.9, density: 0.32, tufted: true,
164
+ width: 0.0016, widthSpread: 0.001, tip: "point", splay: 1, droop: 1, twist: 1, seedHead: 1,
165
+ stiffness: 0, clump: 1, disorder: 1,
166
+ color: "#9a9455", tipTint: [1.1, 1.08, 0.9], seedTint: [1.55, 1.34, 0.9], rootShade: 0.4, variation: 0.2, dry: 0.14, sheen: 0.6,
167
+ ...NO_TEXTURE,
168
+ ...NO_PATCHES,
169
+ groundDetail: 1,
170
+ groundTile: 0.6,
171
+ lay: 0,
172
+ },
173
+ {
174
+ name: "Hay meadow",
175
+ height: 0.45, heightSpread: 0.7, density: 0.6, tufted: true,
176
+ width: 0.005, widthSpread: 0.003, tip: "point", splay: 0.8, droop: 1.3, twist: 1, seedHead: 0.6,
177
+ stiffness: 0, clump: 0.7, disorder: 1,
178
+ color: "#63883a", tipTint: [1.12, 1.08, 0.86], seedTint: [1.5, 1.3, 0.95], rootShade: 0.35, variation: 0.26, dry: 0.08, sheen: 0.8,
179
+ ...NO_TEXTURE,
180
+ ...NO_PATCHES,
181
+ groundDetail: 1,
182
+ groundTile: 0.6,
183
+ lay: 0,
184
+ },
185
+ ];
186
+ /**
187
+ * A copy that shares nothing with the original, for the lab's editing and for presets, with what a species
188
+ * from an older preset has not got filled in. (A preset read from outside is read with `parseSpecies`.)
189
+ */
190
+ export function cloneSpecies(list) {
191
+ return list.map((given) => {
192
+ // (A setting given as undefined is one left out: it is filled in as one left out is, not copied over the fill.)
193
+ const s = Object.fromEntries(Object.entries(given).filter(([, v]) => v !== undefined));
194
+ // (A preset from when a species had one flower: `bloom`, `bloomPerM2`, `bloomCover`.)
195
+ const { bloom, bloomPerM2, bloomCover, ...rest } = s;
196
+ const blooms = s.blooms ? s.blooms.map((b) => ({ ...b })) : bloom && (bloomPerM2 ?? 0) > 0 ? [{ flower: bloom, perM2: bloomPerM2, cover: bloomCover ?? 0, site: 0, where: "drifts" }] : [];
197
+ return { ...ADDED_LATER, ...rest, blooms, tipTint: [...s.tipTint], seedTint: [...s.seedTint], patchTint: [...(s.patchTint ?? NO_PATCHES.patchTint)], ...(s.soil ? { soil: [...s.soil] } : {}) };
198
+ });
199
+ }
200
+ /**
201
+ * Every setting a species has, and what it must be. A preset's species is read by this and nothing else:
202
+ * a setting added to `Species` must be added here (the type says so), and to `ADDED_LATER` with what an
203
+ * older preset is given, or to `LEFT_OUT_IS_UNSET` if it may be left out.
204
+ */
205
+ const FIELDS = {
206
+ name: "string",
207
+ height: "number", heightSpread: "number", density: "number", tufted: "boolean",
208
+ width: "number", widthSpread: "number", tip: "tip", splay: "number", droop: "number", twist: "number",
209
+ seedHead: "number", seedShare: "number", stem: "number", flower: "number",
210
+ stiffness: "number", clump: "number", clumpScale: "number", tussock: "number", disorder: "number",
211
+ color: "hex", tipTint: "rgb", seedTint: "rgb", rootShade: "number", variation: "number", dry: "number", sheen: "number", lay: "number",
212
+ cutTip: "number", blooms: "blooms", edgeBlend: "number",
213
+ patchKind: "patchKind", patchSite: "number", patch: "number", patchSize: "number", patchTint: "rgb", patchTall: "number",
214
+ patchEdge: "number", mosaic: "number", mosaicSize: "number", soil: "rgb", scorch: "number",
215
+ groundDetail: "number", groundTile: "number",
216
+ leafTexture: "string", textureMode: "textureMode", textureStrength: "number", textureCutout: "boolean",
217
+ };
218
+ /** The settings a species may go without, and has no value for when it does (the shaders take their own: see `packSpecies`). */
219
+ const LEFT_OUT_IS_UNSET = new Set(["patchEdge", "mosaic", "mosaicSize", "soil", "scorch"]);
220
+ /** What a preset's one flower was before a species had a list of them (`cloneSpecies` turns it into `blooms`). */
221
+ const OLD_BLOOM = { bloom: "string", bloomPerM2: "number", bloomCover: "number" };
222
+ const isNumber = (v) => typeof v === "number" && Number.isFinite(v);
223
+ const describe = (v) => (v === null ? "null" : Array.isArray(v) ? `a list of ${v.length}` : typeof v === "string" ? JSON.stringify(v.length > 24 ? `${v.slice(0, 24)}...` : v) : typeof v === "number" ? String(v) : typeof v);
224
+ /** Why `value` cannot be a setting of this kind, or null if it can. */
225
+ const fieldProblem = (kind, v) => {
226
+ switch (kind) {
227
+ case "number":
228
+ return isNumber(v) ? null : `is not a number (got ${describe(v)})`;
229
+ case "boolean":
230
+ return typeof v === "boolean" ? null : `is not true or false (got ${describe(v)})`;
231
+ case "string":
232
+ return typeof v === "string" ? null : `is not text (got ${describe(v)})`;
233
+ case "rgb":
234
+ return Array.isArray(v) && v.length === 3 && v.every(isNumber) ? null : `is not 3 numbers (got ${describe(v)})`;
235
+ case "hex":
236
+ return typeof v === "string" && /^#[0-9a-f]{6}$/i.test(v) ? null : `is not a hex colour like #4f8d38 (got ${describe(v)})`;
237
+ case "tip":
238
+ return typeof v === "string" && Object.hasOwn(TIP_CODE, v) ? null : `is not point, cut or square (got ${describe(v)})`;
239
+ case "textureMode":
240
+ return v === "detail" || v === "color" ? null : `is not detail or color (got ${describe(v)})`;
241
+ case "patchKind":
242
+ return v === "colonies" || v === "runners" || v === "blotches" ? null : `is not colonies, runners or blotches (got ${describe(v)})`;
243
+ case "blooms": {
244
+ if (!Array.isArray(v) || v.length > MAX_BLOOMS)
245
+ return `is not a list of at most ${MAX_BLOOMS} (got ${describe(v)})`;
246
+ for (const [j, b] of v.entries()) {
247
+ if (typeof b !== "object" || b === null || Array.isArray(b))
248
+ return `${j} is not a flower`;
249
+ const r = b;
250
+ if (typeof r.flower !== "string")
251
+ return `${j}: flower is not a flower's name`;
252
+ for (const key of ["perM2", "cover", "site"])
253
+ if (!isNumber(r[key]))
254
+ return `${j}: ${key} is not a number (got ${describe(r[key])})`;
255
+ if (r.where !== "drifts" && r.where !== "patches" && r.where !== "tussocks")
256
+ return `${j}: where is not drifts, patches or tussocks`;
257
+ }
258
+ return null;
259
+ }
260
+ }
261
+ };
262
+ /**
263
+ * Read a parsed preset's species: each setting checked for what it must be (a setting an older preset has
264
+ * not got is filled in, as `cloneSpecies` does, and so is its one flower of before), or the reason they
265
+ * cannot be read. What this gives back is a copy that shares nothing with `value`.
266
+ */
267
+ export function parseSpecies(value) {
268
+ const fail = (error) => ({ species: null, error });
269
+ if (!Array.isArray(value) || value.length === 0)
270
+ return fail("not a list of species");
271
+ if (value.length > MAX_SPECIES)
272
+ return fail(`more than ${MAX_SPECIES} species`);
273
+ for (const [i, s] of value.entries()) {
274
+ if (typeof s !== "object" || s === null || Array.isArray(s))
275
+ return fail(`species ${i} is not an object`);
276
+ const row = s;
277
+ const named = typeof row.name === "string" ? ` (${row.name})` : "";
278
+ for (const [key, kind] of Object.entries(FIELDS)) {
279
+ const has = Object.hasOwn(row, key) && row[key] !== undefined;
280
+ if (!has) {
281
+ // (A preset from before a setting was added has not got it: `cloneSpecies` fills it in.)
282
+ if (key in ADDED_LATER || LEFT_OUT_IS_UNSET.has(key))
283
+ continue;
284
+ return fail(`species ${i}${named}: ${key} is missing`);
285
+ }
286
+ const problem = fieldProblem(kind, row[key]);
287
+ if (problem)
288
+ return fail(`species ${i}${named}: ${key} ${problem}`);
289
+ }
290
+ for (const [key, kind] of Object.entries(OLD_BLOOM)) {
291
+ if (!Object.hasOwn(row, key) || row[key] === undefined)
292
+ continue;
293
+ const problem = fieldProblem(kind, row[key]);
294
+ if (problem)
295
+ return fail(`species ${i}${named}: ${key} ${problem}`);
296
+ }
297
+ }
298
+ return { species: cloneSpecies(value), error: null };
299
+ }
300
+ /** Whether a parsed preset is a list of species this version can draw; the reason if not. (`parseSpecies` reads it.) */
301
+ export function checkSpecies(value) {
302
+ return parseSpecies(value).error;
303
+ }
304
+ const turf = (name, from, set) => ({ ...STARTER_SPECIES[from], ...set, name });
305
+ /**
306
+ * A golf course's surfaces, short to tall, as eight named stands: the green, its collar, the fairway, the
307
+ * first cut, the rough, deep rough, and two that nobody mows. The heights are heights of cut in use (see
308
+ * the README for where each comes from). The leaf widths are set against the floras' (README, "Where
309
+ * the numbers come from"): a leaf grown out, creeping bent 0.5 to 5 mm, perennial rye 2 to 4, Kentucky
310
+ * bluegrass 1.7 to 5, red fescue 0.4 to 0.9 folded (Flora of Australia; Hitchcock has bent 1 to 8). A
311
+ * mown grass's leaves are at the narrow end of its range, and narrower than the same grass left to grow,
312
+ * so the mown ones here are: a rye leaf in a fairway is about 2 mm. The habit was set by eye: a likeness,
313
+ * not a measurement.
314
+ *
315
+ * The colours are a leaf's, worked out: what a leaf with so much chlorophyll sends back of sun and sky
316
+ * (PROSPECT-D, Feret et al. 2017), as linear sRGB, all at one brightness (2.2 times the leaf's own, which
317
+ * is what an exposure for grass comes to). A leaf sends back about half as much red as green and a
318
+ * quarter as much blue, whatever the grass: far more red than a green chosen by eye has. What differs
319
+ * from grass to grass is the chlorophyll in a square centimetre of leaf, and those figures are
320
+ * estimates, since nobody has published them species against species: bent 38 to 40 ug, rye 50 to 55,
321
+ * Kentucky bluegrass 60, bermuda 45, red fescue 42, a hay meadow 34, fescue gone to seed 24 with brown
322
+ * pigment in it, and annual meadow-grass 34 against the bent's 38 (the patches' tint). Fescue and Kentucky bluegrass
323
+ * carry a wax bloom the leaf model has none of: it sends back a little more of everything and most
324
+ * of the blue (1 to 2.5 parts in a hundred, an estimate), which is their grey-blue cast.
325
+ *
326
+ * The mown ones have mown edges (`edgeBlend` 0); deep rough, fescue and meadow run into their neighbours.
327
+ * In the order of the lab's plot.
328
+ */
329
+ export const TURF_SPECIES = [
330
+ turf("Green (creeping bent)", 0, { cutTip: 0.12,
331
+ height: 0.0032, heightSpread: 0.08, density: 2, width: 0.0009, widthSpread: 0.0003, tip: "cut",
332
+ splay: 0.25, droop: 0.2, stiffness: 1, disorder: 0.25, color: "#6b8d4c", tipTint: [1.03, 1.04, 0.98], rootShade: 0.8, variation: 0.13,
333
+ dry: 0.005, sheen: 0, lay: 1, groundTile: 0.35,
334
+ // (Annual meadow-grass in it, as nearly every bent green has within a few years. It gets in where the green
335
+ // stays wet, and from the collar inwards, and where the trees shade it: USGA, Green Section Record.)
336
+ patchSite: -0.7, patch: 0.16, patchSize: 0.5, patchTint: [1.12, 1.1, 0.98], patchTall: 1.06, patchEdge: 0.7,
337
+ // (A bent bred of a few parents grows into a quilt of its strains as the green ages: USGA, "Segregation
338
+ // in Bentgrass Greens". How unlike, by eye: two per cent or so; at five it read as camouflage. Its meadow-grass wilts first in a dry spell.)
339
+ mosaic: 0.022, mosaicSize: 1.4, scorch: 0.8,
340
+ }),
341
+ turf("Collar (creeping bent)", 0, { cutTip: 0.18,
342
+ height: 0.008, heightSpread: 0.1, density: 2, width: 0.0011, widthSpread: 0.0004, tip: "cut",
343
+ splay: 0.4, droop: 0.3, stiffness: 1, disorder: 0.3, color: "#688b4d", tipTint: [1.04, 1.05, 0.97], rootShade: 0.76, variation: 0.15,
344
+ dry: 0.005, sheen: 0, lay: 1, groundTile: 0.4,
345
+ patchSite: -0.7, patch: 0.12, patchSize: 0.5, patchTint: [1.12, 1.1, 0.98], patchTall: 1.06, patchEdge: 0.5,
346
+ // (The collar goes first in a dry spell: USGA.)
347
+ mosaic: 0.02, mosaicSize: 1.4, scorch: 1,
348
+ }),
349
+ turf("Fairway (perennial rye)", 1, { cutTip: 0.3,
350
+ height: 0.011, heightSpread: 0.12, density: 1.5, width: 0.0018, widthSpread: 0.0006, tip: "cut",
351
+ splay: 0.5, droop: 0.3, twist: 0.8, stiffness: 1, disorder: 0.4, color: "#60814e", tipTint: [1.06, 1.06, 0.97], rootShade: 0.68,
352
+ variation: 0.2, dry: 0.01, sheen: 1, lay: 0.85, groundTile: 0.5,
353
+ }),
354
+ turf("First cut (perennial rye)", 1, { cutTip: 0.5,
355
+ height: 0.032, heightSpread: 0.16, density: 1.6, width: 0.002, widthSpread: 0.0007, tip: "cut",
356
+ splay: 0.7, droop: 0.45, twist: 1, stiffness: 0.95, disorder: 0.45, color: "#62834e", tipTint: [1.06, 1.06, 0.96], rootShade: 0.36,
357
+ variation: 0.3, dry: 0.015, sheen: 1, lay: 0.5, groundTile: 0.6,
358
+ }),
359
+ // (Mown, as rough is on every course: a level top of cut ends, not a wild stand's own tips.)
360
+ turf("Rough (rye and bluegrass)", 2, { twist: 1.1, cutTip: 0.6,
361
+ height: 0.064, heightSpread: 0.3, density: 1.4, width: 0.0024, widthSpread: 0.0008, tip: "cut",
362
+ splay: 0.85, droop: 0.7, stiffness: 0.9, clump: 0.5, disorder: 0.6, color: "#5e7e4f", tipTint: [1.07, 1.07, 0.95], rootShade: 0.34,
363
+ variation: 0.3, dry: 0.02, sheen: 1,
364
+ // (Something low and dark among it: clover, where nobody sprays. It creeps by its runners.)
365
+ patchKind: "runners", patch: 0.08, patchSize: 0.66, patchTint: [0.72, 0.95, 0.72], patchTall: 0.7,
366
+ // (No flowers: a course keeps its mown rough clear of them. Where nobody does, daisies, clover, creeping
367
+ // buttercup and selfheal flower under a mower that passes every week or so: see `MORE_TURF.bluegrass`.)
368
+ }),
369
+ turf("Deep rough (red fescue)", 3, { twist: 0.6,
370
+ height: 0.125, heightSpread: 0.5, density: 1.4, width: 0.0006, widthSpread: 0.0003, tip: "point",
371
+ splay: 1.2, droop: 1.6, stiffness: 0.25, clump: 1, disorder: 1, color: "#789b64", tipTint: [1.12, 1.12, 0.88], rootShade: 0.5,
372
+ variation: 0.24, dry: 0.05, sheen: 0.5, edgeBlend: 0.4,
373
+ // (Cut a few times a year: cat's-ear and bird's-foot trefoil on the drier banks, ox-eye daisies, and
374
+ // creeping buttercup down in the wet hollows.)
375
+ blooms: [
376
+ { flower: "catsear", perM2: 8, cover: 0.12, site: 0.5, where: "drifts" },
377
+ { flower: "birdsfoot", perM2: 6, cover: 0.1, site: 0.7, where: "drifts" },
378
+ { flower: "oxeye", perM2: 5, cover: 0.1, site: 0, where: "drifts" },
379
+ { flower: "buttercup", perM2: 6, cover: 0.1, site: -0.8, where: "drifts" },
380
+ ],
381
+ }),
382
+ turf("Fescue in seed", 4, {
383
+ height: 0.3, heightSpread: 0.8, color: "#94a565", tipTint: [1.08, 1.08, 0.94], seedTint: [1.42, 1.38, 1.02], dry: 0.2, density: 0.75, edgeBlend: 1,
384
+ // (A fine fescue's leaf, folded: 0.4 to 0.9 mm across, as the floras have red fescue's, and a stand of it
385
+ // dense with them. Its culms in seed are 25 to 104 cm in Flora of Australia; the rough a course leaves
386
+ // stands lower, as the README says.)
387
+ width: 0.0006, widthSpread: 0.0003,
388
+ // (Not every stem in seed: in a mown mountain meadow 6 to 21 per cent of red fescue's shoots flowered,
389
+ // as the year went (Herben et al. 1993, Preslia), and a shoot is a few leaves to its one flowering stem.
390
+ // Left unmown it flowers more freely; a tenth of what is drawn, and that in patches.)
391
+ seedShare: 0.1,
392
+ // (Thin, dry, unmown ground: cat's-ear most, ox-eye daisies, harebells, yarrow.)
393
+ blooms: [
394
+ { flower: "catsear", perM2: 8, cover: 0.18, site: 0.6, where: "drifts" },
395
+ { flower: "oxeye", perM2: 6, cover: 0.15, site: 0, where: "drifts" },
396
+ { flower: "harebell", perM2: 5, cover: 0.12, site: 0.5, where: "drifts" },
397
+ { flower: "yarrow", perM2: 3, cover: 0.12, site: 0.3, where: "drifts" },
398
+ ],
399
+ }),
400
+ turf("Hay meadow", 5, { height: 0.6, edgeBlend: 1.2, color: "#76954b",
401
+ // (Buttercups, most in the damper ground; red clover; ox-eye daisies; knapweed.)
402
+ blooms: [
403
+ { flower: "buttercup", perM2: 10, cover: 0.2, site: -0.4, where: "drifts" },
404
+ { flower: "redClover", perM2: 8, cover: 0.15, site: 0, where: "drifts" },
405
+ { flower: "oxeye", perM2: 6, cover: 0.15, site: 0.3, where: "drifts" },
406
+ { flower: "knapweed", perM2: 4, cover: 0.12, site: 0, where: "drifts" },
407
+ ],
408
+ }),
409
+ ];
410
+ /** Two more, for a host or a scene to put in a row of its own: a warm-season fairway and a lawn. */
411
+ export const MORE_TURF = {
412
+ bermuda: turf("Fairway (bermuda)", 1, { cutTip: 0.3,
413
+ height: 0.011, heightSpread: 0.1, density: 1.8, width: 0.0013, widthSpread: 0.0004, tip: "point",
414
+ splay: 0.9, droop: 0.3, twist: 0.3, stiffness: 1, disorder: 0.45, color: "#67884d", tipTint: [1.1, 1.1, 0.9], rootShade: 0.62,
415
+ variation: 0.26, dry: 0.03, sheen: 0.5, lay: 0.7, groundTile: 0.5,
416
+ }),
417
+ bluegrass: turf("Lawn (Kentucky bluegrass)", 2, { cutTip: 0.55,
418
+ height: 0.06, heightSpread: 0.2, density: 1.3, tufted: false, width: 0.0024, widthSpread: 0.0008, tip: "cut",
419
+ splay: 0.8, droop: 0.9, stiffness: 0.85, clump: 0.3, disorder: 0.6, color: "#628061", tipTint: [1.08, 1.08, 0.96], rootShade: 0.55,
420
+ variation: 0.18, dry: 0.01, sheen: 0.5, lay: 0.4,
421
+ patchKind: "runners", patch: 0.12, patchSize: 0.66, patchTint: [0.68, 0.94, 0.7], patchTall: 0.7,
422
+ // (A lawn's: daisies, the clover's heads in its patches, slender speedwell.)
423
+ blooms: [
424
+ { flower: "daisy", perM2: 20, cover: 0.12, site: 0.2, where: "drifts" },
425
+ { flower: "clover", perM2: 20, cover: 0, site: 0, where: "patches" },
426
+ { flower: "speedwell", perM2: 14, cover: 0.08, site: -0.3, where: "drifts" },
427
+ ],
428
+ }),
429
+ };
430
+ /**
431
+ * What grows beside grass and is not one, for a host or a scene to put in a row of its own.
432
+ *
433
+ * Soft rush (Juncus effusus), a marsh's and a wet ditch's plant: no leaves, only round, smooth, glossy
434
+ * stems, 2 to 4 mm thick at the foot and tapering to a point, 30 cm to over a metre tall (Flora Iberica: stems
435
+ * 1 to 5 mm across, plants 25 to 128 cm), stiff and nearly straight, standing in dense tussocks that fan out from their middles, with the last years' dead stems
436
+ * straw-brown among the green (the floras: Stace; Clapham, Tutin and Moore). Its colour is a guess at a
437
+ * dark leaf's (65 ug of chlorophyll to the square centimetre): nobody has published a rush's. Its flowers
438
+ * are a brown tuft that sits on the side of a stem a hand below its tip, on a third of its stems.
439
+ */
440
+ export const MORE_PLANTS = {
441
+ rush: turf("Soft rush", 5, {
442
+ height: 0.75, heightSpread: 0.7, density: 1.3, tufted: true, width: 0.0034, widthSpread: 0.0012, tip: "point",
443
+ splay: 0.5, droop: 0, twist: 0, seedHead: 0, stiffness: 0.85, clump: 1, disorder: 0.5, tussock: 0.82, stem: 1, flower: 0.35,
444
+ color: "#5a7a48", tipTint: [1.12, 1.02, 0.78], rootShade: 0.4, variation: 0.26, dry: 0.2, sheen: 1, edgeBlend: 0.6,
445
+ }),
446
+ };
447
+ /**
448
+ * Grasses of other courses than the cool, wet parkland `TURF_SPECIES` are: a green gone over to annual
449
+ * meadow-grass, a warm coast's kikuyu, a links' fine fescue, and the dunes' marram.
450
+ *
451
+ * Their leaves are set against the floras (README, "Where the numbers come from"): annual meadow-grass 1
452
+ * to 5 mm grown out (Flora of Australia; Hitchcock 1 to 3), kikuyu 2 to 8 (Flora Iberica; 2 to 3.5 in
453
+ * Thailand), red fescue 0.4 to 0.9 folded, marram 1.5 to 4 rolled and 50 to 120 cm tall (Flora Iberica;
454
+ * Hitchcock 70 to 100 cm).
455
+ *
456
+ * Annual meadow-grass (Poa annua) takes over most old greens on wet or mild coasts (California's
457
+ * public courses, Pebble Beach, much of the Pacific north-west): a lighter, yellower green than bent
458
+ * (34 ug of chlorophyll against the bent's 38: the bent green's patch tint), a broader leaf (2 to 3 mm
459
+ * grown, 1 to 1.5 at a green's cut), and it seeds even at a green's height, which a putt feels as
460
+ * bumpiness: a scatter of small pale seed heads. Bent that is left in it is the darker patches.
461
+ *
462
+ * Kikuyu (Pennisetum clandestinum, in the floras an African grass grown and gone wild on the coasts of
463
+ * California, Australia and South Africa) runs on thick stems over and under the ground into a dense,
464
+ * springy mat, the ball sitting up on it in a fairway and down in it in the rough: leaves 3 to 5 mm,
465
+ * folded, stiff, a bright pale green (taken as bermuda's 45 ug: it is a warm-season grass like bermuda),
466
+ * torn more than cut by a mower. Its own flowers are its stamens: white threads among the leaves after a
467
+ * mowing.
468
+ *
469
+ * Fine fescue (Chewings and slender creeping red fescue) is a links' fairway and green: leaves rolled to a
470
+ * needle, half a millimetre, the densest of the turf grasses, grey-green with red fescue's wax, browning
471
+ * in a dry summer where a links is not watered, and firm, which is why a links runs. Greens of it are cut
472
+ * higher than bent (4 to 5 mm); a fairway at about 10 mm.
473
+ *
474
+ * Marram (Ammophila arenaria) holds the dunes behind a links: leaves rolled into stiff, sharp, grey-green
475
+ * tubes 50 cm to over a metre, fanning from tussocks with bare sand between, many dead and pale, and in
476
+ * summer a dense pale spike of a seed head 7 to 22 cm long (the floras). Its colour is red fescue's
477
+ * with more wax (an estimate). Its rolled leaf is drawn as part way to a stem (`stem`), its tussocks further
478
+ * apart than the field's clumps (`clumpScale`), by eye, and its spikes as a flower of its own (`FLOWERS.marram`)
479
+ * on the tussocks: a leaf has too few joints to carry a spike a fifth of its length.
480
+ *
481
+ * As with the others, the habit was set by eye.
482
+ */
483
+ export const MORE_GRASSES = {
484
+ poaGreen: turf("Green (annual meadow-grass)", 0, { cutTip: 0.16,
485
+ height: 0.0032, heightSpread: 0.14, density: 1.7, width: 0.0013, widthSpread: 0.0004, tip: "cut", seedHead: 0.12,
486
+ splay: 0.35, droop: 0.25, stiffness: 1, disorder: 0.35, color: "#789b4a", tipTint: [1.04, 1.05, 0.96], seedTint: [1.35, 1.32, 1.12], rootShade: 0.78, variation: 0.17,
487
+ dry: 0.008, sheen: 0, lay: 1, groundTile: 0.35,
488
+ // (The bent that is left in it: darker, finer, a little lower; spreading by its runners, not by seed, so
489
+ // rounder patches and no seedlings about them. How much darker by eye: as dark as 0.89 it read as stains.)
490
+ patchKind: "runners", patchSite: 0, patch: 0.14, patchSize: 0.45, patchTint: [0.92, 0.94, 1.02], patchTall: 0.95, patchEdge: -0.5,
491
+ // (Many strains of meadow-grass, each its own shade, more than a bent green's: USGA, "Why Are Our Greens So
492
+ // Patchy and Bumpy?". And it wilts first in a dry spell.)
493
+ mosaic: 0.028, mosaicSize: 1.1, scorch: 1,
494
+ }),
495
+ kikuyuFairway: turf("Fairway (kikuyu)", 1, { cutTip: 0.4,
496
+ height: 0.013, heightSpread: 0.1, density: 1.7, width: 0.0033, widthSpread: 0.0009, tip: "cut",
497
+ splay: 0.45, droop: 0.15, twist: 0.35, stiffness: 1, clump: 0, disorder: 0.35, color: "#698a4c", tipTint: [1.06, 1.06, 0.95], rootShade: 0.6,
498
+ variation: 0.2, dry: 0.015, sheen: 0.6, lay: 0.55, groundTile: 0.5,
499
+ // (Its stamens, white threads out of the mat in the days after a mowing.)
500
+ blooms: [{ flower: "kikuyu", perM2: 30, cover: 0.35, site: 0, where: "drifts" }],
501
+ }),
502
+ kikuyuRough: turf("Rough (kikuyu)", 2, { cutTip: 0.55,
503
+ height: 0.05, heightSpread: 0.22, density: 1.6, width: 0.0038, widthSpread: 0.001, tip: "cut",
504
+ splay: 0.9, droop: 0.45, twist: 0.6, stiffness: 0.95, clump: 0.25, disorder: 0.5, color: "#678849", tipTint: [1.07, 1.07, 0.94], rootShade: 0.36,
505
+ variation: 0.24, dry: 0.025, sheen: 0.8, lay: 0,
506
+ blooms: [
507
+ { flower: "kikuyu", perM2: 26, cover: 0.3, site: 0, where: "drifts" },
508
+ { flower: "dandelion", perM2: 6, cover: 0.08, site: 0, where: "drifts" },
509
+ ],
510
+ }),
511
+ fescueGreen: turf("Green (fine fescue)", 0, { cutTip: 0.14,
512
+ height: 0.0045, heightSpread: 0.1, density: 2.3, width: 0.0006, widthSpread: 0.0002, tip: "cut",
513
+ splay: 0.3, droop: 0.25, stiffness: 1, disorder: 0.3, color: "#789b64", tipTint: [1.06, 1.05, 0.94], rootShade: 0.78, variation: 0.16,
514
+ dry: 0.03, sheen: 0.2, lay: 0.85, groundTile: 0.35,
515
+ // (Browner where it dries first, on the crowns.)
516
+ patchKind: "blotches", patchSite: 0.8, patch: 0.14, patchSize: 0.8, patchTint: [1.1, 1.0, 0.84], patchTall: 1,
517
+ mosaic: 0.015, mosaicSize: 1.2, scorch: 0.6,
518
+ }),
519
+ fescueFairway: turf("Fairway (fine fescue)", 1, { cutTip: 0.4,
520
+ height: 0.01, heightSpread: 0.14, density: 2.2, width: 0.0006, widthSpread: 0.0002, tip: "cut",
521
+ splay: 0.6, droop: 0.5, twist: 0.5, stiffness: 1, disorder: 0.45, color: "#789b64", tipTint: [1.1, 1.07, 0.9], rootShade: 0.66,
522
+ variation: 0.24, dry: 0.07, sheen: 0.3, lay: 0.4, groundTile: 0.5,
523
+ patchKind: "blotches", patchSite: 0.8, patch: 0.22, patchSize: 1.6, patchTint: [1.16, 1.02, 0.8], patchTall: 1,
524
+ }),
525
+ marram: turf("Marram", 5, {
526
+ height: 0.8, heightSpread: 0.5, density: 1, tufted: true, width: 0.003, widthSpread: 0.001, tip: "point",
527
+ splay: 0.55, droop: 0.3, twist: 0.3, seedHead: 0, stiffness: 0.7, clump: 1, clumpScale: 1.9, disorder: 0.6, tussock: 0.85, stem: 0.6, flower: 0,
528
+ // (Its spikes, which are its flowers, rising from the tussocks; and harebells and bird's-foot trefoil.)
529
+ blooms: [
530
+ { flower: "marram", perM2: 9, cover: 0.8, site: 0, where: "tussocks" },
531
+ { flower: "harebell", perM2: 4, cover: 0.15, site: 0, where: "drifts" },
532
+ { flower: "birdsfoot", perM2: 4, cover: 0.12, site: 0.4, where: "drifts" },
533
+ ],
534
+ color: "#7f9a6e", tipTint: [1.15, 1.1, 0.86], seedTint: [1.6, 1.45, 1.05], rootShade: 0.5, variation: 0.2, dry: 0.28, sheen: 0.5, edgeBlend: 0.8,
535
+ }),
536
+ };
537
+ /**
538
+ * The grasses of ground nobody mows but once a year, for the mixes a host makes of them (`mixedMap`): no
539
+ * stand of native grass is one grass. Each is drawn as it stands in high summer, gone to seed.
540
+ *
541
+ * Their leaves and stems are the floras' (Kew's GrassBase, the Flora of New Zealand, Flora of Victoria,
542
+ * Flora of North America):
543
+ *
544
+ * - Sheep's fescue (Festuca ovina): leaves folded to a bristle, 0.3 to 0.6 mm (Kew; 0.3 to 1.2 in New
545
+ * England), 3 to 25 cm long, in dense tufts with ground between; stems 5 to 60 cm. Of dry, thin, sandy and
546
+ * acid ground: a links' dunes, a heath. Greyer than red fescue, with more wax on it (an estimate).
547
+ * - Common bent (Agrostis capillaris): leaves flat, 1 to 2.5 mm (to 5), 2 to 13 cm long; stems 10 to 70 cm;
548
+ * a very loose panicle of purplish-brown spikelets, so a stand of it in seed has a reddish haze. It
549
+ * creeps by short runners. A greener grass than the fescues, with no wax.
550
+ * - Yorkshire fog (Holcus lanatus): leaves flat and soft with velvety hairs, 3 to 10 mm, to 25 cm long;
551
+ * stems 30 to 110 cm; a panicle that goes from pinkish white to purple. A pale grey-green, matt for its
552
+ * hairs, in tufts: the grass of a damp, rich meadow.
553
+ * - Sweet vernal grass (Anthoxanthum odoratum): leaves flat, 2 to 6.5 mm, 3.5 to 18 cm long; stems 12 to
554
+ * 50 cm (to 90); a dense, spike-like panicle, yellow-green, gold as it ripens. The first meadow grass to
555
+ * flower, in April to June, and the smell of hay (coumarin).
556
+ * - Wavy hair-grass (Deschampsia flexuosa): leaves rolled to a thread, 0.3 to 0.6 mm (New Zealand; 0.3 to
557
+ * 0.8, Kew), 5 to 20 cm long, in dense tufts far overtopped by their stems, 20 to 75 cm; a loose panicle
558
+ * on wavy branches, silvery and purplish. Of acid heath and open woods.
559
+ * - Creeping bent (Agrostis stolonifera) left unmown: leaves flat, 0.5 to 5 mm (Kew; to 8, New Zealand),
560
+ * 1 to 10 cm long; stems 8 to 40 cm, bent at their foot and rooting where they touch the ground, from
561
+ * runners over it; a narrow panicle, spread in flower and drawn in after, greenish to purplish. With red
562
+ * fescue the body of a grazed or wet coastal meadow (the Juncetum gerardii's closed swards).
563
+ * - Saltmarsh rush (Juncus gerardii): a rush, not a grass, of coastal meadows the sea reaches in winter:
564
+ * slender, wiry, dark green stems 25 to 80 cm (New Zealand 40 to 80; Burren to 60), with flat narrow
565
+ * leaves half their length, in loose tufts along a creeping black rootstock, not in tussocks; dark brown
566
+ * flowers in a cluster near the top. Drawn as stems, as soft rush is (`MORE_PLANTS.rush`).
567
+ *
568
+ * Their seed heads stand where every grass's here does, a fifth over its leaves: the floras' stems stand
569
+ * further over some of them (wavy hair-grass's most), which a leaf's three joints cannot draw. The colours
570
+ * are set by eye from the floras' words; the habit by eye too, as with the others. None has flowers of
571
+ * its own: a host gives a mix its flowers.
572
+ */
573
+ export const NATIVE_GRASSES = {
574
+ sheepsFescue: turf("Sheep's fescue", 4, {
575
+ height: 0.18, heightSpread: 0.7, density: 0.85, width: 0.00045, widthSpread: 0.00015, tip: "point",
576
+ splay: 1, droop: 0.9, twist: 0.8, seedHead: 1, seedShare: 0.15, stiffness: 0.3, clump: 1, tussock: 0.35, disorder: 1,
577
+ color: "#8b9f74", tipTint: [1.1, 1.08, 0.92], seedTint: [1.4, 1.3, 1.02], rootShade: 0.45, variation: 0.2, dry: 0.24, sheen: 0.8, edgeBlend: 0.8,
578
+ blooms: [],
579
+ }),
580
+ commonBent: turf("Common bent", 4, {
581
+ height: 0.2, heightSpread: 0.6, density: 0.9, width: 0.0018, widthSpread: 0.0008, tip: "point",
582
+ splay: 1, droop: 1.2, twist: 1, seedHead: 1, seedShare: 0.35, stiffness: 0.2, clump: 0.5, disorder: 1,
583
+ color: "#73975a", tipTint: [1.08, 1.06, 0.92], seedTint: [1.32, 1.02, 0.98], rootShade: 0.45, variation: 0.22, dry: 0.12, sheen: 0.2, edgeBlend: 0.8,
584
+ blooms: [],
585
+ }),
586
+ yorkshireFog: turf("Yorkshire fog", 5, {
587
+ height: 0.35, heightSpread: 0.72, density: 0.7, width: 0.005, widthSpread: 0.002, tip: "point",
588
+ splay: 0.9, droop: 1.15, twist: 1, seedHead: 1, seedShare: 0.42, stiffness: 0.15, clump: 0.8, tussock: 0.25, disorder: 1,
589
+ color: "#8ea57a", tipTint: [1.08, 1.06, 0.96], seedTint: [1.78, 1.02, 1.38], rootShade: 0.4, variation: 0.2, dry: 0.16, sheen: 0, edgeBlend: 1,
590
+ blooms: [],
591
+ }),
592
+ sweetVernal: turf("Sweet vernal grass", 5, {
593
+ height: 0.25, heightSpread: 0.6, density: 0.7, width: 0.0035, widthSpread: 0.0015, tip: "point",
594
+ splay: 0.8, droop: 0.9, twist: 1, seedHead: 1, seedShare: 0.3, stiffness: 0.35, clump: 0.7, disorder: 1,
595
+ color: "#71944f", tipTint: [1.1, 1.08, 0.9], seedTint: [1.5, 1.36, 0.86], rootShade: 0.4, variation: 0.22, dry: 0.18, sheen: 0.4, edgeBlend: 1,
596
+ blooms: [],
597
+ }),
598
+ wavyHairGrass: turf("Wavy hair-grass", 4, {
599
+ height: 0.18, heightSpread: 0.78, density: 0.9, width: 0.00045, widthSpread: 0.0002, tip: "point",
600
+ splay: 1, droop: 1, twist: 1, seedHead: 1, seedShare: 0.45, stiffness: 0.25, clump: 1, tussock: 0.38, disorder: 1,
601
+ color: "#6f9052", tipTint: [1.1, 1.08, 0.9], seedTint: [1.58, 1.28, 1.56], rootShade: 0.42, variation: 0.2, dry: 0.16, sheen: 0.6, edgeBlend: 0.8,
602
+ blooms: [],
603
+ }),
604
+ creepingBent: turf("Creeping bent", 4, {
605
+ height: 0.2, heightSpread: 0.5, density: 1.1, width: 0.0025, widthSpread: 0.0012, tip: "point",
606
+ splay: 1.2, droop: 1.3, twist: 1, seedHead: 1, seedShare: 0.25, stiffness: 0.15, clump: 0.2, disorder: 1,
607
+ color: "#6b9152", tipTint: [1.07, 1.06, 0.93], seedTint: [1.25, 1.05, 1.05], rootShade: 0.45, variation: 0.2, dry: 0.08, sheen: 0.2, edgeBlend: 0.9,
608
+ blooms: [],
609
+ }),
610
+ saltmarshRush: turf("Saltmarsh rush", 5, {
611
+ height: 0.4, heightSpread: 0.45, density: 0.9, tufted: true, width: 0.0014, widthSpread: 0.0005, tip: "point",
612
+ splay: 0.35, droop: 0.1, twist: 0, seedHead: 0, stiffness: 0.8, clump: 0.6, disorder: 0.6, tussock: 0.15, stem: 1, flower: 0.4,
613
+ color: "#4d6b3c", tipTint: [1.1, 1.0, 0.8], rootShade: 0.4, variation: 0.2, dry: 0.15, sheen: 0.8, edgeBlend: 0.6,
614
+ blooms: [],
615
+ }),
616
+ tuftedHairGrass: turf("Tufted hair-grass", 5, {
617
+ height: 0.62, heightSpread: 0.72, density: 0.95, tufted: true, width: 0.0042, widthSpread: 0.0014, tip: "point",
618
+ splay: 0.95, droop: 1.05, twist: 0.85, seedHead: 1, seedShare: 0.48, stiffness: 0.35, clump: 1, clumpScale: 1.45, tussock: 0.55, disorder: 1,
619
+ color: "#5e8048", tipTint: [1.1, 1.06, 0.9], seedTint: [1.62, 1.48, 1.08], rootShade: 0.38, variation: 0.22, dry: 0.22, sheen: 0.45, edgeBlend: 0.9,
620
+ blooms: [],
621
+ }),
622
+ purpleMoorGrass: turf("Purple moor-grass", 5, {
623
+ height: 0.48, heightSpread: 0.68, density: 0.88, tufted: true, width: 0.0038, widthSpread: 0.0012, tip: "point",
624
+ splay: 0.82, droop: 0.95, twist: 0.8, seedHead: 1, seedShare: 0.44, stiffness: 0.32, clump: 1, clumpScale: 1.35, tussock: 0.62, disorder: 1,
625
+ color: "#6d8c54", tipTint: [1.12, 1.04, 0.88], seedTint: [1.38, 0.96, 1.32], rootShade: 0.4, variation: 0.24, dry: 0.28, sheen: 0.3, edgeBlend: 0.85,
626
+ blooms: [],
627
+ }),
628
+ cottonGrass: turf("Cotton-grass", 5, {
629
+ height: 0.36, heightSpread: 0.55, density: 0.82, tufted: true, width: 0.0022, widthSpread: 0.0008, tip: "point",
630
+ splay: 0.55, droop: 0.5, twist: 0.35, seedHead: 1, seedShare: 0.52, stiffness: 0.45, clump: 0.9, clumpScale: 1.2, tussock: 0.48, disorder: 0.85,
631
+ color: "#597a49", tipTint: [1.08, 1.02, 0.86], seedTint: [2.25, 2.22, 2.15], rootShade: 0.42, variation: 0.2, dry: 0.18, sheen: 0.35, edgeBlend: 0.75,
632
+ blooms: [],
633
+ }),
634
+ pendulousSedge: turf("Pendulous sedge", 5, {
635
+ height: 0.68, heightSpread: 0.58, density: 0.92, tufted: true, width: 0.0075, widthSpread: 0.0022, tip: "point",
636
+ splay: 1.15, droop: 1.35, twist: 0.65, seedHead: 1, seedShare: 0.36, stiffness: 0.28, clump: 1, clumpScale: 1.5, tussock: 0.45, disorder: 0.9,
637
+ color: "#4b7638", tipTint: [1.08, 1.06, 0.92], seedTint: [1.22, 1.15, 0.78], rootShade: 0.36, variation: 0.18, dry: 0.1, sheen: 0.65, edgeBlend: 0.8,
638
+ blooms: [],
639
+ }),
640
+ crestedDogsTail: turf("Crested dog's-tail", 4, {
641
+ height: 0.28, heightSpread: 0.62, density: 0.85, tufted: true, width: 0.0024, widthSpread: 0.0009, tip: "point",
642
+ splay: 0.75, droop: 0.75, twist: 0.7, seedHead: 1, seedShare: 0.38, stiffness: 0.42, clump: 0.65, tussock: 0.18, disorder: 0.95,
643
+ color: "#6c914d", tipTint: [1.09, 1.07, 0.92], seedTint: [1.46, 1.38, 0.96], rootShade: 0.42, variation: 0.2, dry: 0.15, sheen: 0.35, edgeBlend: 0.9,
644
+ blooms: [],
645
+ }),
646
+ lymeGrass: turf("Lyme-grass", 5, {
647
+ height: 0.74, heightSpread: 0.48, density: 0.95, tufted: true, width: 0.0062, widthSpread: 0.0018, tip: "point",
648
+ splay: 0.6, droop: 0.42, twist: 0.35, seedHead: 1, seedShare: 0.32, stiffness: 0.68, clump: 1, clumpScale: 1.8, tussock: 0.78, disorder: 0.65,
649
+ color: "#6d9387", tipTint: [1.12, 1.1, 0.94], seedTint: [1.55, 1.44, 1.12], rootShade: 0.48, variation: 0.18, dry: 0.22, sheen: 0.55, edgeBlend: 0.8,
650
+ blooms: [],
651
+ }),
652
+ };
653
+ /**
654
+ * Every species here by a name: a host makes its own list from them (`cloneSpecies` the ones it wants, in
655
+ * the order of its map's numbers), as a course has the grasses it has.
656
+ */
657
+ export const GRASSES = {
658
+ bentGreen: TURF_SPECIES[0],
659
+ bentCollar: TURF_SPECIES[1],
660
+ ryeFairway: TURF_SPECIES[2],
661
+ ryeFirstCut: TURF_SPECIES[3],
662
+ rough: TURF_SPECIES[4],
663
+ redFescueRough: TURF_SPECIES[5],
664
+ fescueInSeed: TURF_SPECIES[6],
665
+ hayMeadow: TURF_SPECIES[7],
666
+ bermudaFairway: MORE_TURF.bermuda,
667
+ bluegrassLawn: MORE_TURF.bluegrass,
668
+ ...MORE_GRASSES,
669
+ ...NATIVE_GRASSES,
670
+ softRush: MORE_PLANTS.rush,
671
+ };
672
+ //# sourceMappingURL=species.js.map