Jump to content
  • 0

3D Static Object Trees LOD - A Few Questions


exploiteddna

Question

Having read these docs, im still somewhat confused on generating 3d static object lod when using tree replacer mods like realistic aspen trees, etc. 

Docs/trees.ultra/DynDOLOD-Trees.html

Docs/trees.ultra/tools/DynDOLOD_CreateStaticTree.html

 

I have quite a few questions, but we can start with this. In the base resources for sse dyndolod, there is included several treeaspenXpassthru_lod.nif that i assume will be used when you generate 3d SO lod for these trees. But, realistic aspen trees mod is just a replacer, so how will dyndolod know it should use treeaspenX_XXXXXXXXpassthru_lod.nif in \Meshes\DynDOLOD\lod\trees\rat\ instead of default ones?

Link to comment
Share on other sites

Recommended Posts

  • 0

See DynDOLOD\Docs\trees.ultra\tools\DynDOLOD_CreateStaticTree.html for explanation of the CRC32 checksum which is used to match trees to tree LOD resources.

maybe i dont understand how checksum works, but if you have assets for 3 different mods (2 mods, 1 vanilla) that have a replacer mesh for treepineforest01..  you make your static mesh with animation removed and youre left with these versions of treepineforest01 in the assets directory, like so:

 

Meshes\DynDOLOD\lod\trees\custom-mod-1\treepineforest01_8E204123passthru_lod.nif

Meshes\DynDOLOD\lod\trees\custom-mod-2\treepineforest01_5C275A0Fpassthru_lod.nif

Meshes\DynDOLOD\lod\trees\treepineforest01passthru_lod.nif

 

Youre saying that the 8E204123 checksum corresponds to the full mesh that was used to generate the 3D static mesh? If so, how does it know to look in Meshes\DynDOLOD\lod\trees\custom-mod-1\ instead of Meshes\DynDOLOD\lod\trees\custom-mod-2\ or any other directory? For the realistic aspen trees 3d statics that are included with dyndolod se, they are all found in \rat\ directory. If i create my own 3d statics, should i just make a separate folder and call it whatever i want, or does it matter?

 

Also, the documentation says "Start xEdit.exe, unfold TREEs, mark trees you want to work on and then apply script DynDOLOD_CRC32Gen.pas". Is this still valid or has this changed since dyndolod now runs its own executable? 

Link to comment
Share on other sites

  • 0

As I keep mentioning every chance I get, different folders do not matter, only different filenames.

 

See DynDOLOD_Mod_Authors.html "How to add your own LOD models" which explains the scanning of subfolders in meshes in general for different LOD objects.

 

So for 3D tree LOD, it tries to find LOD files with part of the full mesh file name + the full CRC32 in any subfolder of "meshes" unless the folder path matches the IgnoreLODMesh= list defined in the DynDOLOD.

 

You can create any folder structure that makes sense to you as long as it is in meshes and not accidentally matches the IgnoreLODMesh list.

 

The instructions how to run the DynDOLOD_CRC32Gen.pas should still be valid.

Edited by sheson
Link to comment
Share on other sites

  • 0

As I keep mentioning every chance I get, different folders do not matter, only different filenames.

 

See DynDOLOD_Mod_Authors.html "How to add your own LOD models" which explains the scanning of subfolders in meshes in general for different LOD objects.

 

So for 3D tree LOD, it tries to find LOD files with part of the full mesh file name + the full CRC32 in any subfolder of "meshes" unless the folder path matches the IgnoreLODMesh= list defined in the DynDOLOD.

 

You can create any folder structure that makes sense to you as long as it is in meshes and not accidentally matches the IgnoreLODMesh list.

 

The instructions how to run the DynDOLOD_CRC32Gen.pas should still be valid.

trust me i know how it is to explain thing you feel are obvious or that you are repeating a lot. but ive not seen this mentioned before and ive been reading the documentation over and over, trying to make sense of everything. If you put this info in the DynDOLOD_CreateStaticTree.html file, it would be helpful. To be fair, I do remember reading in one of the other docs something that said (paraphrasing) "if any of this guide is not clear to you, let me know.. and some info may be inaccurate or outdated" .. so, here I am  ::D:

 

So, ive been able to generate the beginnings of static meshes, with the checksums in the filename and added the passthru string 

33ca7a280a9dd9b4886b0760ef9380b7.png

 

My merge.txt is as follows:

GameMode=Merge5
Worldspace=merged
DontMergeShapes=False
PassThruMeshMask=nif
PathData=C:\trees
PathOutput=C:\trees\3DTP
0	0	0.0	0.0	0.0	0.0	0.0	0.0	1.0	deadshrub01_BCC09B0Apassthru_lod.nif

It seems it cannot read my directory, I have tried changing the path, using quotes, not using quotes, etc etc... Here is the output:

============================================================
Skyrim Object LOD Generator 2.3.1.0
Created by Ehamloptiran and Zilav
Updated by Sheson

Log started at 10:02:55 PM
Game Mode: MERGE5
Fix Tangents: False, False, False, False
Generate Tangents: True, True, True, True
Generate Vertex Colors: True, True, True, True
Merge Vertex Colors: False, False, False, False
Merge Meshes: True
Grouping: False
Remove Faces under Terrain: False
Remove Faces under Water: False
Use HD Flag: True
Ignore Materials: False
Alpha DoubleSided: False
Default Alpha Threshold: 128
Use Source Alpha Threshold: False
Use Backlight Power: False
Use Decal Flag: False
Global scale: 1.00
Specific level: No
Specific quad: No
Max Level: 32
Output: C:\trees\3DTP
Merging meshes

deadshrub01_BCC09B0Apassthru_lod.nif not found
Log ended at 10:02:55 PM
Code: 404

Oddly enough, if I remove the GameMode variable in the config, it still says it cannot find the *.nif, but it succeeds in generating worldspace bto files. Here is the log output

============================================================
Skyrim Object LOD Generator 2.3.1.0
Created by Ehamloptiran and Zilav
Updated by Sheson

Log started at 10:10:09 PM
Game Mode: TES5
Fix Tangents: False, False, False, False
Generate Tangents: True, True, True, True
Generate Vertex Colors: True, True, True, True
Merge Vertex Colors: False, False, False, False
Merge Meshes: True
Grouping: False
Remove Faces under Terrain: False
Remove Faces under Water: False
Use HD Flag: True
Ignore Materials: False
Alpha DoubleSided: False
Default Alpha Threshold: 128
Use Source Alpha Threshold: False
Use Backlight Power: False
Use Decal Flag: False
Global scale: 1.00
Specific level: No
Specific quad: No
Max Level: 32
Output: C:\trees\3DTP
Generating object LOD for worldspace merged

deadshrub01_BCC09B0Apassthru_lod.nif not found
Finished LOD level 8 coord [0, 0] [0/0]
Finished LOD level 16 coord [0, 0] [0/0]
LOD level 16 total triangles 0 reduced to 0
LOD level 8 total triangles 0 reduced to 0
Log ended at 10:10:09 PM
Code: 404

So im sorry but i just dont know what to do from here. Not sure what im doing wrong so that it cant find the nif. You can see in my screenshot the full path of the directory, and then see the PathData var in my config.. and youll see that it is configured properly (at least with regard to paths). A tiny bit of assistance would be great, as I do not know what i can do to troubleshoot.. im all out of ideas

Link to comment
Share on other sites

  • 0

Don't worry about it. The docs are a bit scattered here and there, since they are grown over the years.

 

PathData requires a trailing \

 

So if you set PathData=C:\trees\ it should work I think. I will add that info to the DynDOLOD_CreateStaticTree.html

Edited by sheson
Link to comment
Share on other sites

  • 0

 

Don't worry about it. The docs are a bit scattered here and there, since they are grown over the years.

 

PathData requires a trailing \

 

So if you set PathData=C:\trees\ it should work I think. I will add that info to the DynDOLOD_CreateStaticTree.html

i thought i had tried that but i guess not; that worked. However, i thought this was supposed to generate a nif file with animations etc removed. For me it is creating 3 *.bto files. One of them is ~130 KB and the other two are only 1KB in size. If i change the large one to .nif file, it opens in nifskope just fine. But im not sure if this is what I should do, or if there is a way to input NIF and output NIF.

 

My config is: 

GameMode=skyrim_se
Worldspace=merged
DontMergeShapes=False
PassThruMeshMask=nif
PathData=C:\trees\
PathOutput=C:\trees\3DTP
0	0	0	0	0	0	0	0	1	deadshrub01_BCC09B0Apassthru_lod.nif

The output files are merged.16.0.0merged.8.0.0merged.4.0.0 - it is the 4.0.0 level file that i can open in nifskope by changing extension.

 

 

Also, is there any way to get it to process the entire folder instead of having to paste the name of every mesh? Im sure there is, Im just not very good at writing batch script. I tried to use a wildcard * but it didnt work correctly

Link to comment
Share on other sites

  • 0

I case the GameMode does not exist it will default to creating static object LOD for TES5.

 

You either want to use Merge5 or Convert5 or maybe try ConvertSSE.

 

Each mesh you want to convert needs a line in the file. Using the windows command prompt with the command "dir /B > file.txt " you can "export" all filenames in a folder into a text file.

Then edit the text file to add the other required data.

Edited by sheson
Link to comment
Share on other sites

  • 0

yeah im familiar with how to output dir to txt file. so i will try those other modes you listed.

 

then i can make a merge.txt that looks like this and it should process all files?

GameMode=convert5
Worldspace=merged
DontMergeShapes=False
PassThruMeshMask=nif
PathData=C:\trees\
PathOutput=C:\trees\3DTP
0	0	0	0	0	0	0	0	1	<tree>_<crc32>passthru_lod.nif
0	0	0	0	0	0	0	0	1	<tree>_<crc32>passthru_lod.nif
0	0	0	0	0	0	0	0	1	<tree>_<crc32>passthru_lod.nif
0	0	0	0	0	0	0	0	1	<tree>_<crc32>passthru_lod.nif
...
...
...

thx sheson. once i get this all working i will be sharing the assets with the authors of the respective mods (i.e. mathy79) so they can post on mod page and other users dont have to learn how to do this. thx again :muscle:

 

 

EDIT: funny thing is, i just ran it against all 118 meshes that I am converting, and it worked, but the resultant meshes are larger file size than the original meshes. 

combined size of original meshes is 25.8 MB, and after convert5 process, combines disk size is 46.6 MB. As long as animation is removed i dont really care, unless you think this is a problem

Link to comment
Share on other sites

  • 0

Sounds like the input are NIF in Skyrim SE format, while the output is now in Skyrim format. Try ConvertSSE.

 

Check the created NIFs in nifskope, they should only have the relevant NiTriShape/NiTriShapData (or BSTriShape)

 

For NIFs that are used to build object LOD meshes the format does not really matter.

Link to comment
Share on other sites

  • 0

when i run with `convertSSE` option, the resulting meshes are 24.8 MB, and the source meshes are 25.8. So it seems ok, the meshes with animation removed are slightly smaller in size, which makes sense. I believe this is the last step of the process, I can now just install these meshes to my assets and regenerate dyndolod and see if it all works

Link to comment
Share on other sites

  • 0

@sheson

 

when i set TreeFullFallBack=1 the process of generating dyndolod output is VERY lengthy. I also get a lot of this messsage:

Could not re-UV meshes\dyndolod\lod\trees\3dtp\treepineforestsnow05_026d7a95passthru_lod.nif treepineforestsnow01 The given key was not present in the dictionary.
Could not re-UV meshes\dyndolod\lod\trees\3dtp\treepineforestsnow05_026d7a95passthru_lod.nif treepineforestsnow01 The given key was not present in the dictionary.
Could not re-UV meshes\dyndolod\lod\trees\3dtp\treepineforestsnow05_026d7a95passthru_lod.nif treepineforestsnow01 The given key was not present in the dictionary.
Could not re-UV meshes\dyndolod\lod\trees\3dtp\treepineforestsnow05_026d7a95passthru_lod.nif treepineforestsnow01 The given key was not present in the dictionary.
Could not re-UV meshes\dyndolod\lod\trees\3dtp\treepineforestsnow05_026d7a95passthru_lod.nif treepineforestsnow01 The given key was not present in the dictionary.
Could not re-UV meshes\dyndolod\lod\trees\3dtp\treepineforestsnow05_026d7a95passthru_lod.nif treepineforestsnow01 The given key was not present in the dictionary.
Could not re-UV meshes\dyndolod\lod\trees\3dtp\treepineforestsnow05_026d7a95passthru_lod.nif treepineforestsnow01 The given key was not present in the dictionary.
Could not re-UV meshes\dyndolod\lod\trees\3dtp\treepineforestsnow05_026d7a95passthru_lod.nif treepineforestsnow01 The given key was not present in the dictionary.
Could not re-UV meshes\dyndolod\lod\trees\3dtp\treepineforestsnow05_026d7a95passthru_lod.nif treepineforestsnow01 The given key was not present in the dictionary.
Could not re-UV meshes\dyndolod\lod\trees\3dtp\treepineforestsnow05_026d7a95passthru_lod.nif treepineforestsnow01 The given key was not present in the dictionary.
Could not re-UV meshes\dyndolod\lod\trees\3dtp\treepineforestsnow05_026d7a95passthru_lod.nif treepineforestsnow01 The given key was not present in the dictionary.

is there any way to address this? 

Link to comment
Share on other sites

  • 0

@sheson

 

when i set TreeFullFallBack=0 the process of generating dyndolod output is VERY lengthy. I also get a lot of this messsage:

Could not re-UV meshes\dyndolod\lod\trees\3dtp\treepineforestsnow05_026d7a95passthru_lod.nif treepineforestsnow01 The given key was not present in the dictionary.
Could not re-UV meshes\dyndolod\lod\trees\3dtp\treepineforestsnow05_026d7a95passthru_lod.nif treepineforestsnow01 The given key was not present in the dictionary.
Could not re-UV meshes\dyndolod\lod\trees\3dtp\treepineforestsnow05_026d7a95passthru_lod.nif treepineforestsnow01 The given key was not present in the dictionary.
Could not re-UV meshes\dyndolod\lod\trees\3dtp\treepineforestsnow05_026d7a95passthru_lod.nif treepineforestsnow01 The given key was not present in the dictionary.
Could not re-UV meshes\dyndolod\lod\trees\3dtp\treepineforestsnow05_026d7a95passthru_lod.nif treepineforestsnow01 The given key was not present in the dictionary.
Could not re-UV meshes\dyndolod\lod\trees\3dtp\treepineforestsnow05_026d7a95passthru_lod.nif treepineforestsnow01 The given key was not present in the dictionary.
Could not re-UV meshes\dyndolod\lod\trees\3dtp\treepineforestsnow05_026d7a95passthru_lod.nif treepineforestsnow01 The given key was not present in the dictionary.
Could not re-UV meshes\dyndolod\lod\trees\3dtp\treepineforestsnow05_026d7a95passthru_lod.nif treepineforestsnow01 The given key was not present in the dictionary.
Could not re-UV meshes\dyndolod\lod\trees\3dtp\treepineforestsnow05_026d7a95passthru_lod.nif treepineforestsnow01 The given key was not present in the dictionary.
Could not re-UV meshes\dyndolod\lod\trees\3dtp\treepineforestsnow05_026d7a95passthru_lod.nif treepineforestsnow01 The given key was not present in the dictionary.
Could not re-UV meshes\dyndolod\lod\trees\3dtp\treepineforestsnow05_026d7a95passthru_lod.nif treepineforestsnow01 The given key was not present in the dictionary.

is there any way to address this? 

 

"Untile" the textures manually so that the UV is >= 0 and treepineforestsnow05_026d7a95passthru_lod.nif I can have a look.

Edited by sheson
Link to comment
Share on other sites

  • 0

funny thing is, it seems i have 2 versions of that file, both have the same hash .. not sure how thats possible. but they were made separately, one from Skyrim Flora Overhaul (trees only) and the other from 3D Trees and Plants

 

"C:\Gaming\Elder Scrolls\SkyrimSE\Mod Organizer\mods\DynDOLOD - Main\Meshes\DynDOLOD\lod\trees\SFO\treepineforestsnow05_026D7A95passthru_lod.nif"

 

"C:\Gaming\Elder Scrolls\SkyrimSE\Mod Organizer\mods\DynDOLOD - Main\Meshes\DynDOLOD\lod\trees\3DTP\treepineforestsnow05_026D7A95passthru_lod.nif"

 

 

both of them i made myself using the full meshes that come with the respective mod. this is a small little guide i wrote for myself so that I know how I made the optimized meshes. this is what I did:

1. rename tree mesh files by appending _passthru_lod the end of the filename
2. move all the meshes you need to be processed into ..\Data\DynDOLOD-Source\
3. in xEdit, right click the top of the tree records branch, called "Tree" ... select `Apply Script` and choose DynDOLOD_CRC32Gen.pas (make sure that script is installed in your xEdit "Edit Scripts" folder)
4. all the meshes in ..\Data\DynDOLOD-Source\ should now have the CRC32 checksum added to their name
5. make sure merge.txt is configured according to what you need (GameMode=ConvertSSE, PathData= , PathOutput= )
6. run merge.bat and all the meshes should be processed to remove animation
7. place in custom folder in ..\Meshes\DynDOLOD\lod\trees\<custom-folder>

3DTP - treepineforestsnow05_026D7A95passthru_lod.7z

SFO - treepineforestsnow05_026D7A95passthru_lod.7z

Link to comment
Share on other sites

  • 0

The CRC32 is created from the full model that is installed at the time. Make sure the correct mod and assets are enabled. Collisions are possible of course. If you are positive that two different full models created the same CRC32 upload them.

 

Here is an updated version of LODGen.exe/LODGenx64.exe to replace in the Edit Scripts folder. If will now properly re-UV the trunk with the name treepineforestsnow01 in 3DTP treepineforestsnow05_026D7A95passthru_lod without the error message. Re-UV happens because the UV of the trunk is outside of 0 and 1 and it needs to be converted in order to use the atlassed texture.

 

However, without providing a proper LOD texture you may not really want to let it do it that, as that will increase the triangle count considerably. Your options are to edit the shape name (currently treepineforestsnow01) and add NoReUV to it, so LODGen will skip that step entirely. The case of NoReUV doesn't matter, can be in front or after the existing name, with or without space. You can easily edit the name of a shape with nifskope.

 

If there lots of these trees in an area, there is no huge advantage to use a texture on the atlas (saves draw calls) instead of one large shape (combined from lots of trees) using a single texture. Typically object LOD uses the single mountainslab texture too for example, because all rocks and mountains use it everywhere anyways. So it is either less triangles / more draw calls or more triangles / less draw calls.

 

In order to have a good re-UV without increasing triangles count too much, you can use TexGen to automatically create a LOD texture for the trunk whenever the plugin for the tree mod is in the load order. DynDOLOD_Mod_Authors.html explains how to add rules for TexGen for a mod and place it in the games Data/DynDOLOD folder so it can be shipped with the mod.

 

Since I was testing things already you can download this as an example. If you open the file in notepad you can see some commented (//) rules for 2x1 and 2x2 versions as well the active one for 2x4. Which means the LOD textures uses a "mini atlas" of the full model textures tiled 2 times in U and 4 times in V. Obviously there should be only one "active" rule for each input/output texture.

Once TexGen created the LOD texture, DynDOLOD and the LODGen will pick this up and the result of the automatic re-UV will be much better, since less new triangles have to be created to keep the UV within 0 and 1 - since it basically means UV now can be between 0 to 2 for U and 0 to 4 for V while using the object LOD atlas texture, resulting in less draw calls.

 

Without further reduction in triangle count there is no much difference over simply using the full model back. I recommend to further optimize the NIFs by replacing the trunks with billboards if possible (the SFO version for example) and/or trying to decimate 3D models with 3DSMax/Blender or other tools. For "complicated" flora/fauna using Simplygon to create "imposters" seems the way to go though.

Link to comment
Share on other sites

  • 0

i really appreciate the detailed reply. so much of this is way beyond my skill level. much of what you said is lost on me. Im really just trying to find the easiest way of making 3D static object LOD for my game instead of using billboards textures that i think look less realistic. I will check the two versions of the treepineforestsnow05 and make sure there wasnt a mixup. Im using partial sets from each mod. Im using 3D Trees and Plants as my highest priority, but I have disabled some of its assets that I dont like the look of. So, for example, I disabled/deleted the treepineforestsnow05 model from 3DTP, and installed the one from SFO instead. However, the 3DTP plugin is still active when I run the crc32 PAS script.

 

As far as all of this re-UV stuff goes... i have no idea what any of that is doing. I am not trying to mess with the UV map of any meshes.. that error i showed you was just an error I was being given when i tried to generate my dyndolod for my current game. I see in your documentation that you say UV coordinates need to be clamped so that the textures for the meshes being used in static object lod can be put into atlas. maybe this is what youre talking about.

 

im just doing my best to follow the guidelines in DynDOLOD_CreateStaticTree.html and also the Ultra Trees part of DynDOLOD-Trees.html

 

 

also, for the catch all rule for all trees, should it be

Mesh mask	LOD 4		LOD 8		LOD 16		VWD	Grid	   Reference
tree		Static LOD4	Static LOD8    Static LOD16	Yes	Far LOD	   Unchanged

Or would it be better to have it like 

Mesh mask	LOD 4		LOD 8		LOD 16		VWD	Grid	   Reference
tree		Static LOD4	Billboard	Billboard	Yes	Far LOD	   Unchanged
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Guidelines, Privacy Policy, and Terms of Use.