Content of the article: "A Review of Grass Performance Studies: Resolution, Overdraw, Poly Count, and Draw Calls"
There has been a lot of controversy on how to improve grass performance in Skyrim. Some of these theories have turned out to be true, others false. Here I will discuss the results of a well controlled series of performance tests.
- 256, no mip maps = 81 fps
- 512, no mip maps = 75 fps
- 1k, no mip maps = 54 fps
- 2k, no mip maps = 31 fps
- 1k, with mip maps = 94 fps
- 2k, with mip maps = 94 fps
- 1k, with mip maps, bc7 compression = 95 fps
- 2k, with mip maps, bc7 compression = 95 fps
With mip maps, the resolution of the texture doesn't even matter as long as you have VRAM to spare, your FPS will not be affected. Some may note that a lot of detail is lost in the mip maps. There are techniques to preserve detail, but these will not be discussed here.
- Use 1k, 2k, or even 4k textures if it's necessary to preserve the details of the texture, but don't be wasteful of VRAM.
- Always generate mip maps for grass or they will shimmer horribly (due to aliasing) and waste extreme amounts of performance.
Overdraw is the process by which, during the rendering of a three-dimensional scene, a pixel is replaced by one that is closer to the viewpoint.
- Mostly transparent texture = 85 fps
- Mostly opaque texture = 101 fps
- Increased mip map transparency, alpha test coverage 0.0 = 91 fps
- Increased mip map opacity, alpha test coverage 1.0 = 94 fps
The vast difference in performance here is fascinating. The more transparent pixels on a texture, the more performance cost. The resolution of the texture doesn't even matter. Transparent pixels cost extreme fps.
- Use up the majority of the space in your texture, but not so much that the geometry of the model becomes very obvious.
- Use an alpha test coverage near 1.0 for textures with thin grass blades so they don't become completely transparent in distant mip map layers. This will improve performance as well.
- Use an alpha test coverage near 0.0 for textures with thick blades (such as for ferns), so the blades don't become a thick opaque block in distant mip map layers
Here I have created two grass models. The texture is identical. The triangle model has a large triangular UV map that captures the entire texture, and the rest of the triangle becomes transparent in game. The square model has a square UV map that captures the entire texture perfectly without any areas of transparency in game.
Fewer polygons is not necessarily better if it increases the amount of transparency in the model. In the above example, we have increased vertex count by 33% in the square model, but we saw a large improvement in GPU usage because we decreased overdraw. The question you should be asking now is, "just how much can you increase the vertex count before additional polygons become more expensive than transparency?" The results will vary across systems and mod lists. From my testing with Cathedral – Rocky Shores, which contains models that have no transparency and are placed only on the shoreline, I started to notice performance cost at grossly 250 triangles per square meter.
- For grass that is used diffusely across all landscape, I'd recommend staying below 50 triangles per square meter.
- As a general rule, if increasing vertex count by x% decreases transparency by the same x%, then it is probably worth it.
- Carefully map your UVs to minimize transparency
A draw call is a call to the graphics API to draw objects (e.g draw a triangle), while a batch is a group of draw calls to be drawn together. Draw calls can become very expensive if you ask the game to render tens of thousands of objects. It was previously speculated that by increasing the amount of grass clusters and plants in an object file (.nif), then the game would need fewer draw calls to render the same amount of grass. However, this has been determined to be largely false for Skyrim grass, as the engine internally batches it all into a few parts for an instancing optimization. This has been verified through both extensive performance testing on my end as well as analysis of the world node tree by Prog.
- Do not add multiple grasses to a nif file to improve performance. It doesn't.
- Grass does not conform to the landscape morphology, so create grass models with a small footprint to minimize floating grass.
- To cluster a grass type together, ie a group of lupin flowers, try restricting that grass type to grow within a minimum and maximum slope range as defined in the esp grass record. This avoids having to create models with large footprints.
- The snowberries are driving me insane. How have they stayed in this state for this long?
- Skyrim SE Test/Prototype: Animated Horse Mane + Tail (HDT-SMP)
- To anyone experiencing memory leaks or stutters/freezing due to RAM
© Post "A Review of Grass Performance Studies: Resolution, Overdraw, Poly Count, and Draw Calls" for game The Elder Scrolls.
Top 7 NEW Games of June 2020
Quite a few exciting games are releasing for PC, PS4, Xbox One, and Nintendo in June. Here's what to keep an eye on.
Top 10 NEW Open World Games of 2020
Video games with open worlds continue to roll out in 2020 on PC, PS4, Xbox One, Nintendo Switch, and beyond. Here are some to look forward to!
Top 10 Best New Upcoming Games 2020-2021
The best selection of games which will be released in 2020 and 2021 for PS4, PS5, Xbox One, Xbox Series X, Google Stadia and PC - and you can watch in amazing UHD 4K and 60FPS with latest updates about all of the games in this list!