Guide:Creating Tree LOD Models

From Step Mods | Change The Game
Delta c.png

Creating Tree LOD Models

A Quick Start to One Approach

by: The Step Team

Purpose & Background

For complete reference, see the official DynDOLOD documentation describing this process. This is meant to be a simplified, quick-start guide. The goal is to aid other mod authors in operationalizing the methods described in the official documentation in order to produce LOD for their tree mods or for updates to existing tree mods.

Like most object LOD, DynDOLOD-compatible tree LOD uses a simplified LOD model 'imposter' or 'dummy' version of the full model in order to render trees in object LOD while keeping the performance hit to a minimum. In order to accomplish this, DynDOLOD must be able to associate the LOD model with its corresponding full model, which can be problematic with the "rule of one", because these are 'paired' assets (each tree mesh has a single corresponding LOD mesh). This can be done in one of three ways (in order of descending preference):

  • Option 1 - Using unique (new) tree names via plugin and for LOD assets - LOD asset conflicts with other mods are not possible. This is the preferred approach.
  • Option 2 - Incorporating the CRC32 checksum of the full tree model into the LOD asset names - LOD asset conflicts are not possible. This is the de facto standard, since most existing tree mods reuse vanilla tree names or those from other tree mods.
  • Option 3 - (not recommended) Reusing existing tree names (from vanilla or other tree mods) for LOD assets - LOD asset conflicts are possible.

General Procedure

LOD models should contain only BSTriShape or NiTriShape nodes (and on rare occasions, NiNode) from the base model copied/pasted into an 'empty' NIF using NifSkope, and removing any Parallax and Tree_Anim Shader Flags [1|2] from BSLightingShaderProperty nodes. This is a relatively simple task for most trees, but skinned trees or trees using BSMultiBoundNode can be a little trickier. Only the visually obvious nodes need to be copied (trunk and crown) and not the small details that will not be apparent at the distance of LOD. Click on the trunk and crown in the NIF viewer to expose the relevant nodes in the left pane of NifSkope.

  • Standard LOD models can be created by simply copying each node into an instance of ..\DynDOLOD\docs\trees.ultra\tools\emptypassthru_lod.nif and then renaming this into meshes\DynDOLOD\lod\trees\[TreeName]_[CRC32]passthru_lod.nif of the tree mod where 'TreeName' is the base file name of the reference mesh and 'CRC32' is the CRC32 checksum of the reference mesh. The tree LOD model is ready for use by DynDOLOD end users.
  • Hybrid LOD models will be more performance friendly, since they use flat trunks with between 4-8 triangles rather than the 'full' trunks which usually have upwards of tens to hundreds of polygons. These also require more work to construct, but uses the same ..\DynDOLOD\docs\trees.ultra\tools\emptypassthru_lod.nif saved into two separate files (one for crown and another for trunk).
    1. Copy trunk nodes into DynDOLOD\Render\Billboards\DynDOLOD\lod\trees\[TreeName]_[CRC32]_trunk.nif of the target mod in the mod list.
    2. Copy crown nodes into ..\Any\Path\Outside\Of\Mod\List\[TreeName]_[CRC32]_trunk.nif of the target mod in the mod list.
    3. Run TexGen 3 with only the "Render" option ticked to generate output containing the new trunk billboard textures. NOTE: The tree mod with added trunks must be enabled in the mod list.
    4. Use ..\DynDOLOD\docs\trees.ultra\tools\hybrids\hybrid.bat to combine the crown and flat trunks into the final LOD model, and place this into meshes\DynDOLOD\lod\trees\[TreeName]_[CRC32]passthru_lod.nif of the tree mod. The tree LOD model is ready for use by DynDOLOD end users.

Specific Workflow

Theoretically, one can do a whole bunch of trees from one working folder. In such cases, adding the CRC32 to the file names may be considered relatively tedious, since there is an xEdit script packaged with the DynDOLOD tools that can be used for those that want to spend the time to figure it out: ..\DynDOLOD\docs\trees.ultra\tools\DynDOLOD_CRC32Gen.pas

Because most tree mods don't cover a lot of trees or reuse the same tree mesh names for many different optional variants, the xEdit CRC32 script may be more trouble that it's worth. It might be more convenient for updating changed CRC and internal texture paths (if it does this).

The following is what works best for me (I never update LOD, as I think creating from scratch is less work and less prone to my own errors). ~z929669 Ixian Insignia.png Talk 20:39, January 4, 2022 (UTC)