Skip to content

16 comments

There is probably a terrain tool/asset that utilizes brushes to paint foliage onto the base landscape. The tool then automatically generates optimized geometry batches, atlases, LODs, and more from the brush data and user defined parameters. The engine uses these optimized assets in conjunction with occlusion and LOD systems to create a smoother experience with minimal loss of visual quality.

You may think that these are all individual blades of grass being rendered, but they most likely are not. At the most, only those close enough to the player to warrant scrutiny will be rendered with actual geometry, and the rest will likely be billboards. This is a common optimization trick to reduce the strain on the graphics pipeline.

5 points

I thought all that originally, but I thought that amount of grass even with LOD rendering would be laggy. For example, wouldn't finding the distance of each individual grass and hiding them be processed and eventually lag?

1 points

It depends on how the LOD system and other visual optimizations are implemented. Poorly implemented optimizations will do little to improve performance, but great ones will produce visible results. There are always limits to the amount of detail that can be processed and rendered, but consider for example how well-optimized the modern Resident Evil games are even on older hardware; that is the result of a well-optimized, scalable game engine running the games.

To answer your question about the distance checks, I will say yes; checking the distance of each and every grass object will slow down the game. Distance checks are very expensive because root operations are very expensive to the CPU, so distance checks are often reserved for very specific use cases. There are better ways to implement LOD systems without using distance checks.

Screen space comparisons can be used by LOD systems. Basically, the engine compares the size of the game object to the screen display size. The LOD system increases the quality of the game object as it fills more screen space and decreases the quality as the game object fills less space. This is much faster than a distance check because of how the CPU handles mathematical operations. However, you are still checking every game object if you do not use any occlusion/partitioning techniques, so your processing time will still be relatively long.

LOD systems also benefit from world partitioning/sectoring. The idea is to split the world into chunks/sectors and then process LODs based on the currently occupied sector and other variables. This can be done manually or be automated (UE5 has an automated world partitioning system). The idea is to process groups/batches rather than individuals unless more detail is needed. Batches that are irrelevant at the moment are ignored, freeing up processing time for other calculations.

An optimization technique that can work in conjunction with sectoring systems and LODs is visual occlusion. The idea is that only objects that are visible or are needed for shadows/reflections are considered for rendering. What this means is that instead of checking every grass object, we are only going to check those that are in the sectors that are in front of us AND visible (we don't care about the fields behind that hill because we can't see them).

Using these and other optimization techniques, you go down from processing millions of grass objects to just a few hundred at most. This is more manageable and allows the game to render at higher resolutions with more detail.

I originally did not post all this because I wanted to keep my response short and simple. There's a lot of optimization magic going on behind the scenes, and a lot of it is going to be more complex than we want it to be. I do more high level work (scripting, designing) than engine code, so a lot of the optimizations and other tricks are likely beyond the scope of my experience. I do hope that this helps you find answers to your questions though.

1 points

in addition to other comments i think they also unload a tiny bit of stuff that is behind you/out of your vision

2 points

IMO, good LOD and occlusion/frustum culling

1 points

Keyboard shortcuts

Move and act

jork
Next / previous post or comment
Enteroro
Open the post
f
Open the media viewer
s
Save
h
Hide (the toast has Undo)
Tab
Right after an action: the toast's Undo
x
Collapse the comment
v
Next layout: cards, compact, grid

Go to

/
Search
gthenh
Home
gthena
All
gthens
Subreddits
gthenl
Library
?
This list
Esc
Close a menu or this list

In the viewer

←or→
Previous / next file
↑or↓
Previous / next post
korj
Previous / next post
Space
Play / pause
m
Mute
z
Zoom
s
Save
o
Open the post (on its own page: back to it)
Esc
Close

Keys do nothing while you type in a box.