Ever since Unity 5 was released in March, our game designers have been pushing the framework to its limits. Although beta versions were available late last year, it’s only the last few months that we’ve really been able to test what it’s capable of.

The number of new features in version 5 of Unity are too numerous to explore in just one blog post. Today, let’s talk about lighting and shading.

Lighting

Lights and reflections play a large role in enhancing the realism of any 3D scene. Even if adding lights to a game in development is an easy process, they can have a negative impact on the performance of the game when it’s played. Computing the effect of each light on the scene is a computationally expensive process, which is why game developers tend to shy away from using these “real lights” in a game and try to come up with “cheaper” alternatives.

One such popular approach is called “light baking,” a process where all the lighting calculations for static objects are pre-computed during design time. For dynamic (moving) objects, “light probes” sample the lighting at key points and approximate the proper lighting between those points. But that still leaves one thing missing: reflections. An object passing by a shiny surface needs to be seen in that surface.

“HDR reflection probes” are Unity 5’s solution. Like light probes, they only calculate reflections at certain strategic positions, determined by the designer, and approximate them everywhere else. The game player doesn’t need a backpack full of graphics processors but still gets realistic reflections.

Our developers also praised the real-time calculation of global illumination – the total illumination from all light sources and reflected light. Individual lights can still be baked in, but the overall scene can change dynamically based on time of day or other lighting scenarios.

Shading

Shaders are software programs that run on a GPU to determine how light interacts with different surfaces, like wood, plastic, or stone. They work hand-in-hand with lighting techniques to portray objects in shadow, direct and indirect light, and countless other visual scenarios.

Unity 5 includes the somewhat dully-named but extremely useful Standard Shader. It replaces a confusing variety of shaders in previous versions, and supports a technology called Physically Based Shading (PBS). This one shader enables whole scenes to use the same calculation, with properties applying to different surfaces and materials.

More to come!

In our next couple posts we’ll discuss some of Unity 5’s other features that our designers are raving about while making games. In particular, we’ll focus on audio mixing, animation, physics, and the framework’s support of 21 different platforms. Fun, right?