Skip to content

Draw trees using L Systems in godot and rust

License

Notifications You must be signed in to change notification settings

Terkwood/forest

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

82 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

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.