We're constantly tuning our workflow as we build Albatross; partly  because we're new to this, partly  because the technology is continuing to evolve as we develop, and partly because we're constantly learning new tools and tricks. In the next few posts I'm going to share some of the techniques we've picked up and hopefully they'll be helpful to you too. Warning: this is pretty technical stuff.

The most recent process tweak we've made is to our lighting and shading pipeline. For the first couple years of development we'd been using Unity's Forward rendering. This had some big impacts on the way we laid out and lit scenes. In forward rendering you can only have a few realtime lights per object before sacrificing performance, so we made a number of compromises to compensate for that: we baked most of our lights into the scene and we created special self-lit shaders for the dynamic props so that they could match the look of the static props (I know, I know, we could've used light probes for the dynamic props, but Albatross uses continuous level loading which doesn't play well with probes or realtime GI, without some significant coding effort).

This approached worked well for a time but eventually became obnoxious for a number of reasons, but the main reason I hated it was that bake times are really long and they caused me to wait overnight to see if I got the lighting right in a particular scene. And if I screwed it up, I had to re-bake the whole scene again. So I started looking for another approach.

Enter deferred shading. With deferred shading you can have as many realtime lights as you want! The only downside is that it requires a great graphics card, but we're ok with that since we're targeting newer machines and consoles, not mobile (And it still runs fine on my 4-year-old Mac Pro, which is important because it's my primary dev machine). With infinite realtime lights, and a little cleverness, we can replicate most of the benefits of baked lighting (like bounced light and GI) with the major benefit that now I can see the results of my lighting setups immediately rather than having to wait hours for a bake. I also now have COMPLETE control over lighting, whereas baked lights often came with unintended consequences from bounced light and emissive surfaces.

Beyond the workflow improvements from deferred rendering, there are a few more side benefits too. 1) When you bake lights, you lose a lot of specular data, so keeping most of the lights realtime makes all those shiny things look so much better. 2) Linear Color Space and HDR FTW: image effects, bloom, and color correction work so much better with HDR. 3) realtime lights can use cookies, so we got us some IES cookies from the asset store and cookied the s%#@ out of every light, which makes a dramatic impact on realism.

I'm sure there are more benefits that I'm unaware of, and I'm sure I'm probably missing some gotcha that I'll regret down the road, but for now I really wish we had switched to deferred shading sooner.