Unity’s grass rendering was always troublesome[1] for HDRP this has not gotten really better, since HDRP came first completely without grass shader [2] and now, while grass can be rendered, in my current project it is tanking the framerate.
So, my problem:
In my current Project I have a 400x400 Terrain.
Without Rendering Details&Trees: {cpu main: 15ms, render thread: 11ms} yielding somewhat about 60fps.
With Rendering Details&Trees: {cpu main: 25-30ms, render thread: 19ms} yielding somewhere between 40 to 47 fps, and adding 6000 Batches (sounds like much, but it isn’t THAT much grass).
It’s all the same grass object. which consists out of 7 quads basically billboards. Shadows are already disabled with one directional light the shadowmap calculation was already too much.
So I feel like I’m basically forced to get some of the alternative renderers from the asset store [3] or develop that system myself.
How do you get a playable framerate while using terrain and grass?
So I checked out the HDRP Terrain demo scene (Unity Terrain - HDRP Demo Scene | 3D Environments | Unity Asset Store).
And it basically shows the same issues. Most shots can’t keep 60fps (full hd, 3080 mobile). A good portion of it is shadow mapping, even though only one light is active.
I’ve had the same issue in our game, hence I disabled the shadows for the grass and rely on SSAO for that.
But it seems that most is just the trees and the grass itself (without trees/grass it renders at about 90fps, afterwards around 40fps)
Game seems to be fully GPU bound as long as the terrain details and trees are being rendered.
The HDRP terrain demo sucks,they have none concept about performance and optimization.
you better switch to GPUInstancer or NatureRenderer for better performance.
if you are using Unity2022.2+,you could try the new terrain detail system which runs even faster than GPUI and NR.
remeber to use small patch size for better culling.
but it can’t use LOD for details and you can’t set the cull distance for each detail.
you will have to go to GPUI or NR for better control.
Most people miss the memo that unity terrain tools is a separate asset and has other features made available to the terrain system, in 2022 both tools has some additional functions like Terrain systems "align to mesh normal % slider "
And addition mesh masking controls for placement of details which works similar to the masking terrain layer brush from terrain tools.
Terrain tools add on has the procedural brush creator which surprisingly I never see anyone use, and most of its already existing workflows.
So basically now ruleset placemenent can be made for high medium and low frequency strokes for both terrain layers and terrain details/trees. Other than prefab brush+ the unity terrain rulesets have always been really well made for manual control. Most asset store Content focuses on low level passes which is fine. But rulesets can quickly become complex. We frequently find changing tools for different passes that makes sense and also keeping some good rule sets from the unity terrain system and toolkit, really helps.
Yea,i meant that one.
But as HIBIKI said,that one got some must have features like “align to ground & per detail density control” in 2022.2 with the package Terrain Tools.
I only suggest people to use it in 2022.2+.
Sorry for misleading.