zilav Posted September 28, 2014 Share Posted September 28, 2014 Generation of LOD for trees in Skyrim.Built-in in TES5Edit 3.0.33 and later versionshttp://www.afkmods.com/index.php?/topic/3750-wipz-tes5edit/To build a lod for trees, right click on a mod in TES5Edit, Other -> Generate LOD, then select worldspace(s). Only worldspaces that have terain lod are shown (have existing lodsettings file), this is required to align newly generated lod with terrain/objects lod and make them compatible. Alternatively you can rename TES5Edit to TES5LODGen and it will autobuild lod for all worldspaces in all plugins similar to TES4LODGen.LOD generation requires 2D images of trees (billboards) to be present at particular path and have specific names. The naming format isTextures\Terrain\LODGen\<PluginName>\<NifModelName>_<TreeFormID>.ddswhere<PluginName> - the name of plugin from which TREE record originates (master record). For example if a tree record from Skyrim.esm is overridden by some plugin, the used plugin name will remain Skyrim.esm since it is the master for that record.<NifModelName> - name of tree nif model without path and extension, for example Landscape\Trees\TreeAspen03.nif the used name is TreeAspen03<TreeFormID> - FormID of tree record with mod index part (leading byte) always equal to 00.Examples:TreePineForest05 [TREE:00051126] in Skyrim.esm, billboard Textures\Terrain\LODGen\Skyrim.esm\TreePineForest05_00051126.ddsDLC2TreePineForestAshL02 [TREE:02017F6D] in Dragonborn.esm, billboard Textures\Terrain\LODGen\Dragonborn.esm\TreePineForestAshL02_00017F6D.ddsAdditional parameters for LODGen are specified in optional text files that have the same names and locations as billboardsTextures\Terrain\LODGen\Skyrim.esm\TreePineForest05_00051126.txtThey have the following format like ini file [LOD] Width=566.409180 Height=1521.464722 ShiftX=0.0 ShiftY=0.0 ShiftZ=0.0 Scale=1.0 Width and Height define the size of LOD image in game units. If absent, they are calculated using Object bounds OBND field of tree record Width=X2-X1 and Height=Z2-Z1. They can be used to stretch lod trees in game without changing billboard textures.Shift(X|Y|Z) - shift references of that tree by amount, default is 0.0Scale - additional scale of refs lod image, default is 1.0All other values are ignored, for example atlas splitter also saves Model value, but it is not used by LODGen.When building trees LOD, only references of trees that have existing billboards will be included. Deleted, initially disabled, enabled via parent (XESP field) or having large rotation angles (30 < RotX, RotY < 330) references are exluded from lod.LODGen creates the following files:meshes\terrain\<Worldspace>\Trees\<Worldspace>.LST - index of trees in LODmeshes\terrain\<Worldspace>\Trees\<Worldspace>.4.*.*.BTT - lod datatextures\terrain\<Worldspace>\<Worldspace>TreeLOD.DDS - combined atlas of billboard textures in LODRemove those files and folders if you wish to uninstall generated LOD.Existing atlases splitter, accessible in Other -> Split Trees LOD Atlas menu allows to split atlas textures into billboards. It scans lod data and tries to associate trees lod indexes with TREE records, results are saved into foldertextures\terrain\LODGen\SplitAtlas_<AtlasName>Unknown lod trees will be saved with indexes number in the billboard name.Please note that TES5LODGen reads BSAs the same way as the game, and Data folder is always the winning override. Link to comment Share on other sites More sharing options...
Sheson Posted September 28, 2014 Share Posted September 28, 2014 awesome! Here is a quick n dirty ReachTree01/02, ReachCliffTree01/02 and TundraDriftWood01 for testing Everything seems to work. Do not try to split from your own LODGen generated tree LOD though - which really only happens when you test stuff, It can get cranky then when in tests you didn't do all trees FlatTreesForTES5LODGen.zip Link to comment Share on other sites More sharing options...
zilav Posted September 29, 2014 Author Share Posted September 29, 2014 Thanks!Need to test atlas splitter more, or whatever. To be honest, you need to run it only once, or maybe twice for SFO too Link to comment Share on other sites More sharing options...
lmstearn Posted September 29, 2014 Share Posted September 29, 2014 I think that I shall never see a LODGEN landscape lovely as a grove of LOD trees... Link to comment Share on other sites More sharing options...
Sheson Posted October 1, 2014 Share Posted October 1, 2014 out of curiosity, how do you determine that treeaspen05 and treeaspen06 are the same billboard? It only shows up once in the created atlas, rightfully so, like in the original. Coincidence or attention to detail? Link to comment Share on other sites More sharing options...
zilav Posted October 1, 2014 Author Share Posted October 1, 2014 Checking crc32 checksums of billboards added to atlas Link to comment Share on other sites More sharing options...
fadingsignal Posted October 3, 2014 Share Posted October 3, 2014 This is a godsend. I'm the author of "Simply Bigger Trees" and the only missing component is the LOD, which has thus far been a surprisingly confusing issue to tackle (not a lot of clear information readily available.) Pardon if this is a ridiculous question, but do the LOD NIFs that sit next to the regular tree NIFs factor into the scaling of the LOD when it is generated? Or does the text file strictly control that? Reason being is that I resized all of the LOD meshes appropriately to the size of my regular trees and am hoping that is enough to do the trick. Going to play with this a bit, any tips would be amazing. Link to comment Share on other sites More sharing options...
zilav Posted October 3, 2014 Author Share Posted October 3, 2014 lod_flat.nif files are only required by CK when generating lod, they hold information about UV location of a tree image on a premade atlas, and the size of flat mesh defines width/height of tree lod in the game. TES5LODGen generates atlas dynamically and creates own UVs each time, and reads size values from corresponding txt files or calculates them directly using object bounds field of trees (there is a right click menu option in CK named Calc bounds to update it if full meshes changed iirc), so it doesn't need flat nif files at all. It would be actually very nice if all mod authors that change trees lod will include billboard textures (and txt files if needed) in TES5LODGen format with their mods. They doesn't affect the game or CK in any way, and require just a bit of extra space. Certainly users can split atlases from existing mods themselves, but I'm not sure they will do it. The other way is me splitting atlases of all popular trees mods and shipping billboards with TES5LODGen in optional packages, but I doubt that nexus will allow it. So the situation is unfrotunate - TES5LODGen gives flexibility and solves all trees lod compatibility problems between mods changing it, but requires support from mod authors providing billboards included with their mods. And the chances for that are low considering Skyrim is 3 years old and many mod authors already moved away. Link to comment Share on other sites More sharing options...
zilav Posted October 28, 2014 Author Share Posted October 28, 2014 Wrote a small utility for myself to split existing atlases from lod_flat.nif files. Usage: put it in a separate folder, then copy lod_flat files there too and atlas image itself. Execute command like deatlas.exe SomeTreeLodAtlas.dds It will scan all trees lod nifs in the current folder and subfolders, grab their UV data and export tree images as separate dds files ready to use with TES5LODGen. deatlas.7z Link to comment Share on other sites More sharing options...
Sheson Posted November 8, 2014 Share Posted November 8, 2014 It would be a very nice addition if an output path could be selected for creating tree lod, to avoid overwriting existing files. Can be a PITA when using Mod Organizer Link to comment Share on other sites More sharing options...
zilav Posted November 8, 2014 Author Share Posted November 8, 2014 There is already, command line parameter -O:"some\path" Link to comment Share on other sites More sharing options...
Sheson Posted November 8, 2014 Share Posted November 8, 2014 brilliant, how did I miss this Link to comment Share on other sites More sharing options...
Sheson Posted November 9, 2014 Share Posted November 9, 2014 There is a mod that makes the pale actually pale by removing lots and lot of trees. http://www.nexusmods.com/skyrim/mods/59766 It removes so many trees that LODGen for trees doesn't have to generate some of the *.btt files. I wonder if it is possible for it to create empty *.btt files so they "overwrite" the files from Skyrim.bsa? Of course the current workaround is to create those empty files by hand, which works just as well. Link to comment Share on other sites More sharing options...
zilav Posted November 10, 2014 Author Share Posted November 10, 2014 To cover a 128x128 worldspace like Tamriel it will require 32x32=1024 btt files. Right now lodgen creates around 320 for Tamriel, this means creating extra 700 empty files which is a bit too much just for a mod like that imho. Better to fix that mod and instead of deleting trees move them under the ground at -30000. Easy enough with a simple TES5Edit script Link to comment Share on other sites More sharing options...
Sheson Posted November 11, 2014 Share Posted November 11, 2014 That is actually a good idea, but then tree LOD generation should ignore trees below ground level No don't! Because, all it needs is one tree per quad to generate a file, no matter where it is, so this really is a good and easy workaround. Link to comment Share on other sites More sharing options...
zilav Posted December 13, 2014 Author Share Posted December 13, 2014 Going to play with this a bit, any tips would be amazing. Going to reply here so others see this too. TES5LODGen requires 2D dds images of trees to generate LOD, there are several ways of getting them: 1. Split existing atlases using existing LOD files, instructions are in the first post. Sheson also uploaded youtube videos for DynDoLOD that have that part covered. 2. Split existing atlases using lod_flat.nif files, I uploaded my utility deatlas for that in the post above. Not all mod authors distribute those nifs since they are not requires for gameplay. 3. Generate billboard image from preview window in CK, I also made a separate tool for that 4. Create billboard image in Photoshop or by some other means. I don't work with graphical editors so can't comment on that. To generate LOD for Skysight Simply Bigger Trees mod, I split existing atlas (used the one from Detailed Terrain and Tree LOD), put Scale=1.5 in appropriate txt files for trees that were scaled up in SSBT, and generated new LOD in TES5LODGen. Link to comment Share on other sites More sharing options...
Sheson Posted February 1, 2015 Share Posted February 1, 2015 http://www.nexusmods.com/skyrim/mods/61711 This mods replaces a lot of trees with the same meshes all over again. For example 0005C072 = TreePineForestSnow01.nif 0001306D = Landscape\Trees\TreePineForest01.nif -> Landscape\Trees\TreePineForestSnow01.nif 0005D2DB = Landscape\Trees\TreePineForestSnowL01.nif -> Landscape\Trees\TreePineForestSnow01.nif When splitting the atlas only one dds/txt combo is generated per mesh filename, while it should generate basically the same combos again just with different form ids. Link to comment Share on other sites More sharing options...
zilav Posted February 2, 2015 Author Share Posted February 2, 2015 When splitting the atlas only one dds/txt combo is generated per mesh filename, while it should generate basically the same combos again just with different form ids. Damn 290MB download just to test Loaded SCO Winter Edition.esp in TES5Edit, split atlas for Tamriel, works fine. Attached results. Though "leafless" trees are square (same width and height in txt) and have empty images, but maybe it is by design. AtlasSplit_TamrielTreeLod.zip Link to comment Share on other sites More sharing options...
Sheson Posted February 2, 2015 Share Posted February 2, 2015 The leafless are black trees on black background, turn alpha on then you see them. I was scratching my head too at first Yes it splits only into 8 trees. I am expecting it to split into many more trees, even if they look the same. There are 6 different group of pines trees. The mod changes them to always be the same 5 trees. TreePineForestSnow01 to TreePineForestSnow05 Splitting atlas should create files for all of them. TreePineForest01Dead_000B927ATreePineForest02Dead_000B927BTreePineForest03Dead_000B927CTreePineForest04Dead_000B927DTreePineForest05Dead_000B927ETreePineForestSnow02Dead_000EF5A4TreePineForestSnow03Dead_000EF5A3TreePineForestSnow04Dead_000EF5A2TreePineForestSnow05Dead_000EF5A1TreePineForestSnow01_0005C072TreePineForestSnow02_0005C071TreePineForestSnow03_0005C070TreePineForestSnow04_0005C06FTreePineForestSnow05_0005C06ETreePineForestSnowL01_0005D2DBTreePineForestSnowL02_0005D2DATreePineForestSnowL03_0005D2D9TreePineForestSnowL04_0005D2D8TreePineForestSnowL05_0005D2D7TreePineForestSnowL01Dead_000EF5A0TreePineForestSnowL02Dead_000EF59FTreePineForestSnowL03Dead_000EF59ETreePineForestSnowL04Dead_000EF59DTreePineForestSnowL05Dead_000EF59CTreePineForest01_0001306DTreePineForest02_00018A02TreePineForest03_0004B016TreePineForest04_0004FBB0TreePineForest05_00051126 Link to comment Share on other sites More sharing options...
zilav Posted February 2, 2015 Author Share Posted February 2, 2015 There is only 8 entries in LST file, nothing more to split there. Splitter goes over those entries and seaches for the first match (found FormID of reference), then goes to the next one in LST. I assume you want it to to go through all possible references in case of several trees using the same texture? Link to comment Share on other sites More sharing options...
zilav Posted February 2, 2015 Author Share Posted February 2, 2015 Uploaded new version, it should save all matching trees now per LST index, not the first matching tree only. Link to comment Share on other sites More sharing options...
Sheson Posted February 3, 2015 Share Posted February 3, 2015 The alternative would be to manually copy the files to all the needed formid versions to generate correct tree LOD for such a mod. So if you can do that would really help IMHO. Link to comment Share on other sites More sharing options...
zilav Posted February 3, 2015 Author Share Posted February 3, 2015 The alternative would be to manually copy the files to all the needed formid versions to generate correct tree LOD for such a mod. So if you can do that would really help IMHO. Already uploaded version that saves billboards for all trees Link to comment Share on other sites More sharing options...
Sheson Posted February 4, 2015 Share Posted February 4, 2015 Haha missed the 2nd post because of the page break Update works like a charm! Link to comment Share on other sites More sharing options...
Sheson Posted March 20, 2015 Share Posted March 20, 2015 How to split tree LOD, to get the general idea Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now