Sorry for the late reply!
On 1/22/2018 at 5:22 AM, MJP said:I'm sure plenty of games still bake the direct contribution for at least some of their lights. We certainly did this for The Order, and did it again for Lone Echo. Each of our lights has flags that control whether or not the diffuse and indirect lighting is baked, so the lighting artists could choose to fully bake the light if was unimportant and/or it would only ever need to affect static geometry.
Fair enough, I'll try break down the granularity of choice to your level.
On 1/22/2018 at 5:22 AM, MJP said:We also always baked area lights, since we didn't have run-time support for area lights on either of those games.
I'll look into it eventually. I'm sorry to say I haven't played The Order or Lone Echo (Don't have a Playstation for the former, and I'm pretty broke either way :P), but I'm pretty sure The Order doesn't have much requirements for area lights given its setting. I'm hoping to generalize my engine a bit so I'll probably want to handle it eventually, but it's not a priority right now.
On 1/22/2018 at 5:22 AM, MJP said:For the sun shadows we also bake the shadow term to a separate lightmap. We'll typically use this for surfaces that are past the last cascade of dynamic runtime shadows, so that they still have something to fall back on.
I'm not sure I agree with this method, though I haven't tried it out, so I can't say that much about it.
On 1/22/2018 at 5:22 AM, MJP said:if you want to to compute a specular term then you need to store a radiance distribution in your lightmap
I don't get what you mean by this. Specular Irradiance is very rarely handled in lightmaps as far as I'm aware, I don't really see a point to this.
On 1/22/2018 at 5:22 AM, MJP said:If you want SH but only on a hemisphere, then you can check out H-basis. It's basically SH reformulated to only exist on the hemisphere surrounding the Z axis, and there's a simple conversion from SH -> H-basis. You can also project directly into H-basis if you want to. I have some shader code here for projecting and converting. You can also do a least-squares fitting on SH to give you coefficients that are optimized for the upper hemisphere. That said I'm sure you would be fine with the Last of Us approach of ambient + dominant direction (I believe they kept using that on Uncharted 4), but it's nice to know all of your options before making a decision
Sounsd quite interesting! I recently found a Call of Duty paper breaking down their use of hemispheres in lightmaps (among other things), so I'll check out all these sources a bit later, when I've actually got a preliminary lightmap working.
On 1/22/2018 at 5:22 AM, MJP said:You don't necessarily have to store directions for a set of SG's in a lightmap. We assume a fixed set of directions in tangent space, which saves on storage and makes the solve easier. But that's really the nicest part of SG's: you have a lot of flexibility in how you can use them, as opposed to SH which has a fixed set of orthogonal basis functions. For instance you could store a direction for one SG, and use implicit directions for the rest.
Very good point I haven't considered.
-------
On a separate note, there's one thing I can't figure out. How can I use multiple irradiance probes (SH) on a single mesh? Do I have to pass an static-sized-array of SH primitives? I'm worried that'll take up far too much memory.