@threenative/procedural-environment 0.1.7 → 0.1.9

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/README.md CHANGED
@@ -36,7 +36,8 @@ kits (forest, coastal, alpine, desert, tundra) where they overlap.
36
36
  From the repository root, `pnpm asset-library` builds this package and opens a Storybook-style
37
37
  viewer. Search the sidebar by name or filter by biome and style tags. Selecting several tags
38
38
  shows assets with any of those tags. Nature and city modules are tagged Realistic, the Biome
39
- Kit is tagged Stylized, and the Dungeon kit is tagged Low Poly. Open a story to orbit the asset.
39
+ Kit, the Dungeon kit, and the Village kit, one collection, are tagged Stylized. The Toybox kit is
40
+ tagged Stylized realism. Open a story to orbit the asset.
40
41
  GLB stories run the package's bake with the selected controls. The Docs tab shows the exact
41
42
  bake call and mesh attributes, and the Stats tab shows dimensions and triangle counts.
42
43
  Story links retain the controls, such as `#/rock/cliff?biome=coastal&module=1`. Changes
@@ -82,6 +83,66 @@ The wall torch, brazier, hanging lamp, candle cluster, and altar carry their own
82
83
  shader moves the flame and embers, and `update` flickers the emitted light. The Theme control in the
83
84
  viewer corresponds to variant indices 0, 1, and 2.
84
85
 
86
+ ### Village kit
87
+
88
+ The **Village** section belongs to the same collection: it uses the Biome Kit's faceted painted
89
+ material and palettes. It has 43 pieces and two assembled scenes, Village green and Walled town.
90
+ Each piece comes in Meadow Village, Snowy Village, and Desert Village (variants 0, 1, and 2).
91
+ Snow, grass, or sand settles on roofs and stone tops for each theme.
92
+
93
+ - Buildings: cottage, two-storey house, tavern, barn, watchtower, windmill, forge, market stall, well.
94
+ - Enterable buildings: the house, the inn, and the shop have hollow walls, an open door, a plank
95
+ floor, and furniture inside (bed, hearth, bar, shop counter). The `-cutaway` ids leave off the roof
96
+ to show the room from above. Both scenes place walk-in houses, named `village-home`,
97
+ `village-inn`, and `village-shop`.
98
+ - City walls: a 4 m wall segment along X with its outer face on +Z, a round wall tower, and a
99
+ gatehouse with a half-raised portcullis.
100
+ - Walls, fences, paths, and props: timber-framed wall modules, fences, a gate, cobblestones, a cart,
101
+ haystacks, a lamp post, a signpost, and the dungeon crate, barrel, sack, table, and bench.
102
+
103
+ ```ts
104
+ import { createStylizedAsset } from "@threenative/procedural-environment/stylized";
105
+
106
+ const inn = createStylizedAsset("village-inn", { seed: 4, variant: 1 });
107
+ const town = createStylizedAsset("village-town", { variant: 2 }); // group, view, env
108
+ ```
109
+
110
+ ### Toybox kit
111
+
112
+ The **Toybox** kit (collection Stylized realism) has toy-like shapes with realistic surfaces:
113
+ clearcoat plastic, gold, riveted metal, layered rock, soil and planks (triplanar maps in `scans/toybox_*`),
114
+ dense grass blades and swaying trees. It has 56 modules and three scenes, Sky garden, Obstacle
115
+ course and Island cove, in Sky Garden, Frost Peak and Sand Ruins (variants 0, 1, and 2). Each scene
116
+ also returns a blurred sky panorama `backdrop` for that theme.
117
+
118
+ - Modules snap to a 2 m grid and stand on y = 0. Terrain blocks rise in whole metres (1 m and 2 m
119
+ blocks, a collar edge, a rounded corner, a ramp, a cliff, a pond). Platforms are 0.5 m thick (slab,
120
+ circuit deck panel, glass panel, launch pad, stairs, hover platform, 4 m bridge, rail, pipes). The
121
+ pier deck is 1 m, level with a grass block. The deck panel traces meet at each edge, so a row of
122
+ panels forms one circuit. The scenes are assembled only from these modules.
123
+ - Island cove stands its plateaus in an open sea that runs to the horizon. Shore foam edge and
124
+ corner pieces follow a plateau's outline and lap at its walls. Vines hang over its straight edges.
125
+ - Temple ruins: cut-stone platforms, stepping pillars, floating and sliding stone rafts, carved ruin
126
+ blocks with meander panels, and lattice glyph pillars, in sandstone and flagstone maps.
127
+ - Obstacles: a spinner bar, a spike trap, the sliding raft, and a goal gate. Obstacle course runs a
128
+ full level through them, from a start garden to the gate.
129
+ - Props and plants: crate, barrel, stone gateway, palm, canopy tree, spiky rosette, broadleaf plant,
130
+ tulips, fruit piles, round tree and bush, flowers, rocks, crystals.
131
+ - Gameplay pieces animate: coins spin and bob, the bounce pad squashes and launches, the cannon
132
+ recoils, the spinner sweeps, the spikes shoot up, the stone rafts slide and bob, the hover platform bobs, glows pulse, the waterfall flows, the sea rolls and the
133
+ shore foam laps.
134
+ - Grass, flowers and trees sway, and bend away from up to four pushers that you set with `toyboxPush`.
135
+
136
+ ```ts
137
+ import { createStylizedAsset, stylizedUniforms, toyboxPush } from "@threenative/procedural-environment/stylized";
138
+
139
+ const { group, update, backdrop } = createStylizedAsset("toybox-garden", { variant: 0 });
140
+ // each frame:
141
+ stylizedUniforms.uTime.value = seconds;
142
+ update?.(seconds);
143
+ toyboxPush(0, player.x, player.y, player.z, 0.7);
144
+ ```
145
+
85
146
  ## Trees, cover and the forest floor
86
147
 
87
148
  ```ts