Level of detail
Level of detail (LOD) refers to decreasing the complexity of a model as it moves away from the camera. A model that's far away doesn't need to have as much detail as one that's close. Reducing complexity in this fashion reduces the load on rendering hardware, allowing many trees to render on screen at the same time.
SpeedTree has automatic, dynamic LOD generation. The LOD is dynamic because it changes smoothly as the distance to the tree changes, hiding any geometry pops that discreet LOD levels would otherwise cause.
Note
Automatic LOD is for real-time use. For VFX, use Resolution instead.
Previewing LOD
To turn on LOD for a tree, do one of the following:
- In the Tree Window toolbar, select LOD and enable Dynamic LOD.
- In the Tree generator properties, under Dynamic LOD, check the box for Enable.
When you turn on LOD, the LOD indicator becomes editable from the Tree Window toolbar. The same indicator appears in the bottom left corner of the Tree Window.
By default, the slider is in Manual mode. If you drag the arrow up and down in the LOD control (or hold CTRL while dragging the left mouse button up and down), the tree will dynamically change LOD. You can see the polygon counts update as this occurs.
Switch the LOD mode from Manual to Screen Area to disable any mouse input on the control. The tree will dynamically change LOD as you move the camera nearer or farther away.
Global settings
During an LOD transition, parts of the tree will be removed intelligently to reduce complexity but keep the transition seamless. This is done by analyzing the tree to see which parts are hidden in the interior. A part that will be removed shrinks until it is invisible before the geometry is completely removed in the next LOD level.
For example, branches will shrink away to their spine before ultimately going away (see below). Leaves shrink away in a similar fashion, but other leaves also grow to maintain the tree's silhouette.
To control how many parts are removed at a global level, use the LOD curves property in the dynamic lod property group in the Tree generator. With these curves, you are controlling the reduction over the course of the tree's total LOD transition. There are a number of these properties, to control the reduction of different geometry types in the tree: branches, leaves, decorations, etc.
Leaves
As previously mentioned, leaves not only shrink away but the leaves that stay will grow. You can control how much they grow with the "Grow Scale" property.
Often, leaves in the interior of the tree will be flagged for removal before those on the outside of the tree. This might result in the interior leaves being carved out, leaving just a shell around the tree. This may or may not be what you want. You can add some noisiness to this removal by adjusting the "Jumble" property.
Using "Grow Scale" and "Jumble" are key to maintaining the silhouette and keeping the "fullness" of the tree:
Individual settings
In addition to the global settings, there are additional settings on each generator for dealing with LOD. With these, you can fine-tune LOD changes to be more seamless, or reduce complexity in a more aggressive manner in places that won't be seen.
The "Dynamic LOD:Weight" property is an important one, as it influences what gets removed. When you adjust the global LOD curve for Branches, for example, you are setting how many branches you want at each level. Branches are removed based on their size and how "hidden" they are in the tree. However, modifying the "Weight" property on individual parts of the tree will influence this computation. Branches with higher weight will "win" over branches with lower weights, and will remain in the tree.
Segments
Branches and fronds can change their segments with LOD, reducing the complexity of the geometry even if it stays in the tree. This can be done explicitly for length or radial segments, or you can adjust the "Optimization" property so the Modeler will intelligently decide where to remove segments to keep the same overall shape.
Note
Too much segment reduction, especially in length, can cause visible pops. Preview the LOD switch to make sure this isn't noticeable.
Mesh LOD
On parts of the tree that can use a mesh (leaves, fronds, etc), you can switch out this mesh to lower quality versions as LOD changes.
Mesh LOD levels are set up in the Mesh Asset Bar. As the LOD curve on the "Mesh Index" property decreases, the lower LOD meshes will be chosen to place in the tree.
Similar to segment reduction, mesh LOD can cause visible pops you need to be careful to avoid. This is especially so if you are using mesh anchors to place children. If the mesh anchors move with LOD, the tree might change drastically.