Grass LOD

Left vanilla no grass LOD. Right DynDOLOD with grass LOD.

Full grass only renders in active cells. No Grass In Objects can render grass outside the active cells in the LOD area. Since that becomes performance intensive very quickly, consider generating grass LOD.

Grass LOD is currently only supported for Skyrim Special Edition and Enderal SE.

Grass LOD uses grass LOD billboards in object LOD, similar to ultra tree LOD. TexGen can be used to automatically generate the grass LOD billboards. TexGen supports generating HD grass LOD billboards using ENB complex grass textures. Grass LOD is generated for LOD level 4 only.

Grass LOD generation requires a warmed (current) grass precache from No Grass In Objects for the current load order. It uses the *.CGID files found in the ..\Data\Grass\ folder. Check out Worldspaces with Grass SSEEdit Script for No Grass In Objects, it helps speeding up the grass cache generation.

The grass cache contains grass model and placement information. Changing only the grass textures typically does not require updating the grass cache - just updating grass LOD billboards with TexGen as explained below.

No Grass In Objects is currently only available for Skyrim Special Edition runtime version 1.5.x. The grass LOD generation however does not care about the runtime version, so the grass cache files can still be used to generate grass LOD with the runtime 1.6.x. For example, it is possible to downgrade a second profile in order to generate the grass cache. To use the *.CGID grass cache files in other runtime versions, use Grass Cache Helper NG.

Using the grass cache made by somebody else for a different load order for grass LOD generation only but not in game, means that grass LOD and full grass are not going to match placements. How noticeable the placement differences depends on the differences between the load orders.

See the explanations at Seasons how generate and use the grass cache files for every season, so grass LOD switches accordingly.

Settings

Use version 6 or higher of No Grass In Objects.

Set UseGrassCache = True and OnlyLoadFromCache = True in ..\NetScriptFramework\Plugins\GrassControl.config.txt.

With No Grass In Objects full grass can render past the active cells, so Grass LOD can either start right beyond the active exterior cells (uGridsToLoad) which equals to Mode/DynDOLODGrassMode=1 (better for performance) or beyond the large reference distance (uLargeRefLODGridSize) which equals to Mode/DynDOLODGrassMode=2. If No Grass In Objects is not used, set Mode to 1, obviously.

Set the desired Mode in the advanced mode of DynDOLOD under the Grass LOD checkbox and for DynDOLODGrassMode in ..\NetScriptFramework\Plugins\GrassControl.config.txt. While the DynDOLODGrassMode can be changed at any time, the Mode used to generate grass LOD is baked into the object LOD meshes. See Updating below how to update the object LOD meshes.

In case the grass LOD brightness or color seems off (it might depend on weathers or ENB settings), try different Direct/Ambient settings for grass LOD billboards in TexGen. In addition or alternatively change the GrassBrightnessTop*/ComplexGrassBrightnessTop* and GrassBrightnessBottom*/ComplexGrassBrightnessBottom* settings in ..\DynDOLOD\Edit Scripts\DynDOLOD\DynDOLOD_SSE.ini - those settings help if the color tone is off. Especially the image based lighting effect from ENB has a big impact on the brightness and color tone of the grass LOD. Additional complex grass lighting and time of day settings will obviously not apply to object LOD, as they are separate meshes and shaders. Do not use them so full grass and grass LOD match better for all weathers/times.

When using complex grass and the side facing away from the light direction is too dark it can be brightened with the backlightmask. In the ..\DynDOLOD\Edit Scripts\DynDOLOD\DynDOLOD_SSE.ini set ComplexGrassBillboard=5 and set ComplexGrassBacklightMask to a value like 25, which means 25% of the light is applied to the side facing away from the light source. If the result is too dark, raise the value. If the result is too bright, lower the value.

Change the Density dropdown to a lower value in the advanced mode of DynDOLOD under the Grass LOD checkbox to thin out grass LOD for better performance. Note that HD Grass LOD billboards for ENB complex grass use double the triangles, so in case performance is of concern, use half the density, 50% or less.

In case the grass pre-cache was generated with SuperDenseGrass = True, expect really long object LOD generation times. Lower the density to 33% or less.

Internal Billboards and External Billboards

By default grass LOD uses a so called internal billboard in object LOD. 2 planes cross each other at a 90 degree angle very similar to the traditional tree LOD. HD grass LOD billboards by default uses an external billboard NIF file in order to better match the ENB complex grass effect. Note that HD Grass LOD billboards for ENB complex grass use double the triangles, so in case performance is of concern, use half the density, 50% or less.

It is also possible to define external billboard models in ..\DynDOLOD\Edit Scripts\DynDOLOD\DynDOLOD_[GAME MODE].ini with the settings:
GrassBillboard2=DynDOLOD_flat_2x2alt1_lod.nif
GrassBillboard3==DynDOLOD_flat_2x2alt2_lod.nif
GrassBillboard4=DynDOLOD_flat_4x2alt1_lod.nif
GrassBillboard5=DynDOLOD_flat_4x2alt2_lod.nif
GrassBillboard6=Internal

Then use the settings GrassBillboard=1 and ComplexGrassBillboard=4 to control which billboard model is used. alt1 = without backlighting, alt2 = with backlighting.

Generating

Generate or update the grass cache of No Grass In Objects according to is instructions.

Generate grass LOD billboards with TexGen and install the TexGen output as usual.

To enable grass LOD generation, check the Grass LOD checkbox in the advanced mode of DynDOLOD.

The option is disabled if its requirements are not met. Hover the mouse pointer to see a tooltip with the number of found *.CGID grass cache files and grass LOD billboards.

Generate LOD with DynDOLOD as usual.

Updating

In case only the grass placements in the precache have changed, start DynDOLOD in expert mode, select the desired worldspace and click the Execute LODGen button. Then merge the new output with the existing output, overwriting all older files.

In case only the grass textures have been changed or different settings in TexGen are used, update the grass LOD billboards with TexGen, install the TexGen output, then start DynDOLOD in expert mode, select the desired worldspace and click the Rebuild Atlas button. Then merge the new output with the existing output, overwriting all older files.

To only switch the GrassLargeReference setting, change GrassLargeReference to True or False in ..\DynDOLOD\Edit Scripts\Export\LODGen_SSE_Export_[WORLDSPACE].txt, start DynDOLOD in expert mode, select the desired worldspace and click the Execute LODGen button. Then merge the new output with the existing output, overwriting all older files. Remember to also change the setting in the ..\DynDOLOD\Edit Scripts\DynDOLOD\DynDOLOD_SSE.ini for future LOD generation.

To test different GrassBrightnessTop*/GrassBrightnessBottom* or GrassBrightnessBottom*/ComplexGrassBrightnessBottom* settings, change them in ..\DynDOLOD\Edit Scripts\Export\LODGen_SSE_Export_[WORLDSPACE].txt, start DynDOLOD in expert mode, select the desired worldspace and click the Execute LODGen button. Then merge the new output with the existing output, overwriting all older files. Remember to also change the settings in the ..\DynDOLOD\Edit Scripts\DynDOLOD\DynDOLOD_SSE.ini for future LOD generation.

To test different grass LOD densities, change the GrassDensity setting in ..\DynDOLOD\Edit Scripts\Export\LODGen_SSE_Export_[WORLDSPACE].txt, start DynDOLOD in expert mode, select the desired worldspace and click the Execute LODGen button. Then merge the new output with the existing output, overwriting all older files. Remember to set the same desired Density in the advanced mode options in future LOD generations.

To speed things up, limit generation to LOD Level 4 by using the Specific Chunk dropdowns. Use the West/South coordinates to generate and test with a specific BTO file until the desired results are found. Use the DynDOLOD SkyUI MCM - You Are Here page to find the coordinates and filenames for the specific BTO file.

Performance

Unsurprisingly showing millions of grass LOD billboards on screen can require a lot of resources. Yet it is obviously much less resource intensive than extending the full grass into the LOD area.

If the generated LOD data becomes to much for the engine to handle, there can be infinite loading screen (ILS). Test if the experimental memory manager from SSE Engine Fixes can help with this issue.

To get an idea about the performance impact of grass LOD before generating it, use the No Grass In Objects ExtendGrassDistance and OverwriteGrassDistance settings to make it load grass to about the same distance as the LOD Level 4 distance (fBlockLevel0Distance). Now fully rendered grass is loaded about as far as grass LOD would. Grass LOD obviously uses less performance than that.

Typically using DynDOLODGrassMode 1 should have better performance than 2, since it means rendering less full grass. It does mean more grass LOD. To control the effects of grass LOD on performance, try lowering LOD Level 4 distance (fBlockLevel0Distance) in the DynDOLOD SkyUI MCM Settings page or the SkyrimPrefs.INI.

Visually the object LOD for mountains suffers from the shorter distance especially. Consider adding a mesh rule anywhere before the last '\' rule to compensate:

Mesh maskmountains
LOD Level 4Level0
LOD Level 8Level0
LOD Level 16Level1 or Level2
FlagsVWD
GridFar LOD
ReferenceUnchanged

Remove or disable generation of select grass LOD billboards to generate less grass LOD.

Consider using less dense grass settings when generating the grass cache. To generate grass LOD with less density, lower the Grass LOD Density setting in the advanced mode. Note that HD Grass LOD billboards for ENB complex grass use double the triangles, so in case performance is of concern, use half the density.

Troubleshooting

Not all grass types have LOD / grass LOD billboards

Check that TexGen generates grass LOD billboards for all desired grass types. Plugins from mods often forget to set object bounds on base records, which filters them out from automatic tree/grass LOD billboard generation. See TexGen Configuration for further details.

Gap between full grass and grass LOD

Grass LOD was generated with mode 2 but full grass is not being rendered to the edge of the uLargeRefLODGridSize setting by No Grass In Objects as explained above in the section Settings.

Error reading grass [worldspace] [x,y] / Error processing grass data *.CGID Unable to read beyond the end of the stream. System.IO.EndOfStreamException

Delete the *.CGID file. Load the game, open console and type "cow Tamriel x y" without the quotes and the values for x and y from the *.CGID filename to load directly into the cell. No Objects In Grass should then generate the file anew, which hopefully can then be read next time DynDOLOD is run to generate LOD.

LODGen takes a long time or uses a lot of memory

Unsurprisingly generating millions grass LOD billboards requires time and memory.

Test with a higher value for LODGenThreadSplit= setting in ..\DynDOLOD\Edit Scripts\DynDOLOD\DynDOLOD_[GAME MODE].ini to try to reduce peak memory usage.

If too many concurrent LODGen processes running at the same consume all available memory, limit their number by changing the MaxLODGen setting in ..\DynDOLOD\Edit Scripts\DynDOLOD\DynDOLOD_[GAME MODE].INI.

In case there are high resolution terrain LOD meshes installed in the load order, temporarily disable them to see if using the vanilla terrain LOD meshes requires less memory.

Use less dense grass for the grass cache and/or lower the GrassDensity in ..\DynDOLOD\Edit Scripts\DynDOLOD\DynDOLOD_SSE.ini setting so less memory is required to generate grass LOD and to increase performance in game.

Remove or disable generation of select grass LOD billboards to generate less grass LOD.

Out of memory while generating occlusion data

Set OcclusionMaxThreadsObjectLOD=1 in ..\DynDOLOD\Edit Scripts\DynDOLOD\DynDOLOD_SSE.ini in case the parallel reading of large object LOD meshes consumes to much memory.

No Grass LOD Check List

Check in the mod manager that there are ..\Data\Grass\[Worldspace]*.CGID grass cache files for the worldspace in the load order. Double that check grass cache generation completed and generate all worldspaces and files (= cells) as desired.

Make sure TexGen is generating grass LOD billboards for grasses by checking its log ..\DynDOLOD\Logs\TexGen_SSE_log.txt. Pay attention to error messages and fix them. Double-check the object bounds of the GRAS records in the plugins as explained above.

Check the grass LOD billboards textures in the TexGen output with an image viewer show grass and are not fully transparent.

Check the DynDOLOD debug log ..\DynDOLOD\Logs\DynDOLOD_SSE_Debug_log.txt contains <Notice: [Worldspace] Gathering grass data for object LOD>

Check the DynDOLOD log ..\DynDOLOD\Logs\DynDOLOD_SSE_log.txt that there were no errors in the LODGen log and check the LODGen log ..\DynDOLOD\Logs\LODGen_SSE_[Worldspace]_log.txt directly that its last line is Code: 0.

Check the object LOD atlas ..\DynDOLOD_Output\Textures\DynDOLOD\LOD\DynDOLOD_[Worldspace].dds contains some of the grass LOD billboards generated by TexGen.

Check the export file ..\DynDOLOD\Edit Scripts\Export\LODGen_SSE_Export_[Worldspace].txt contains a line like GrassMap=..\DynDOLOD\Edit Scripts\Export\LODGen_SSE_Grass_Map_[Worldspace].txt. Check that GrassDensity is not 0. If it is very low, grass LOD may be very thin to non-existent.

Check that ..\DynDOLOD\Edit Scripts\Export\LODGen_SSE_Grass_Map_[Worldspace].txt contains lines with grass LOD billboard texture names and paths in it and that none of the expected grass LOD billboards are missing.

Check that ..\DynDOLOD\Edit Scripts\Export\LODGen_SSE_ObjectAtlasMap_[Worldspace].txt contains lines with grass LOD billboard texture names and paths in it and that none of the expected grass LOD billboards are missing.

Open ..\DynDOLOD_Output\Meshes\Terrain\[Worldspace]\Objects\[Worldspace].4.x.y.bto and check visually if there is grass LOD in there. The many tiny X planes will be obvious.

To find a BTO that contains grass LOD, set expert=1 and verbose=1 in the ..\DynDOLOD\Edit Scripts\DynDOLOD\DynDOLOD_SSE.ini to start DynDOLOD in expert mode. Select the worldspace and click Execute LODGen. Once its done, check the LODGen log ..\DynDOLOD\Logs\LODGen_SSE_[Worldspace]_log.txt for lines like "Found z grass placements for LOD level 4 coord [x, y]". Check the BTO for the mentioned coordinates. In addition pay attention to the "File not found *.DDS" message about grass LOD billboards. The messages are expected for example for underwater grasses and small ground covers that TexGen does not generate grass LOD billboards for by default.