What is the recommended way of baking as much lighting as possible and minimising all runtime costs?
Thoughts:
If I fully bake lighting into the static objects in a scene, and these static objects are set to use the standard shader and a few maps, am I still getting hit for the rendering cost of that PBR shader?
Does the standard shader setup have any affect on the light baking result? Colour information is used for bounce lighting I guess, but that would be present in an unlit material as well…?
Can/should I switch to an unlit shader once the bake has completed to optimise performance? I assume a PBR material won’t look too different given the lighting information it needs isn’t really available anymore?
Maybe I should start off with an unlit material and the result will look the same?
I can’t find the answers to any of this in the docs, any help or pointing in the right direction is appreciated.
Some background:
We are targeting mobile, iPhone 5S and above.
Our game will just have a single directional light and the camera will not rotate, just translate. For this reason, we can get away with heavy baking of lighting information into our models/scenes.
I cannot give definitive answer but from Shader code, it seem to do Bidirectional Reflectance Distribution Function (BRDF).
Well, without BRDF you won’t get Metallic or Smoothness looking.
I recommend create a test case with a lot of standard shader comparing to Mobile/Unlit (Support Lightmap).
See how quickly it hit bottleneck with standard shader.
For shader code, Download UnityShader and look into these files.
Standard.shader
UnityStandardCoreForward.cginc <<< This is a header which using macro to override function.
UnityStandardCore.cginc/UnityStandardCoreForwardSimple.cginc << UnityStandardCoreForward.cginc will call to one of the function from these files.
For BRDF, It’s probably in UnityStandardBRDF.cginc