What is PBR?
The information in this guide is essential for any artist authoring assets in a "next-gen" production setting -- which is to say virtually every end-user of a modern game engine. Whether you're a seasoned AAA veteran or a student in the classroom, this guide is determined to kickstart your understanding of Physically Based Rendering and demonstrate how to take advantage of the technology. Efficiently.
Ready or not, PBR is the new standard.
With the release of Unity 5 and UE4 so came the wide-spread adoption of Physically Based Rendering (PBR)*. It's an exciting time to be a game artist, realtime physically-based rendering is offering every artist out there the chance to author assets which compete with the most visually compelling experiences to date. This is, of course, to be expected with most advancements in realtime rendering once they hit the mainstream, but physically based rendering introduces something special -- consistency.
That's right, consistency. PBR, when utilized as intended, allows artists to author assets which retain their visual fidelity under virtually any lighting environment -- not an easy feat to accomplish as any lead artist can tell you. But not all is well in this time of transition... Time and again I have seen physically based materials authored inefficiently, incorrectly, and ultimately failing to take advantage of the inherent behavior and power of PBR. Often this presents itself as an artist attempting to ad-hoc (eyeball) the property values of their material(s) to the tune of a very specific lighting environment -- only to find out that their Chesterfield sofa which looks plush and inviting in one scene then devolves to a steel-reinforced slab of concrete in another. (Speaking from painful experience here.)
* Unity has overwhelmingly adopted the term Physically-Based Shading, or PBS; the two are interchangeable but PBR is more common in physically-based literature.
isn't pBR too expensive for mobile?
Well, that's for you and your team to decide.
Modern mobile devices, especially the ever-popular flagship devices (e.g. iPhone, Galaxy, Nexus, etc.) have rendering capabilities far beyond what the average consumer, and many a developer, realize. In fact it's still common place for game developers to look to their on-screen vertex count as the compass needle for optimization -- that's simply not the case with a properly optimized scene. Would you believe it if I told you it is possible to render a 13,000 square foot, 3-story open-air environment weighing in at more than 1 million verts on an iPhone 4?
These are of course in-editor captures, but you don't have to take my word for it; dig up your old iPhone 4 and download Republique: Metamorphosis on the Apple App Store. It runs 1 million vertices at a solid 30 FPS even with the added complexity of multiple skinned characters, running water, flowing fabric, and a bounty of post FX.
How was this accomplished?
Combining proximal meshes which share the same shader
Combining those meshes as close to the maximum addressable number of verts-per-mesh possible (i.e. 65,536 verts for Unity which uses a 16-bit buffer)
Re-sizing and clamping texture resolutions on a per-scene basis
Combining all textures into an atlas on a per-scene/per-shader basis
Using the appropriate texture compression to strip out unused channels
Reducing overdraw of meshes, especially those with blending properties
Batching (Static & Dynamic)
Occlusion volumes based on FOV of the fix-position cameras
(Note: Mobile optimization guide is on the horizon.)
Depending on the complexity of your scene, implementing these optimizations can be the difference of a 1,000% in terms of latency. During the development of Republique's most ambitious scenes I routinely saw latency improvements in the range of 100ms [10 FPS] to 10ms [60 FPS] while employing the above techniques. In fact, the optimization gains became so formulaic and predictable that we were able to create increasingly grandiose environments as the series progressed.
So, are you using Unity 5 to compose an immersive experience? Does your scene have at least one dynamic light? Well chances are you're paying the overhead for a physically-based lighting engine, possibly PBR shaders as well, while missing out on some (or all) of the perks that come with the shiny new territory of PBR.
The Library of Republique: Metamorphosis isn't physically based, in fact it's almost entirely diffuse-only with static light-mapping, but it demonstrates what can be accomplished when you profile your platform and develop to your device's strengths.
PART 1 OF 3
Unfamiliar with PBR? This introduction and summary of the technology will get you up to speed on the basics of PBR.
PART 2 OF 3
Familiar with PBR and ready to start authoring your own physically based materials in Unity 5? Start Here!
PART 3 OF 3
Looking for examples? Additional resources and a downloadable asset package featuring 10 materials here.