Hello,
I’m target on low-end mobile if possible, my project have like 100 objects on scene (appear in screen) , they can move & animate different so can’t be merge. In previous, I use GPU instancing and the performance is pretty good. But because lack of shader code experience so I upgrade it to URP and trying using ShaderGraph. However it’s slow down, and I try to improve it performance, but I do not know where to start so I really need your help:
Does ShaderGraph compatible well with mobile in performance, or should I stick with built-in shader? (I’m current work with unlit only and custom light function cause I scare Lit will drop more in performance)
I heard that GPU Instancing not work in URP, so I enable SPR Batcher instead. From what I read “these batches must be as large as possible…use as few Shader Variants as possible”, does that mean if I able to merge all the shader into on big complicate one, the whole scene use only 1 shader and shader property will selection which path inside, does that mean better? Or should I still need to separate shader so the useless code does not need to be execute (like I merge shader with water effects and wind effect, then branch it inside I only have 1 shader?)
Relate to SPR Batcher & mobile performance, how many shaders should I keep at low (1,5,10 or…)
How bad is some built-in node in shader graph I should avoid to performance mobile performance? (like voronoi, noise, freshnel effect…, should I need to be worry?)
The last thing, I want to improve performance on mobile, for now I really like shader graph because it help the inexperience like me can do a lot about shader and the look of the game. So if you have any tips to share, it will really help and thank you so much for sharing.
I’m also facing the exact same issue, developing a game for low end mobile using URP.
After I applied many optimization tips, I got around 50-60 FPS in one of Huawei’s latest phones, 30FPS in Galaxy s7 which is ok but 7 FPS on Galaxy note 3 neo and Huawei p8 Lite which is horrible.
-I have only 1 global light in my scene, turning it off or on, doesn’t make any difference.
-I have around 25-40 batches in my scene.
-Around 80 - 160 B GC Alloc every frame.
-The memory debugger shows that the game takes around 270MB in my laptop’s RAM.
I believe the problem lies in the URP.
I can’t really give up on URP, I’ve made many cool things like shaders with it, and also I’ll use lights in my project for a pc version later. So any help is appreciated !
Mobile phones do not support anything in action for a real game .only a simple shader (diffuse shader) can be used for a real game
You can use cubemaps (as specular) instead of smoothness with realtime lights
Your scene must be completely baked
Your materials must be without normal maps
You can use only a directional light and a pbr shader on small things like The Gun on the hands. Also for roads only in racing games
Normal maps and AO maps can be baked. Specular can be simulated using cubemaps. Vertex animations can be recorded as animation in 3d software…
So forget realtime solutions for mobile game
Smoothness => cubemaps
specular => cubemaps
Details and normal maps => Baked into albedo texture
Lighting => Fully baked
Sky box => simple HDRI texture (simple shader) not procedural shader
Volumetric Lighting => Distance fade particles as volumetric effects and light lens flares