Creates natural-looking tree models for XNA in real-time. LTrees makes it easier for XNA game developers to create beautiful nature scenes.
Here are some screenshots of a few generated trees. The demo application gives a better impression of them, though.
- Version 2.1 is for XNA 4.0. If you are using XNA 3.0 or XNA 3.1, you can download an earlier version:
LTrees Source 2.0a.
- Download LTrees 2.1.
- Add LTreesLibrary and LTreesPipeline projects to your solution.
- Add a reference to LTreesLibrary in your main project (right-click "References", then click "Add reference").
- Add a reference to LTreesPipeline in your content project.
- Copy the .ltree-files and textures from the LTreeDemo project. (Note: You don't need the Grass.jpg texture). Keep the same folder structure for now.
- For each .ltree-file, change its importer to "LTree Specification" and its processor to "LTree Profile."
- Enable mipmap generation for all the textures.
- Load a tree profile using the content manager: TreeProfile profile = Content.Load<TreeProfile>("Trees/Graywood");
- Generate a SimpleTree from the tree profile:
SimpleTree tree = profile.GenerateSimpleTree();
- Draw the trunk: tree.DrawTrunk(world, view, projection);
- Draw the leaves: tree.DrawLeaves(world, view, projection);
This was a guide intended to get you started as fast as possible. More advanced behaviour is possible, but for that you need to know more about how it works. See the
to learn more.
So How Does It Work?
||August 31, 2011
||Upgraded to XNA 4.0
||February 2, 2009
||Fixed an issue with ATI cards not rendering leaves.
||January 29, 2009
||LTrees release. The old code was scrapped.
||November 10, 2007
||Trees can now be scaled uniformly without problems with leaves. Non-uniform scales are still not supported
||November 7, 2007
||Fixed localization issues. Systems that use comma as decimal separator should no longer crash
||November 6, 2007
||Moved to CodePlex, and changed to MIT License
||November 2, 2007
||Initial release at XNA Forums, under Zlib License