User Tools

Site Tools


Version 5.1

Release Notes


General Notes

  • Support for PlayStation®3 (PS3) added. 300.001 PS3 SDK required. Some PS3-specific notes are here.
  • The SRT file format has changed. SPM files will have to be recompiled using the SpeedTree Compiler to work with the 5.1 SDK. Attempts to load 5.0 SRT files with the 5.1 SDK will result in “mismatched header” warnings from CCore::LoadTree().
  • SDK can now be put in “SPEEDTREE_HEAP_FRIENDLY_MODE,” which is targeted for console use. It will trade some of the SDK's flexibility for far fewer (95+%) heap allocations and better general memory management. Details here.
  • Under DirectX 9, OpenGL, Xbox 360, and PlayStation 3, effects (HLSL FX or CgFX) files are no longer used. Instead, separate vertex and pixel shaders are used. This helps general performance and bypasses some serious CgFX performance issues on the Windows/OpenGL platform, yielding a four-times increase in frame rates in our tests with the Huangshan forest. DirectX 10 is the only platform still using Effects files.
  • This help system now contains details of memory usage by the SDK for tree geometry, billboards, etc. Spreadsheet included in [SDK]/Docs/ folder profiles several example SRT files.
  • There is a Cg bug that causes the grass to render white when SPEEDTREE_TERRAIN_MATCHING_IN_VERTEX is #defined in Grass.hlsl. The bug was reported and acknowledge by NVIDIA.
  • There is an NVIDIA driver bug, starting with 190.38, that will sometimes cause grass and billboards to not render. The bug was fixed by NVIDIA and should not be present in their most current drivers.
  • OpenGL version requires OpenGL 2.0 or higher.

Core Library

  • The SDK now builds with a default packing alignment of 8-bytes, pushed and popped around each external SDK header file.
  • SMaterial structure now has a face culling flag (back, front, none) associated with it, allowing artists more render state control via the Modeler.
  • SDrawCallInfo structure now includes two more parameters expected by DX9 DrawIndexedPrimitive() calls. Earlier versions of the SDK computed these values as needed; they're now embedded in the SRT file.
  • One wind parameter was added to the SIndexedTriangles::m_pWindData array to specify wind state. This enables certain types of geometry to have no wind effect whatsoever; helpful when leaf meshes represent structures like rocks, huts, or other rigid objects.
  • Tree models with no LOD are now supported (but use caution as these can very quickly destroy frame rates when using long draw distances).
  • SRT now houses five arbitrary-length strings, specified in the Modeler (“User data 1” through “User data 5” parameters on the tree node).
  • Evaluation/Lease authorization system now chooses latest-expiring key from both CCore::Authorize() and the host system's registry.
  • The SpeedTree Compiler now compiles branch caps into the frond geometry, resulting in better rendering efficiency since the caps textures are normally altased together with the frond and leaf geometry.
  • CCore::ListSrtContents() now a public function. It lists an SRT's contents in an ASCII text file. Useful when porting the SDK to new platforms.
  • CLocalArray class added for internal use, but publicly available. It behaves essentially like std::vector(), but uses a chunk of pre-allocated heap space, avoiding additional heap allocation/fragmentation.
  • CCore::*TmpHeapBlock() functions added for internal use, but publicly available. These are utility functions to help reduce heap allocation/fragmentation.

Forest Library

1. Billboard system completely revamped. Now batches billboard renders much more efficiently. Draw call count now equal to the number of base trees with billboards in a given forest (e.g. if a forest has eight base trees with billboards, the entire billboard population will now be rendered in eight draw calls total and is independent of the number of cells in the frustum).

2. SPEEDTREE_HEAP_FRIENDLY_MODE added. Primarily for use on consoles, this mode will trade some of the SDK's flexibility for far fewer (95+%) heap allocations and better general memory management. It is recommended that this mode not be used until your initial SDK integration is complete and you are familiar with the SDK.

  • CCellBaseTreeItr added to abstract access to different internal data structures used in and out of SPEEDTREE_HEAP_FRIENDLY_MODE. Used internally.
  • Instance managing functions (CForest::AddInstance(), CForest::ChangeInstance(), etc.) are not available under SPEEDTREE_HEAP_FRIENDLY_MODE. One new population function is used in this mode: CForest::PopulateAtOnce().

3. CForest::EndInitialPopulation() function added and must be called after the forest instances have been set for the first time. Population methods.

4. SForestCullResults structure changed to facilitate changes to the billboard system. Details on the new member variables and functions.

5. SForestCullResults::Reserve(), STerrainCullResults::Reserve(), SGrassCullResults::Reserve() all added to prevent render-time dynamic allocations during culling. These can be used in and out of SPEEDTREE_HEAP_FRIENDLY_MODE. More on the hints and reserves system.

6. CInstance size was reduced from 52 bytes to 36 bytes, a 30% reduction (very helpful when instance counts approach the hundreds of thousands).

7. CInstance::GetPosAndScale() added as a small optimization during constant uploads in the render loop.

8. CForest::RegisterTree()/UnregisterTree() are no longer virtual and therefore not overridden in CForestRI. CForestRI::RegisterTree() would call both CForest::RegisterTree() and initialize the tree's graphics. Call CForest::RegisterTree() and the new function CForestRI::InitTreeGraphics() to accomplish the same thing. This change was made to give more control over when the tree graphics were initialized. More on initializing tree graphics.

9. CForest, CGrass, and CTerrain hint systems synchronized to use the same hint names and internal member variables (mostly HINT_MAX_NUM_VISIBLE_CELLS and m_nHintMaxNumVisibleCells).

10. CTerrain class now uses far fewer heap allocations in and out of SPEEDTREE_HEAP_FRIENDLY_MODE. It also provides correct values for DX9 DrawIndexedPrimitive() calls.


Render Interface Library

1. Under DirectX 9, OpenGL, Xbox 360, and PlayStation 3, effects (HLSL FX or CgFX) files are no longer used. Instead, separate vertex and pixel shaders are used. This helps general performance and bypasses some Cg performance issues on the Windows/OpenGL platform, yielding an average of 75% reduction in draw times there. DirectX 10 still uses Effects files.

  • To facilitate constant sharing among shaders, the LOCAL_REG and GLOBAL_REG macros are #defined in Global.hlsl and used everywhere a global shader parameter is declared.
  • When a global shader constant is queried from within the SDK, you must specify if the parameter is used by the vertex shader, pixel shader, or both. This affects both correctness and performance.
  • Effects.fx is used by the DirectX 10 implementation compiles techniques together from the individual shaders.
  • DirectX 9, Xbox 360, and PlayStation 3 now support loading of pre-compiled shaders. DirectX 10 and OpenGL do not.
  • Compile_Shaders.bat has been rewritten to support individual shader compilation and will write output binaries for those platforms that support them.
  • Compile_Shaders_PS3.bat is used by the PS3 Visual Studio solution to compile and embed the PS3 version of the SpeedTree shaders.

2. Reference vertex formats were heavily compressed for tree-related geometry types. Some additional decompression instructions were added to their respective vertex shaders, but overall the shaders are slightly shorter than their 5.0 counterparts.

  • SBranchVertex dropped from 100 bytes to 56, or 44%.
  • SFrondVertex dropped from 108 bytes to 56, or 48%.
  • SLeafMeshVertex dropped from 104 bytes to 52, or 50%.
  • SLeafCardVertex dropped from 104 bytes to 60, or 42%.
  • SBillboardVertex dropped from 32 bytes to 20 bytes, or 38%.

3. Texture binding in CForestRI::UploadMaterial() now prevents redundant texture binds. Impacted performance on PCs, but console performance remained unaffected.

4. PlayStation 3 support added EGeometryProcessingType processing flags to CGeometry::BindVertexBuffer(), ::RenderIndexed(), and ::RenderArrays() to facilitate optional SPU-based geometry processing. Note that this feature is in a beta state.

5. 16-bit index buffers now used everywhere possible. 32-bit now used only with tree models complex or detailed enough to require them.

6. SPEEDTREE_WORLD_TRANSLATE now #defined by default in ForestRI.h.

7. ECullType enumeration moved into Core.h now that the SMaterial definition houses a cull flag.

8. Support for all depth test modes added via EDepthTestFunc and CRenderStateRI::SetDepthTesting().

9. Unused functions CTextureRI::LoadSpecularLookup() and CTextureRI::LoadCubeNormalizer() removed.

10. Due to revamped billboard system, CGeometryBufferRI class now has much improved support for dynamic buffers; constructor now takes dynamic VB/IB flags.

11. CGeometryBufferRI::ReplaceVertices()/ReplaceIndices() functions replaced with ::OverwriteVertices/OverwriteIndices(), more general and better-performing functions.

12. CGeometryBufferRI::RenderIndexed() now takes DX9-like parameters.

13. CGeometryBufferRI::Reserve() added to help reduce heap fragmentation.

14. CTreeRI now houses some parts of the billboard system via new functions CTreeRI::InitBillboardSystem() and the GetBillboard*() group of functions.

15. CForestRI::GetVertexBufferStats() will return amount of vertex and index memory used by the tree and billboard geometry in SDK. Does not include terrain, grass, or sky, which are auxiliary rendering systems.

16. SForestCullResultsRI structure added which derives from SForestCullResults. This was necessary as part of the new billboard system stores some information per view, which is best housed in this structure.

17. Render statistics, queried via CForestRI::GetRenderStats(), were incomplete and inaccurate for some scenes. Corrected.

18. Sky rendering system now includes more dramatic time of day changes. Star effects also added.


Reference Application

1. Users can now successfully #ifdef out the auxiliary rendering systems using the #defines at the top of Application.h:

  • SPEEDTREE_TERRAIN_ACTIVE
  • SPEEDTREE_GRASS_ACTIVE
  • SPEEDTREE_SKY_ACTIVE

2. Reference vertex formats were heavily compressed for tree-related geometry types. Some additional decompression instructions were added to their respective vertex shaders, but overall the shaders are slightly shorter than their 5.0 counterparts.

  • SBranchVertex dropped from 100 bytes to 56, or 44%.
  • SFrondVertex dropped from 108 bytes to 56, or 48%.
  • SLeafMeshVertex dropped from 104 bytes to 52, or 50%.
  • SLeafCardVertex dropped from 104 bytes to 60, or 42%.
  • SBillboardVertex dropped from 32 bytes to 20 bytes, or 38%.

3. Complete overhaul of forest population system to accommodate SPEEDTREE_HEAP_FRIENDLY_MODE. New population utility class CPopulate resides in Populate.h/cpp.

4. Several hints are passed into the SDK in order for SPEEDTREE_HEAP_FRIENDLY_MODE to work most effectively. ::Reserve() calls, too. The calls are made from CApplication::ManageMemoryReserves(), CApplication::InitGraphics(), CApplication::InitGrass(), and CApplication::InitTerrain(). More on the hints and reserves system.