Skip to content

Terkwood/forest

Repository files navigation

forest

Draw simple L-System trees using Godot and rust. 🌳🤖🦀

walking through the woods

forest demo

widget

Dynamic image generation

This project implements procedural drawing of trees in Godot engine using Lindenmayer Systems.

The tree is first drawn with a Turtle implementation, as seen in The Algorithmic Beauty of Plants. It is converted to SVG in memory, and then to PNG bytes which are consumable by Godot.

Caching

This project implements a cache of Image outputs, reducing the time it takes to reproduce individual tree styles.

Justification

We found that Godot custom drawing in 2D slows the frame rate when compared to using sprites/textures.

Building the dependencies

You need to build the gen dependency so that Godot has access to the shared lib written in rust:

cd gen
cargo build --release

Additional Attributions

Thanks to mneumann for the implementation of L-Systems and Turtle Drawing.