Search Unity

PostFX v2 - Amazing visuals, upgraded

June 11, 2018 in Technology | 9 min. read
Share

Is this article helpful for you?

Thank you for your feedback!

The Post-Processing Stack makes it easy to create and fine-tune high-quality visuals for dramatic and realistic effect. Coming out of beta in 2018.1, we’ve added the most requested features and have fixed as many bugs as possible. We’ve also added mobile-specific paths, volume blending, and a complete framework for custom user-effects.

Version 2 (v2) of the Post-Processing Stack ships as the first of many upcoming packages, which will give users the plug-in flexibility of an Asset Store pack, but with the update-ability of a core Unity feature. It’s also available via the Templates in the Unity Hub.

In 2018.1 the Post-Processing Stack (PostFX v2) has been improved to feature higher-quality effects, automatic volume blending with a powerful override stack, and a flexible framework to write and distribute your own custom effects. It’s compatible with the LWRP, HDRP, and built-in rendering pipelines.

(image on left no post processing, imagine on right with full stack)

How it’s progressed

PostFX v1 has been available from the Asset Store for free for some time with the aim to gather user feedback, understand user workflows and improve quality and efficiency. This gave us valuable insight into how we can improve this feature and take it to the next level.

PostFX v2 provides many of the same effects in an improved form, and we’ve changed the workflow to a volumetric approach to make it easier to swap between effects instead of having multiple cameras, each one with its own stack.

PostFX v2 has been on hosted on GitHub throughout its development, we did this to be as open and transparent as possible so that you, our users can give feedback and also contribute if you wish. Through this process, we have had some amazing responses: over 2000★ and 330 forks. We opened 450 tickets and 30 pull requests, from minor fixes to bigger PRs where our users had customized the stack and sent us their changeset.

Thank you to all who tried it out, provided feedback and any PRs. It really does help.

How to get it now

You can now access it via Package manager in the editor, this is the tested and verified version of the package. If you’re after the very latest development branch of PostFX v2 then it still will be hosted on GitHub.

If you are new to Package Manager, a Unity 2017.2 addition, it’s a modular system and API that dynamically loads and updates new Unity-developed features in your projects. Unity 2018.1 takes it one step further with the newly released Package Manager User Interface, the Hub, and Project Templates, all of which help you get new projects started faster and more efficiently. For more information see our Package Manager documentation.

You can also get it via the Unity Hub through the Templates. Project Templates change the way you launch a new project in Unity. The aim of Unity Project Templates is to improve the “out of the box” Unity experience for the majority of users. They provide preselected settings based on common best practices for different project types such as mobile, high-end PC, 3D, 2D, VR, etc.

You can see how to get the most of templates in this blog post.

What’s included

As a default, we have a whole range of effects built in for you to customize the look and feel of your scene. Many of these effects have been re-written since v1 and there are some new components as part of the this new version. When possible, we try to merge the effects into one pass while others are still standalone. We also have some mobile specific options to help optimize on lower end devices. Let’s jump in to see what’s there:

Ambient Occlusion (SAO, MSVO)

It darkens creases, holes, intersections and surfaces that are close to each other. In real life, such areas tend to block out or occlude ambient light, hence they appear darker.

Anti-aliasing (FXAA, SMAA, TAA)

The Anti-aliasing effect offers a set of algorithms designed to prevent aliasing and give a smoother appearance to 3D graphics. Aliasing is an effect where lines appear jagged or have a “staircase” appearance.

The algorithms supplied in the post-processing stack are:

  • Fast Approximate Anti-aliasing (FXAA)
  • Subpixel Morphological Anti-aliasing (SMAA)
  • Temporal Anti-aliasing (TAA)

Auto-exposure

This effect dynamically adjusts the exposure of the image according to the range of brightness levels it contains. The adjustment takes place gradually over a period of time, so the player can be briefly dazzled by bright outdoor light when, say, emerging from a dark tunnel. Equally, when moving from a bright scene to a dark one, the “eye” takes some time to adjust. In fact, this effect was called “Eye Adaptation” in the v1 stack.

Bloom

This effect produces fringes of light extending from the borders of bright areas in an image, contributing to the illusion of an extremely bright light overwhelming the camera or eye.

Chromatic Aberration

This is an effect resulting from a camera’s lens failing to converge all colors to the same point. It appears as “fringes” of color along boundaries that separate dark and bright parts of the image.

The Chromatic Aberration effect is used to replicate this camera defect. It’s also often used to artistic effect, for example as a part of camera impact.

Color Grading (LDR, HDR, CUBES)

Color grading is the process of altering or correcting the color and luminance of the final image. You can think of it like applying filters in something like Instagram.

The Color Grading effect comes with three modes:

  • Low Definition Range: this mode is aimed at lower-end platforms but it can be used on any platform. Grading is applied to the final rendered frame clamped in a [0,1] range and stored in a standard LUT.
  • High Definition Range: this mode is aimed at platforms that support HDR rendering. All the color operations will be applied in HDR and stored into a 3D log-encoded LUT to ensure a sufficient range coverage and precision (Alexa LogC El1000).
  • External: this mode allows you to provide a custom 3D LUT authored in external software.

Depth of Field

Depth of Field is a common post-processing effect that simulates the focus properties of a camera lens. In real life, a camera can only focus sharply on an object at a specific distance; objects nearer or farther from the camera will be somewhat out of focus.

Grain

The Grain effect is based on a coherent gradient noise. It is commonly used to emulate the apparent imperfections of film and often exaggerated in horror themed games.

Lens Distortion

This effect simulates the shape of a lens by distorting or undistorting the final rendered picture.

Motion Blur

Motion Blur is a common post-processing effect that simulates the blurring of an image when objects filmed by a camera are moving faster than the camera’s exposure time. This can be caused by rapidly moving objects or a long exposure time.

Screen-space Reflections

Screen-space Reflection is a technique for reusing screen-space data to calculate reflections. It is commonly used to create more subtle reflections such as on wet floor surfaces or in puddles.

Vignette

In Photography, vignetting is the term used for the darkening and/or desaturating towards the edges of an image compared to the center.

The Components

Post Process Layer

The Post Process Layer component would sit on your camera. You can find it in Component -> Rendering -> Post-process Layer.

Broken down under different headings you can; control the volume blending by setting the trigger (usually the camera Transform) and what layer that applies to, apply your chosen method of anti-aliasing and enable fog. The extra “Toolkit” settings below come with a few utilities to export the current frame to EXR format.

Finally, the last section allows you to change the rendering order of custom effects. More information on Writing Custom Effects.

Post Process Volume

The way post-processing works in this framework is by using local & global volumes. It allows you to give each volume a priority and a set of effect overrides to automatically blend post-processing settings in your scene. For instance, you could have a light vignette effect set-up globally, but when the player enters a cave you would only override the Intensity setting of the vignette to make it stronger while keeping the rest of the settings intact.

In this example I have one Global Volume with “Is Global” ticked, every other volume would derive from this volume and Post Process Profile. I’ve then created a “Cave Area Profile” to override the effects from the “Global Profile” when my Camera (the trigger) enters the Trigger area (Set up by the box collider. The “Cave Area Profile” has a blend distance set and a higher priority than my Global Volume.

We can see in the video below how it works in the scene. As the camera enters the volume, the global settings are overridden and the effects blend nicely.

This content is hosted by a third party provider that does not allow video views without acceptance of Targeting Cookies. Please set your cookie preferences for Targeting Cookies to yes if you wish to view videos from these providers.

Post Process Debug

The post-processing stack also includes a collection of monitors and debug views to help you set up your effects correctly and debug problems in the output.

Creating Custom Effects

This framework also allows you to write custom post-processing effects and plug them into the stack without having to modify the codebase. Of course, all effects you write against the framework will work out-of-the-box with volume blending, and unless you need loop-dependent features, they'll also automatically work with the Scriptable Render Pipeline (SRP)!

You can see many experiments from one of our field engineer’s Keijiro on Twitter:

Implementing custom effects for the post processing stack. https://t.co/SVNCptnKgn pic.twitter.com/QVRQ6aYBuP

— Keijiro Takahashi (@_kzr) March 21, 2018

Added a few stylization effects. https://t.co/SVNCptnKgn pic.twitter.com/PDRshGggXX

— Keijiro Takahashi (@_kzr) March 21, 2018

Using it with Cinemachine and Timeline

PostFx v2 is tightly integrated with other part of the Editor such as Cinemachine, with a Cinemachine Post Processing Component. Both of these can be added to Timeline allowing Artists and Designers full creative control. You can see examples on our YouTube channel and via our Learn site.

Running on Mobile

Running Post Processing on mobile isn’t an easy feat and certain effects, such as Ambient Occlusion are just far too expensive to run on even the most high-end mobile platform.

For some effects, such as Anti-aliasing, Bloom and Chromatic Aberration, we’ve created ‘fast mode’, boosting performance by reducing quality. We would also suggest using Low Definition Range for Color Grading and reducing the use of other effects as much as possible. We’re working on even more specific optimizations for mobile which will come in the future.

Conclusion

PostFx v2 enables you to easily create and fine-tune high-quality visuals for dramatic and realistic effect. Volume blending makes it easier to switch between, override and blend between different in-built or custom effects. You can find a more extensive guide on our Post-processing wiki.

It's now available via package manager in 2018.1 or on GitHub if you’re still using 2017.x. We’ll continue to update the package on both channels.

If you still haven't tried 2018.1, then now's the time to jump on board!

Keep on creating.

June 11, 2018 in Technology | 9 min. read

Is this article helpful for you?

Thank you for your feedback!