Guide:Creating Tree LOD Models: Difference between revisions

From Step Mods | Change The Game
Line 7: Line 7:


== General Procedure ==
== General Procedure ==
LOD models should contain only BSTriShape or NiTriShape nodes from the base model copied/pasted into an 'empty' NIF using [https://github.com/niftools/nifskope/releases 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.
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 [https://github.com/niftools/nifskope/releases 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 <code>..\DynDOLOD\docs\trees.ultra\tools\emptypassthru_lod.nif</code> and then renaming this into <code>meshes\DynDOLOD\lod\trees\[TreeName]_[CRC32]passthru_lod.nif</code> 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.
* '''Standard LOD models''' can be created by simply copying each node into an instance of <code>..\DynDOLOD\docs\trees.ultra\tools\emptypassthru_lod.nif</code> and then renaming this into <code>meshes\DynDOLOD\lod\trees\[TreeName]_[CRC32]passthru_lod.nif</code> 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 <code>..\DynDOLOD\docs\trees.ultra\tools\emptypassthru_lod.nif</code> saved into two separate files (one for crown and another for trunk).
* '''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 <code>..\DynDOLOD\docs\trees.ultra\tools\emptypassthru_lod.nif</code> saved into two separate files (one for crown and another for trunk).

Revision as of 04:13, January 5, 2022

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, step-by-step guide to a workflow devised by z929669. 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. This can be done by either using unique tree names for assets and plugin references, or by incorporating the CRC32 checksum of the full tree model into the file names and path references of corresponding LOD assets, which is the de facto standard.

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)