meta data for this page
  •  

How to use this SDK

The SpeedTree SDK is the run-time component of a powerful real-time vegetation system. It is written in C++ and designed to be integrated into a real-time engine on multiple platforms.

Artists use the standalone SpeedTree Modeler application to design and edit vegetation content, exporting their results to the .stsdk (SpeedTree SDK) file format. The SpeedTree SDK can be used to read .stsdk files and provide vertex buffer data to feed into an external renderer. At its highest level, it can be used to manage the rendering of forests composed of millions of trees, complex wind effects, smooth level of detail, lighting and shadows, and undergrowth/grass. Because the SDK is organized into several libraries, you are in control of the level of integration, using as much or as little as you need.

This compartmentalization of the SDK has sprung out of feedback from hundreds of development teams around the world, each with a unique need and perspective for how the SDK might best help them.

What are the integration options?

1. Export meshes from the SpeedTree Modeler, bypassing the SDK entirely.

  • Pros: It's the easiest level of integration. This is the first choice of those seeking a quick-and-easy integration.
  • Cons: It bypasses the run-time level of detail (LOD) scheme, scalable wind, billboards, forest management, culling engine, and all rendering code. Users that opt for this approach might struggle to achieve the exact wind and smooth LOD effects seen in the Modeler.

2. Read the geometry using the Core Library.

  • Pros: By using this approach, the client application will have access to all of the data generated by the SpeedTree Modeler, including LOD data, wind, bone structures, ambient occlusion (AO), and other per-vertex data. It will help generate a rendering that more closely matches what's previewed in the Modeler.
  • Cons: It bypasses most of the run-time system including the 360-degree billboard matching scheme, forest management, culling engine, automatic LOD computations, and rendering code.

3. Use the Forest Library to manage at a forest level.

  • Pros: The Forest library provides efficient culling algorithms and can handle forests of 10 million trees or more. It also provides all of the data necessary for rendering the trees in full 3D LOD all the way down to a single billboard (which are batched together with billboards of the same type). The Forest library also has a notional terrain engine that may be useful for rapid prototyping.
  • Cons: While a great deal is handled by this library, it is missing the actual render calls which are key for getting efficient vertex shader-based wind, correct lighting, smooth 3D LOD transitions, and seamless 3D-to-360-degree-billboard transitions.

4. Use the Render Interface and Platform Specific Renderer libraries to render the entire forest.

  • Pros: Uses the full SpeedTree capability, including portability to a number of platforms.
  • Cons: While some developers may shy away from a full integration, we advise at least starting with this level of integration to get a system up and running quickly. There is no doubt that clients will want to remove some graphical features and add or modify others. These types of tweaks are facilitated by having access to the full source code for the entire SDK.

Hybrid approaches

Combinations of the approaches above are also possible. One approach we see somewhat often is leveraging just the wind system, where per-vertex wind data from the Modeler is retained and fed to the wind vertex shader functions provided in the reference application. More information on this approach can be found in the Wind section on the shader overview page.