Guide:Creating Tree LOD Models: Difference between revisions

From Step Mods | Change The Game
Line 31: Line 31:
#* Install/enable the relevant tree mod. If the mod has many different options for trees that use different model variants with same file name, or if texture paths are different, then each variation must be installed into a different mod. {{Fc|salmon|'''NOTE:''' ''Always compare the tree meshes using WinMerge of the like to be certain some are not exact duplicates. The Same LOD model would apply to each instance in that case.}}
#* Install/enable the relevant tree mod. If the mod has many different options for trees that use different model variants with same file name, or if texture paths are different, then each variation must be installed into a different mod. {{Fc|salmon|'''NOTE:''' ''Always compare the tree meshes using WinMerge of the like to be certain some are not exact duplicates. The Same LOD model would apply to each instance in that case.}}
#:Example: EVT has Basic and Lush options, and both have SFO and RAT options as well as dark mesh options, while only the Lush option has large trees, so the mods installed might be ...
#:Example: EVT has Basic and Lush options, and both have SFO and RAT options as well as dark mesh options, while only the Lush option has large trees, so the mods installed might be ...
#*:* EVT-Basic
#:* EVT-Basic
#*:* EVT-Basic-Darker
#:* EVT-Basic-Darker
#*:* EVT-Lush
#:* EVT-Lush
#*:* EVT-Lush-Darker
#:* EVT-Lush-Darker
#*:* EVT-Lush-Large
#:* EVT-Lush-Large
#*:* EVT-Lush-Large-Darker
#:* EVT-Lush-Large-Darker
#*:* EVT-SFO
#:* EVT-SFO
#*:* EVT-RAT
#:* EVT-RAT
# Copy <code>..\DynDOLOD\docs\trees.ultra\tools\emptypassthru_lod.nif</code> into the following new files. These will be used as templates for the trunks/crowns. Replecating theme here makes them always available for use in future iterations:
# Copy <code>..\DynDOLOD\docs\trees.ultra\tools\emptypassthru_lod.nif</code> into the following new files. These will be used as templates for the trunks/crowns. Replecating theme here makes them always available for use in future iterations:
#* <code>..\DynDOLOD\docs\trees.ultra\tools\empty_trunk.nif</code>
#* <code>..\DynDOLOD\docs\trees.ultra\tools\empty_trunk.nif</code>

Revision as of 21:11, January 6, 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, 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 user error, since texture paths on BSShaderTextureSet node are automatically created via LODGen in the hybrid.bat process). ~z929669 Ixian Insignia.png Talk 20:39, January 4, 2022 (UTC)

7-zip context menu options
  1. Install 7-zip and be sure to configure its Explorer shell context menu options to provide a CRC32 lookup (see image at right).
  2. Use a MO profile that is lightly modded without a bunch of replacers that could conflict with the tree mod (TexGen may also run a bit faster):
    • Configure relevant Tools, and consider reviewing the System Setup Guide to configure the modding environment.
    • Enable SKSE and all other "engine-level" Extender mods and Resource mods.
    • The profile will obviously need DynDOLOD configured with DynDOLOD Resources mod.
    • Install/enable the relevant tree mod. If the mod has many different options for trees that use different model variants with same file name, or if texture paths are different, then each variation must be installed into a different mod. NOTE: Always compare the tree meshes using WinMerge of the like to be certain some are not exact duplicates. The Same LOD model would apply to each instance in that case.
    Example: EVT has Basic and Lush options, and both have SFO and RAT options as well as dark mesh options, while only the Lush option has large trees, so the mods installed might be ...
    • EVT-Basic
    • EVT-Basic-Darker
    • EVT-Lush
    • EVT-Lush-Darker
    • EVT-Lush-Large
    • EVT-Lush-Large-Darker
    • EVT-SFO
    • EVT-RAT
  3. Copy ..\DynDOLOD\docs\trees.ultra\tools\emptypassthru_lod.nif into the following new files. These will be used as templates for the trunks/crowns. Replecating theme here makes them always available for use in future iterations:
    • ..\DynDOLOD\docs\trees.ultra\tools\empty_trunk.nif
    • ..\DynDOLOD\docs\trees.ultra\tools\empty_passthru_lod.nif
  4. Now copy each of these into the working directories so they remain conveniently available while working on each tree model:
    1. In MO, right click on the relevant tree mod
    • DynDOLOD\Render\Billboards\DynDOLOD\lod\trees\empty_trunk.nif