There are numerous techniques to reduce memory usage in the SDK and the SpeedTree Modeler application. To monitor how much heap space and vertex/index buffer memory the SDK is using, see Tracking Resource Usage. To reduce areas of possible excess memory use, follow these guidelines.
Loading .stsdk files can consume a fair amount of memory (specifically, the size of the .stsdk file reflects that amount of RAM it will take to load), but there are some measures that can be taken to reduce memory usage after the .stsdk file is loaded:
CCore::DeleteGeometry()
on the loaded object to delete the internal copies of the vertex and index buffers, which represent the bulk of the memory allocated by the load function.CCore::ShutDown()
. It's a static function that will clear up the last remaining memory used by the SDK.There are a number of steps that artists can take to lower memory usage when creating assets in the SpeedTree Modeler.
CCore::DeleteGeometry()
, this memory will reside on the GPU, not in system RAM.Outside of the Core library, where per-tree memory costs are paramount, the Forest library's memory consumption is directly related to the number of visible tree/grass instances.
A common mistake is employing too large a draw distance. Long draw distances impact both memory and performance in the following ways:
CVisibleInstances
class to represent the visible 3D trees, their LOD values, and all of the visible billboards.Use the heap reserve system in the SDK to set limits for various quantities, receiving warnings in most cases when the limits are exceeded.