Mario Morgenthum
banner
morgenthum.bsky.social
Mario Morgenthum
@morgenthum.bsky.social
25 followers 11 following 22 posts
Software developer 💻 and math student 🧑‍🎓
Posts Media Videos Starter Packs
It uses the avian3d physics engine (also used in the game for general physics) to top-down raycasts to the ground, to find the height/y-coordinate for the trees.
Migrated the biome generation of Wild Spikes to bevy_map_scatter. Currently using a small scatter plan that only generates one type (one kind of tree). But everything works as expected!

#gamedev #rust #bevy #bevyengine #procedural #indiedev #rustlang #avian3d #avian #map_scatter
Oh, because the relative link doesn‘t work on crates.io. Need to fix it, ty!

Examples: github.com/morgenthum/m...
Jittered grid position candidates are filtered by a field graph using a simple texture. The scene features a camera with a Bloom component and 3D cubes with emissive colors. A separate system modifies the cubes Y-scale to create this effect.
After releasing map_scatter yesterday, I am working on bevy_map_scatter.

#gamedev #rust #bevy #bevyengine #procedural #indiedev #rustlang
Candidate positions were generated with Poisson-disk sampling; grass uses a jittered grid. Actual species are placed layer by layer - trees first - by computing per-species probabilities from their own field-graph specifications.
The water is the double sine wave in the middle of the image. It was constructed using the crates Texture-trait to generate the texture programmatically.
A more concrete example using map_scatter: a forest with natural rules, such as "willows are more likely to be near water."

#gamedev #rust #bevy #bevyengine #procedural #indiedev #rustlang
I’m not sure yet whether I should release map_scatter as engine-agnostic, or if I should first think more about bevy_map_scatter. I’d like to take the Bevy community’s knowledge into account for the Bevy crate.
Points are generated by a jitter grid (with no jitter, so it’s actually just a grid). The first texture is used as the basis for a Euclidean distance transform to calculate the points nearest to the text. These are then filtered with smoothstep and finally rendered as a PNG for this example.
Final polish is underway. Expect a release in a few days with docs and examples.
If it looks too “generated”: use splat maps from texture paint (e.g., Blender) to drive or filter the rules - paint where to allow/boost/suppress types. Mix authored masks with procedural fields for control.
Works great for 2D - and for 3D too: sample a top‑down position, raycast to terrain for height, then spawn models at the hit. Same rules, different consumer. See my previous post for a 3D in‑game screenshot.
In the example, the rules (grass near river, trees away, mushrooms near trees) are ~250 LOC total. You write small field‑graphs (distance, smoothstep, masks) and compose them into stages/layers. That’s it - rules, not hand‑placed points.
@bevy.org

Announcing map_scatter and bevy_map_scatter: a tiny, engine‑agnostic toolkit for rule‑based object scattering on maps. Build field‑graph rules, run multi‑stage placement, get reproducible results.

#gamedev #rust #bevy #bevyengine #procedural #indiedev #rustlang
Of course, many species are still missing - just a first attempt.
@bevy.org

First pass at procedural vegetation in Wild Spikes.
Poisson-disk sampling generates candidates, then a FieldGraph (EDT/SDF with gates & modifiers) bakes per-chunk+halo rasters to compute final densities.

#gamedev #rust #bevy #bevyengine #procedural #indiedev #rustlang