INTRODUCTION
As a way of introduction this post was inspired by Inquiries found in the “The most insane aaa game…” thread. Specifically posts made by @frosted which can be seen starting around here: https://forum.unity3d.com/threads/the-most-insane-aaa-game-made-in-unity-has-arrived-in-closed-alpha.448514/page-8#post-3073918
Using the example scene that was posted, I took a look on my end and completely re-did all the lighting and effects using my own ideas and preferences, and am collecting the process I went through and some other notes on visual design and technique in order to get the (imho) best starting point in Unity.
Also I should say that this is what I consider a starting point, not the end-all-be-all of lighting in Unity. I’m sure others will chime in with their own thoughts and opinions on this matter which I welcome. I decided to post this as a new thread so that it might reach a bigger audience, instead of being buried in a larger thread.
Also, there is a TLDR at the end if you just want to skip to that.
DOWNLOAD AND FOLLOW ALONG
I’ve posted the example scene in 4 steps, you can download the project and take a look at each example scene here: http://www.tanukidigital.com/share/LightingTestScene.zip
QUALIFICATIONS(???)
I been-a-usin’ Unity for a long time and I got strong opinions. Also, I used to be a paid artist before I became a bum. Otherwise I have none. Read at your own risk.
LET’S GET STARTED
There are some basic misconceptions that often arise when talking about this subject and that is that some people are talking on a technology implementation level and others are talking on a visual (or art theory) level. Ultimately though everyone has the same goal, which is a kickass image.
The tools you have in Unity to control color are very powerful, and that comes with a lot of responsibility. It’s extremely easy to screw over an image right from the start if you don’t begin from the proper baseline, both on the tech side and the visual theory side.
TECH BASELINE
So let’s start with a perfect baseline that we can use to build on. I downloaded the example project and opened it in Unity 5.6. I deleted all lightmaps and turned off all bake settings including enlighten… this stuff just get’s in the way and “muddy’s the water”, since you have little control over what it’s doing. I converted the one scene light to realtime, set the color to pure white and the intensity to 1. I also set The ambient environment lighting to skybox with an intensity of 1.0 and set the reflection probe to render nothing but the sky (culling mask: none). I set the project to LINEAR color mode in Player Settings, and made sure the camera was on HDR and Deferred, and turned off all fog. Finally I deleted all image effects and Standard Assets from the project and imported Unity’s post-processing stack instead. I enabled only the ‘Color Grading’ section with the Tonemapper set to Neutral, without touching any of the default settings. As an aside, I wrote a little script that force updates the Unity Ambient environment and applied it to the camera, since for some reason it was not updating itself on skybox mode.
The below is the result and is about as basic (yet “proper”) result you can get with Unity. As you can see the results are pretty bland, which is to be expected.
ART THEORY
So let’s get a couple key RULES out of the way right off the bat…
- There is no difference between color and lighting. Color IS lighting.
- Color is RELATIVE. Always.
Now because of these two rules, we can just make up a third rule that isn’t exactly always true but might as well be…
3) Color is EVERYTHING.
Since color is so important we want to do everything we can to maintain color info and dynamic range in our scene/image. So let’s look at some improvements we can make without immediately jumping to brighten/contrast (which destroys color info) to help this image along.
In general, unless you’re looking directly at the sun, the sky will be the brightest and most important element in an outdoor environment, and it will cast it’s color onto everything in the scene. You can have a completely believable scene in Unity without even using a directional light at all, as long as the object’s are lit properly from the sky. This is why it’s imperative to set the ambient source to be ‘skybox’. I’m going to make up my own rule here… Ambient light is more important than direct light. Believe it.
Now as we said before, the sky is bright. The sky is in fact so bright that sometimes your eye has a hard time reconciling the sky and other objects at the same time. This is even more of an issue in cameras since they can’t capture anywhere near the dynamic range that your eye/brain can understand, and this extends to monitors since they have a limited dynamic range that they can display. This leads to the tendency of adding “Contrast” in an image, which unfortunately usually means darkening the darks and lightening the lights. But since we stated above that color IS light, we can also influence the contrast by changing color instead of destroying the already limited value range in the image.
So let’s make some small tweaks here to give ourselves a more visually cohesive image. We can make the sky APPEAR to be brighter by bleeding it into the other colors in the scene a bit. In the PostProcessing stack I turned on Bloom, kept the intensity at 1, lowered the threshold slightly to 0.95, and adjusted the soft knee to 0.75.
Let’s also add some antialiasing since nothing screams “fake image” quite like jagged edges do. I turned on the postprocessing antialias setting and set it to ‘extreme performance’. Even just a little bit of aliasing goes a long way especially when looking at a static image.
The direct light of the sun is generally extremely bright and extremely white. As the sun get’s lower on the horizon the light rays have to pass through more and more layers of atmosphere, and because of that the blue of the sun light starts to get refracted out, which makes the sun light appear warmer and warmer the lower it gets on the horizon. We can simulate this of course by changing the color of the Directional light. But a little goes a long way! Don’t get overzealous here. The angle of the sun in this scene has started to lower, but it is still well above the horizon and firmly in an mid-afternoon stage. I set it to an rgb of 255,240,200. I also raised the intensity to 1.25, since again, the sun is brighter than anything else in the scene.
We can add further cohesiveness to the image by adding Ambient Occlusion. We want to be careful though, because this can add a lot of “contrast” (erroneously meaning darker darks) to the image where we don’t necessarily want that in the long run. I turned on the AmbientOcclusion in the PostProcessing stack and set the intensity to 1 and the radius to 0.2, kept downsample on and the sample count to medium. And, very important, since we’re using Deferred we can apply the occlusion only to shaded areas by checking ‘ambient only’.
Just these very small tweaks are giving us a much much nicer image. It’s very cohesive, and has sufficient contrast for the image to read visually while still retaining plenty of color info / dynamic range for further tweaking.
ART DIRECTION
It takes a special skill to step away from your work and look at it from a fresh perspective, or a defined perspective. It’s easy to be too close to what you do and not want to sacrifice the work that you made, or work harder to improve what you already think is good. This is why everyone hates art directors, and also why they get paid so much.
So let’s art-direct the crap out of this image. We got this far, it looks good mostly (you think) and you show the art director your proud baby and this is what happens…
“What is this muddy mess? There’s no focus. There’s no contrast. Do it over and show it to me again in an hour, I’m going to lunch.”
Yep. The art director is never wrong, even when they are wrong. As we’ve seen “contrast” is a fluid term that means different things in different contexts, but it almost never means “make everything black”. So how can we improve on this without destroying the dynamic range of our image? Why, by changing color of course!
The buildings and the ground are very similar and they bleed into each other for sure. This might be a realisitic image in our heads or on paper, but it can definitely be made more interesting with a few key choices.
First I added some darkening variance to the ground, it looked like it already wanted to have wet/dry areas, so I darkened up those spots particularly and added a few puddles for visual interest. The ground and the wood of the buildings were particularly close together and were not distinct from each other despite being made of different materials, so I warmed up and darkened the building materials slightly. I also warmed up the straw in the building’s roof… remember how we said color is relative? Adding color is just as good a tool to create contrast as changing value is.
Finally I added some quickly made specular maps where I thought necessary since all the materials were missing them. Remember texture data (like specular) feeds into the lighting/reflection/ambient settings from the rest of the scene and is just as important for lighting cohesiveness as anything else is. It isn’t just for metallics.
Some of the above edits were fairly subtle, but it really brings more dynamic effect to the scene, as well as better ground some elements like the barrels, and bucket.
Looking good. Now let’s go back in and start tweaking some of the more interesting post effects. Chromatic Aberration and Vignette are very useful for simulating subtle falloff. Subtlety here is always key, I added a aberration at only 0.05 intensity, and added vignette at 0.4 intensity and 0.1 smoothness. I also gave the vignette a tint color, since we want to retain color in our scene. Nothing washes out a scene like using black and white when you could be more nuanced. I used an rgb of 34,6,0.
Next I added ScreenSpaceReflection. This definitely adds visual interest to nearby reflections and breaks up large reflected areas such as the puddles. There are a lot of settings here but I made sure to keep the blur low at 1, and increaded the reflection multiplier to 2. For scenes with large bodies of water you’ll really have to experiment with settings here, but these work well for this scene.
To simulate a bit more light in the scene I went back to the bloom and increased the radius from 4 to 4.5, and also increased the intensity of the directional light from 1.25 to 1.4. Now I’m pretty happy with the image as it stands. We have visual interest, good dynamic range, and great contrast while still being able to see everything in the scene.
TLDR
Now you could go on and on like this tweaking effects, changing color grading and etc. forever, but the key points, and perhaps the TLDR is as follows…
-
Color is everything. Use color instead of contrast. Protect the dynamic range of your scene!
-
Start with a proper technical baseline for your project. In most cases this means Linear render path, Deferred Rendering, HDR on your camera with Tonemapping, Skybox as ambient, and a Reflection Probe in your scene to capture it.
-
Practice the art of subtlety. Most settings only need minor tweaking to perform best. (again, protect that dynamic range!)
-
Break rules where you feel they need breaking.
Another point I would like to make, and this may be just a personal preference, but neutral tonemapping is a better starting point than ACES. You will spend more time with filmic tonemapping trying to get good results because it often hides key base tweaks that should be done prior to messing with it. I recommend doing the steps above under neutral tonemapping, and then perhaps switching to ACES at the end and then tweaking it’s settings from there.
All that is a lot to read, but I hope it helps some people out there, or gives them new ideas about their own projects. Used carefully, Unity gives you pretty much everything you need at this point to get high quality visuals, you just need to be thoughtful and methodical about it.
Note that all this is stock Unity (apart from the PostProcessing stack, which Unity should “just include” in all future downloads, because it’s awesome). Also notice throughout this process I didn’t touch the contrast controls once, not did I touch enlighten (turned that junk off first thing!). While I do think there is a place for GI for sure, enlighten is a mess, and it seems Dynamic GI solutions will eclipse it completely soon enough. This particular scene is not likely to benefit from GI much at all anyway.
OK back to real work now.