SkyrimSE:Grass LOD Guide

From Step Mods | Change The Game
Delta c.png

Skyrim Special Edition Grass LOD Guide

A guide to grass LOD for Skyrim Special Edition

by: The Step Team

Guide scope

This guide intends to explain the process by which grass LOD can be generated via the grass cache files for Skyrim Special Edition. It may include some general recommendations for optimizing appearance and performance, as well as technical information that may prove useful for troubleshooting.

No Grass In Objects

No Grass In Objects is required to create the grass cache files necessary to generate the LOD for grass. It also can stop grass from growing inside rocks and other objects, and it can increase the grass draw distance beyond the loaded cells.

Settings

This section will cover the different settings and make suggestions on usage.

Raycasting

This feature is the original feature that made this tool popular, and it is the reason for the name of the mod. RayCast is recommended to be enabled to utilize this feature to eliminate grass being drawn through stones and other objects that it should not grow through. RayCastIgnoreForms setting can be used to exclude base forms that you want grass to still grow through.

RayCast = True
RayCastHeight = 150
RayCastDepth = 5
RayCastCollisionLayers = "1 2 13 20 31"
RayCastIgnoreForms = ""

Super dense grass

Super dense grass settings allow the game to produce significantly more grass without changing other settings. It is recommended not to use this feature if you can help it. Instead, it is recommended to decrease OverwriteMinGrassSize to produce dense grass if at all possible, or use a grass mod that is setup to allow for very dense grass in a more optimal manner.

SuperDenseGrass = False
SuperDenseMode = 8

Grass cache settings

It is recommended to use the grass cache by setting UseGrassCache to True. ProfilerReport can be used to see how much time is taken to generate the grass cache files.

ProfilerReport = False
UseGrassCache = True

Extended grass features

ExtendGrassDistance and ExtendGrassCount are to be set to true if you want to show grass beyond a uGridsToLoad of 5. Otherwise, these can be set to false and vanilla limits will apply.

ExtendGrassDistance = False
ExtendGrassCount = False

Vanilla INI setting overrides

EnsureMaxGrassTypesPerTextureSetting is the equivalent of iMaxGrassTypesPerTexure:Grass in Skyrim.ini. OverwriteGrassDistance is the equivalent of fGrassStartFadeDistance:Grass in SkyrimPrefs.ini. OverwriteGrassFadeRange is the equivalent of fGrassFadeRange:Grass in Skyrim.ini. OverwriteMinGrassSize is the equivalent of iMinGrassSize:Grass in Skyrim.ini. Setting any of these to -1 will revert the setting to what it is set to within the game INI files. There are many of these settings that authors like to force on the user via plugin INIs, so it is generally advised to set most of these settings here.

EnsureMaxGrassTypesPerTextureSetting=15
OverwriteGrassDistance=6144
OverwriteGrassFadeRange=14128
OverwriteMinGrassSize=60

OnlyLoadFromCache

OnlyLoadFromCache means that the game will only display grass for which it has generated grass cache files. If you find a location that is missing grass, disabling this and loading up the location should cause the game to generate the necessary grass cache file for the location. Alternatively, if you are finding an issue with floating grass or other problems with the grass in the cell, you can delete the relevant grass cache file and regenerate it by setting this to False and loading the area. For normal gameplay, set this to True.

OnlyLoadFromCache = True

Grass cache pregeneration settings

SkipPregenerateWorldSpaces allows you to set worldspaces where it will not attempt to make grass cache files. Conversely, OnlyPregenerateWorldSpaces can be used to limit grass cache generation to a specific set of worldspaces.

SkipPregenerateWorldSpaces = "DLC2ApocryphaWorld;DLC01Boneyard;WindhelmPitWorldspace"
OnlyPregenerateWorldSpaces = ""

DynDOLODGrassMode

DynDOLODGrassMode can be used to quickly set settings to conform to the method chosen. If set to 1, OverwriteGrassDistance will be set to 999999, OverwriteGrassFadeRange will be set to 0, and ExtendGrassDistance will be set to false. If set to 2, OverwriteGrassDistance will be set to 999999, OverwriteGrassFadeRange will be set to 0, and ExtendGrassDistance will be set to true. Also, the ChosenGrassGridRadius (similar to iGrassCellRadius:Grass in Skyrim.ini) will be determined based off this value.

DynDOLODGrassMode = 1

Pregenerating the grass cache

In order to improve performance, it is highly recommended to pregenerate the grass cache. Mod Organizer users can simply use the provided plugin, which will handle this automatically. Other users will need to create a PrecacheGrass.txt file in the game directory and launch the game. Precaching can take hours in some cases, especially if using grass beyond the uGridsToLoad. Crashing during this operation is expected and normal behavior; however, if it continues to crash repeatedly at a location, a problem likely exists in the modded setup that will cause a crash at that area and the precaching process will not be able to complete. The user will have to identify and fix the problem before precaching can be successfully performed. After the grass cache pregeneration process is finished, the game will display an error message that says the process completed successfully. Grass cache files will be created in a grass folder either in Overwrite for Mod Organizer users or in Data. Mod Organizer users can create a mod from the output and enable it to keep it organized. If, after the process is complete, there are no cache files, something likely is wrong with the settings utilized.

DynDOLOD

DynDOLOD is required to generate grass billboards and grass LOD. This section will cover the different settings and make suggestions on usage.

Grass cache files

Info-Logo.png

NOTE

The information presented here is technical information that is not necessary to understand to successfully use the grass cache and grass LODs. It is provided for informative purposes only.

Grass cache files are actually an unused feature of Skyrim, Skyrim Special Edition, and Fallout 4. Bethesda did have it working in original Skyrim using pre-generated grass cache files located in Skyrim - Misc.bsa, but they turned it off by default (INI setting bAllowLoadGrass:Grass) and instead forced the game to create grass every time the user loads the cell (INI setting bAllowCreateGrass:Grass). Grass cache can be generated via the CreateGrassAt console command presumably. Alternately, the grass cache can be generated by setting bGenerateGrassDataFiles:Grass to 1 in Skyrim.ini, which will create the grass cache files within a grass folder within the data directory.

Naming convention

Grass cache files are named like this: <worldspace>x<x cell coordinates padded to 4 characters with 0>y<y cell coordinates padded to 4 characters with 0>.gid. So if a grass cache file is named tamrielx-047y0038.gid, that means it applies to Tamriel <-47, 38>. No Grass In Objects renames the file extension to .cgid in order to bypass the erroneous grass cache files in Skyrim - Misc.bsa.

Hex file structure

Below is a hex file example of a grass cache file that has been stripped of the data required to populate the grass throughout the cell (essentially, it is a blank grass cache file in that it will not show any grass, despite specifying a grass.

01 00 00 00
18 00 00 00
6c 61 6e 64 73 63 61 70 65 5c 47 72 61 73 73 5c 49 76 79 2e 6e 69 66
00 00 00 5c 43 d0 bd d1 8b 00 74
01 01 00
00 00 00 00

01 00 00 00
This is the start of the file. The initial byte (01) tells the hexadecimal number of grass textures/meshes within the cell (1 in this case).

18 00 00 00
The byte at position 4 (18) tells the hexadecimal number of characters that make up the string identifying the grass mesh file location. It always includes an extra byte in its calculation. 18 translates to 24 bytes, so the string will be 23 bytes long.

6c 61 6e 64 73 63 61 70 65 5c 47 72 61 73 73 5c 49 76 79 2e 6e 69 66
This is the string identifying the grass mesh file location (landscape\Grass\Ivy.nif). As noted above, the string is 23 bytes long.

00 00 00 5c 43 d0 bd d1 8b 00 74
This seems to be unique information that relates in some way to describing the grass. It is currently unknown what it means specifically, but it seems to be tied somehow to the name and order within the file.

01 01 00
These bytes are iterated near the beginning of each grass texture/mesh identification prior to the data that tells where to place grass. They seem to serve as a kind of padding.

00 00 00 00
The first byte here needs to be 00 if there is no grass for the mesh/texture. Any other value seems to indicate that there is data following these bytes that tells the game where to place the grass. If, for example, you had it set to 01 with no data following, it will crash the game.