Mario Morgenthum
@morgenthum.bsky.social
24 followers 11 following 21 posts
Software developer 💻 and math student 🧑‍🎓
Posts Media Videos Starter Packs
morgenthum.bsky.social
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.
morgenthum.bsky.social
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
morgenthum.bsky.social
Oh, because the relative link doesn‘t work on crates.io. Need to fix it, ty!

Examples: github.com/morgenthum/m...
morgenthum.bsky.social
Released bevy_map_scatter on crates.io.

Crate: crates.io/crates/bevy_...
Examples: github.com/morgenthum/m...

#gamedev #rust #bevy #bevyengine #procedural #indiedev #rustlang
crates.io: Rust Package Registry
crates.io
morgenthum.bsky.social
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.
morgenthum.bsky.social
After releasing map_scatter yesterday, I am working on bevy_map_scatter.

#gamedev #rust #bevy #bevyengine #procedural #indiedev #rustlang
morgenthum.bsky.social
Finally released map_scatter on crates.io!

Crate: crates.io/crates/map_s...
Examples: github.com/morgenthum/m...

#gamedev #rust #bevy #bevyengine #procedural #indiedev #rustlang
crates.io: Rust Package Registry
crates.io
morgenthum.bsky.social
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.
morgenthum.bsky.social
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.
morgenthum.bsky.social
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
morgenthum.bsky.social
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.
morgenthum.bsky.social
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.
morgenthum.bsky.social
Working on final steps - documentation and examples!

#gamedev #rust #bevy #bevyengine #procedural #indiedev #rustlang
morgenthum.bsky.social
Final polish is underway. Expect a release in a few days with docs and examples.
morgenthum.bsky.social
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.
morgenthum.bsky.social
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.
morgenthum.bsky.social
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.
morgenthum.bsky.social
@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
morgenthum.bsky.social
Of course, many species are still missing - just a first attempt.
morgenthum.bsky.social
@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
morgenthum.bsky.social
@bevyengine.org

Building Iggy's world! 🦔

#indiedev #gamedev #BevyEngine #rustlang