Project Description

Creates natural-looking tree models for XNA in real-time. LTrees makes it easier for XNA game developers to create beautiful nature scenes.

Quick Downloads


Here are some screenshots of a few generated trees. The demo application gives a better impression of them, though.

Getting Started

  1. 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.
  2. Download LTrees 2.1.
  3. Add LTreesLibrary and LTreesPipeline projects to your solution.
  4. Add a reference to LTreesLibrary in your main project (right-click "References", then click "Add reference").
  5. Add a reference to LTreesPipeline in your content project.
  6. 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.
  7. For each .ltree-file, change its importer to "LTree Specification" and its processor to "LTree Profile."
  8. Enable mipmap generation for all the textures.
  9. Load a tree profile using the content manager: TreeProfile profile = Content.Load<TreeProfile>("Trees/Graywood");
  10. Generate a SimpleTree from the tree profile: SimpleTree tree = profile.GenerateSimpleTree();
  11. Draw the trunk: tree.DrawTrunk(world, view, projection);
  12. 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 User Manual to learn more.

So How Does It Work?

See the User Manual page.

Version history

Version Date Changes
2.1 August 31, 2011 Upgraded to XNA 4.0
2.0a February 2, 2009 Fixed an issue with ATI cards not rendering leaves.
2.0 January 29, 2009 LTrees release. The old code was scrapped.
1.2 November 10, 2007 Trees can now be scaled uniformly without problems with leaves. Non-uniform scales are still not supported
1.1 November 7, 2007 Fixed localization issues. Systems that use comma as decimal separator should no longer crash
1.0 November 6, 2007 Moved to CodePlex, and changed to MIT License
0.9 November 2, 2007 Initial release at XNA Forums, under Zlib License

Last edited Aug 25, 2012 at 8:53 PM by AsgerKlasker, version 22