Setting up physically-based materials and baked lighting in Unity 5

While we're ramping up pre-production on Chapter 2 I've actually had a chance to go in and investigate Unity's new physically-based rendered material system, as well as the baked lighting system. These features are super powerful and incredibly useful if you know how to implement them, but the task of getting them to work correctly can be... cumbersome at first. So what I'm going to be doing to shed some light (heh) on the situation is a break-down of my process.In chapter one, we decided that we only wanted to use diffuse maps for all materials that were using the Standard shader for the sake of visual simplicity and a quicker asset creation pipeline. We also only used realtime lighting because we didn't have the time to rebuild our levels with baked lighting in mind. Only after spending a year of development in Unity 5 did we realize the potential we missed out on, but by then it was too late to apply PBR materials to all the existing assets and bake the lighting in these huge levels. So we're taking this chance to start using these features in Chapter 2.

  • One thing that should be said. A visually appealing scene is a composition of all kinds of effects and assets coming together to form cohesive and pleasant imagery. You can have the most technically advanced effects in the world but if it's all taking place in a scene where the assets used are shit then your scene is going to look like a polished turd. If you're inexperienced with asset creation (modeling, sculpting, texturing, etc...) then either find someone who is or stop reading this and find some good learning resources. The programs I used for asset creation in this run-down are Photoshop CS6, 3Ds Max 2016, NDO2, and Zbrush.

INDIRECT LIGHTING and REALTIME GLOBAL ILLUMINATION 

The lighting you see in the first panel is the exact way we did everything for Chapter 1. Everything was strictly realtime lighting, and we occasionally fudged light bouncing by slapping a point light in select places. This method can only get you so far, and some really cool detail can be lost. 

The lighting you see in the first panel is the exact way we did everything for Chapter 1. Everything was strictly realtime lighting, and we occasionally fudged light bouncing by slapping a point light in select places. This method can only get you so far, and some really cool detail can be lost. 

So to start I set up a simple scene. A room made of  cubes with some basic materials applied. I threw in a brick material and a barrel prop to see how indirect lighting would play with normal maps.

  • It is important to note that any objects you want affected by indirect lighting need to be marked 'static' at the top right of the inspector tab (as stated in this useful tutorial)

I threw in a single directional light and hit 'bake'. The only way I found that the lighting showed up correctly on the normal maps was to set the the directional mode drop down box to Directional under the General GI section of the Lighting tab. After getting the hang of tweaking all of the settings for GI I thought I was ready to start filling out the scene to see what I could achieve. 

I should point out that to fully flesh out the room I put a point light in the center with no shadows applied. 

I should point out that to fully flesh out the room I put a point light in the center with no shadows applied. 

The biggest difference you may notice is that the light bounces and some subtle ambient occlusion was baked into the scene. It's certainly brighter, but I felt I could push the visuals farther. I started to experiment with PBR materials on the Standard shader. The thing about creating PBR materials is that it's not just a little check box you can tick. Creating assets that utilize this feature requres that you create a specific metalness map (as detailed in this tutorial). Like I said above, this step requires that you know how to create your own assets and materials, so make that a priority before anything else.

With PBR materials, the 'shinyness' comes from two maps now, rather than just a specular map. There's the Metalness map (which affects how 'metal' the texture appears) and the Smoothness map (which affects how 'smooth' the material is. A MUCH better explanation here, haha.

With PBR materials, the 'shinyness' comes from two maps now, rather than just a specular map. There's the Metalness map (which affects how 'metal' the texture appears) and the Smoothness map (which affects how 'smooth' the material is. A MUCH better explanation here, haha.

When using PBR materials make sure you're using reflection probes so the materials react properly to their local environment. A tutorial on how to set them up.

When using PBR materials make sure you're using reflection probes so the materials react properly to their local environment. A tutorial on how to set them up.

I'm starting to get some good results and we're almost there. But here comes my favorite part. The easy, cheap-ass part. POST-PROCESSING!!! 

So there you have it. That is my process for setting up this scene. I'm sure There are things I could do better, I'm still learning. But hopefully this is useful to you guys!