Hi everyone!
Thank you for the help in advance!
Im working on optimizing my forest, as i use some nice assets that are not optimized for batching, and for the density i would like to create, it is a very good idea to save performance this way.
I am using Unity 2019.1 on HDRP Preview… i have done alot of research into how the new batching works, and i have tried to play with the MeshRender.SortingLayer (which dosnt seem to have any effect in new unity/hdrp) and i have also Camera.OpaqueSortMode not to do distance sorting…
All of my Assets and Materials are set to use only HDRP/Lit Shader
Between all of my Forest Assets, they are using about 9 materials…
My problem is that i have almost 5000 batch calls that i could be saving from my forest… i am using a group of about 12 - 15 assets for my forest, so i know this should be able to come down.
Within the Frame Debugger, i get SRP Batch calls, that seem all over the place, with no sorting, thus they are not batching large groups.
Within the frame Debugger on the SRP Batch Calls, it explains “SRP: Node use different shader keywords”
Alot of my assets seem to share the same shader keywords, although the order might be off…
My main Questions are:
-
How can i Sort or Group or Organize my assets so that the shader keywords are grouped together to lower draw calls/SRP Batch calls?
-
Are Shader keywords, the activated properties on the materials im rendering? im noticing things like “_NORMALMAP” leading me to believe it is rendering an object with a normal map, then one without. which would result in the 2 SRP Batch calls im seeing. If im understanding this correctly, is it that i must set pretty much the exact same Keyword values (Smoothness,Metalic, DoubleSided,AlphaClipping) and thus it would see them as the same, and batch render them in one call?
-
The framedebugger does not seem to tell me what game object its rendering, i belive i saw a tutorial that, when clicking on a render call it would highlight the gameobject in the Hierarchy, however its not doing this, mostlikley because they are placed trees on a terrain, and grouped under terraindata, which i could understand why they are not selected (haha)