Feature Preview: Foliage
We keep improving Flax all the time. It’s time to introduce you to the new Foliage system that has been added to Flax and will be ready to use for the next major update. This will definitely improve open world games development and complete the recently added terrain system.
Without further ado let’s jump into the topic!
The most important purpose of the foliage system is that it can easily scale and result in very solid performance. If your game needs huge open worlds full of trees, grass, and rock then you definitely need to use foliage system. It supports placing and rendering hundreds of thousands of foliage instances in the level with no performance drop. Ok, but how it works?
Foliage actor contains a list of predefined foliage instance types and a collection of foliage instances. Each foliage type defines the model asset to use for rendering, placement properties, and painting properties. Each foliage instance contains information about what type it uses and the actual placement transformation in the world. Both instances and types collections are encapsulated inside the foliage actor internally to improve performance.
Foliage internally uses
For small grass and rocks, it is recommended to use density scaling. By
Foliage system comes up with dedicated C# API for accessing instances data and instance types information. You can modify all of the properties and spawn or remove instances during gameplay. Many games such as Real-Time Strategie genre titles generate the world dynamically so we also added API and tutorial for those who need to spawn foliage at runtime.
Finally, because the foliage system can be described as a huge booster for instanced meshes rendering you can use own geometry (other than foliage/rocks) such as dungeon walls or large city buildings. This can help with achieving better performance in your games.
That’s all for now. We hope you like the newest feature as we want to publish another exciting update soon. It will include a foliage system and many new features.
See you soon! Bye 🙂