Unity Terrain Vegetation Optimization basic tips and tricks

Описание к видео Unity Terrain Vegetation Optimization basic tips and tricks

Unity HDRP 2022.3.25f1
Super basic Terrain system vegetation optimalisation
Mass placed vegetation from 30 FPS to over 100 FPS

Contetn====================================================
00:00 - Intro
01:35 - Content / preface
01:48 - Grass X plane type 3D model
02:23 - Grass X plane detailed, 3D model upgraded
03:00 - Prepare and compare grasses X and X upgrade
05:40 - Add Grass
07:20 - First test low 40-50 FPS
10:12 - Add Tree / not optimized - no LOD system, 2 material
14:40 - Add 5000 not optimized tree - 20-30 FPS
17:30 - Change detailed grass (X plane upgrade) and optimize settings
25:00 - Prepare your tree for LOD system and optimize in Blender
40:12 - Check and setup LOD on prepared 3D tree model
49:50 - Place 10000 tree, massive grass and test it - 150 FPS
53:10 - Some finetune, tip and trick and advice
==========================================================

You can save a lot of CPU - GPU resource, if set up your basic 3D model and terrain settings on the right way
This small tricks, what I like use in our works. I know have a lot of other solution and external asset for this.
Now we try focus only for the free and built in functions, what we can use on the basic terraian map.
This is my personal favorites. I not talk about SRP Batcher, Mesh Baking, Impostor, billboard, Analysis profiler techniques.
Each has advantages and disadvantages, mostly I use only what I show in this video.
So if you are a pro at optimalization, you may not find new useful information right now.

This is true for all 3D models, not only for vegetation what placed to terrain system
- Not all models or purchased assets are properly optimized, or ready to be used en masse
- Therefore, with the help of some basic tricks and built-in functions, you have to do them yourself

- Grass: What kind of grass, undergrowth, how to set up for good resoult
- Trees: Optimize with LOD system (Level Of Details)

GRASS / UNDERGROWTH (good for grasses, bushes and trees not best choice)
- We will place it as Terrain / Paint Details object
- With few easy step You can make your own 3D grass
- For GPU instancing use, use only one material. Personally I keep the 3D model in one object too
- I not use double side meshes to reduce polygon numbers, in the shader we will use double side render option
- The cross plane (X) grass not bad, but need very lot and from top view looks terrible.
So add more planes and a bit rotate 1-2 plan facing up to top view
- When add grass, adjust the right size, for the enviroment and playable characters
- Choose the good Detail Density (keep balance between CPU - GPU)
- Try to use similar color ground layer (texture on terrain) as your ground vegetation. This will help, not to see a long distance
fade vegetation illusion / effect
- In older Unity or GPU You can try turn off object shadow on the grass (maybe that help improve performance)
- Use the Terrain system Draw Instanced option, to help rendering.

- You can use different and various models just try keep the rules above:
Simple low poly 3D model with single face, one material

TREES / BUSHES / ROCKS
- Yeah, here need to be tricky. Need a good 3D models for mass placing objects.
- If You want use a lot of trees and this not well prepared, this will eat the power resources.
10 - 100 million polygon is too much for smooth gameplay
- Fortunately with the LOD (Level Of Details) system we can keep the balance between the quality high and low poly models
- If You dont have a well prepared tree, Now we will prepare our model to reduce FPS.
For this it is good if you have a little graphic and 3D modeling skills
- First we use Atlas style texture where the leafs and bark are in one texture for use it in one shader only
(this make posibble GPU instancing to save resources)
- Merge the model into one object
- Create LOD low poly versions of the tree
- Create and adjust the LOD system setup (if use LOD0, LOD1 LOD2... names in your model, Unity import add LOD component automatic)
- Placing trees into scene, if need adjust LOD

Useful Terrain tools

Grass shader test, created in Shader Graph editor
   • Unity Special HDRP Grass Shader  
How to create simple X plane grass in Blender and use in Unity
   • Blender+Unity HDRP Detail Mesh terrai...  
Unity EDC Vegetation Spawner
   • Unity EDC Vegetation Spawner  
Vegetation spawner - tree, grass and flowers (small speed lvl design)
   • Vegetation spawner - tree, grass and ...  
Unity EDC Prefab Painter / Brush tools
   • Unity EDC Prefab Painter / Brush tools  
Unity EDC - MapMagic 2 procedural Terrain Generator / Painter
   • Unity EDC - MapMagic 2 procedural Ter...  
Unity EDC - Procedural Terrain Painter
   • Unity EDC - Procedural Terrain Painter  
Unity EDC R.A.M - River Auto Material - Long Version
   • Unity EDC R.A.M - River Auto Material...  

=============================================================
#unity #unity3d #indiegame #shader #shaders #shadergraph #tutorial #tutorials #tips #tricks #scifi #animation #shorts #short #blender #game #gameplay #play

Комментарии

Информация по комментариям в разработке