Real-time rendering in 3D
If you’re just getting started with developing for 3D in Unity, you might’ve asked yourself what exactly is rendering. For those who occasionally use 3D graphics, or those who are just getting started on 3D production, you may find yourself thinking that rendering doesn’t come as easy as other aspects of 3D graphics.
Luckily, there’s plenty of documentation around setting up rendering in Unity in order to get your project to look and act like you want it to.
What is real-time rendering in 3D and how does it work?
3D rendering is the process of producing an image based on three-dimensional data stored on your computer. It’s also considered to be a creative process, much like photography or cinematography, because it makes use of light and ultimately produces images.
With 3D rendering, your computer graphics converts 3D wireframe models into 2D images with 3D photorealistic, or as close to reality, effects. Rendering can take from seconds to even days for a single image or frame. There are two major types of rendering in 3D and the main difference between them is the speed at which the images are calculated and processed: real-time and offline or pre-rendering.
In real-time rendering, most common in video games or interactive graphics, the 3D images are calculated at a very high speed so that it looks like the scenes, which consist of multitudes of images, occur in real time when players interact with your game.
That’s why interactivity and speed play important roles in the real-time rendering process. For example, if you want to move a character in your scene, you need to make sure that the character’s movement is updated before drawing the next frame, so that it’s displayed at the speed with which the human eye can perceive as natural movement.
The main goal is to achieve the highest possible degree of photorealism at an acceptable minimum rendering speed which is usually 24 frames/sec. That’s the minimum a human eye needs in order to create the illusion of movement.
Even though rendering is based on tons of sophisticated calculations, modern softwares can offer some fairly easy parameters for you to understand and work with. A rendering engine is usually included in a modern 3D game engine and it can achieve really amazing graphics.
Real-time rendering in Unity
When creating an interactive project in Unity, you can go from luminous day, to gaudy glows of neon signs at night; from sunshafts, to dimly lit streets and shadowy tunnels, to create that evocative atmosphere that enthralls your audience.
No matter if want to develop a 2D or 3D game for mobile or a console game, Unity’s Scriptable Render Pipeline (SRP) allows you to establish gorgeous imagery and optimize for specific hardware.
Real-time rendering in 3D and 2D
If you haven’t decided what type of project you want to make in Unity, 2D or 3D, remember you have complete freedom and a professional toolset to create any kind of 2D or 3D game, or even mix elements of the two to create 2.5D interactive experiences.
In Unity, you can use the Sprite Renderer to render sprite-type images in either a 2D or 3D scene. This component lets you display images as Sprites for use in both 2D or 3D scenes.
Unity uses the concept of sorting layers to allow you to divide sprites into groups for overlay priority and it also uses the order in layer that can be used to apply consistent priorities to sprites in the same layer.
If you want to learn hands-on how to build a 2D or 3D game, the Unity Content Team put together two comprehensive game kits: 2D Game Kit and 3D Game kit. Both are collections of mechanics, tools, systems and assets that hook up gameplay without you having to write any code.
Real-time rendering examples
Book of the Dead
Book of the Dead demonstrates what’s possible when using Unity’s 2018 new Scriptable Render Pipeline, which provides enhanced customizability of Unity’s rendering architecture, putting more control in the hands of the developers. Unity’s Demo team, the creators of ADAM and The Blacksmith, also used real-time environment assets; all the assets are scanned real-world objects and textures.
ADAM is a short film created with Unity, by the Unity Demo team, and rendered in real time which uses real-time area lights and makes extensive use of high fidelity physics simulation tools. The short film was eventually expanded by District 9 director Neill Bomkamp.
In the real-time ADAM EP 2&3 films, a number of components have come together in Unity to deliver the effects that have gained so much attention. The team behind these films used custom shaders and real-time rendering.
"Thanks to its real-time rendering capability, it doesn’t even feel like I’m working while I am in-engine," (Nate Holroyd, Lighting Artist)