Installation
1. Import the Amplify Occlusion package into your project.
2. After Unity loads it will display the “Importing package” window, select All and click Import.
3. Amplify Occlusion should now be installed in your Unity project and it should have the following directory structure:
- YourProject\Assets\AmplifyOcclusion\
- YourProject\Assets\AmplifyOcclusion\Engine
- YourProject\Assets\AmplifyOcclusion\HighDefinition
- YourProject\Assets\AmplifyOcclusion\HighDefinition\Samples
Requirements
- Unity 2022.3 LTS or newer, including Unity 6.
- High Definition Render Pipeline 14 or newer, set up as the active render pipeline of your project.
- Custom Pass on in the HDRP Asset, under Rendering. It is on by default.
Workflow Overview
IMAGE PLACEHOLDER Volume override inspector with the Ambient Occlusion section and Intensity raised
1. On a Volume profile, press Add Override and pick Lighting/Amplify Occlusion.
2. Enable Intensity and raise it above zero. The effect is skipped while Intensity is left at zero.
3. Adjust the radius, power exponent and blur values until you are satisfied with the results.
4. Optionally, add an Amplify Occlusion Instance component to a camera to choose how the occlusion is computed and applied on that camera, see Amplify Occlusion Instance.
The look of the effect lives in the Volume override, the technical choices live in the Instance on the camera. A camera without an Instance renders with the default settings.
Turn HDRP's own Ambient Occlusion override off while Amplify Occlusion is active, otherwise the scene is occluded twice.
Custom Pass
The effect renders from a custom pass that it puts in place by itself, so there is nothing to register: no Custom Pass Volume and no renderer to set up. It only needs Custom Pass on in the HDRP Asset, under Rendering, which it is by default. The pass runs after the opaque lighting and the sky, ahead of the transparents.
Ambient Occlusion Control
Amplify Occlusion offers two ways of applying the occlusion, set per camera on the Amplify Occlusion Instance. A Debug option is also available for added scene tweaking and flexibility.
IMAGE PLACEHOLDER Side by side comparison: Post Effect vs Injection
Post Effect
- The default. Resembles standard SSAO, it darkens the rendered image and applies the effect to all objects, ahead of the transparents.
Injection
- Injects the occlusion into HDRP's deferred lighting right after the GBuffer, into the data HDRP combines its own ambient occlusion with, so it occludes the same: the indirect diffuse and the emission baked with it, and the indirect specular, reflections included, but not the direct lighting. Bright lit surfaces are preserved. Tint colors the indirect diffuse only.
- Materials HDRP renders forward (Hair, Fabric, Eye, StackLit, AxF, forward only Shader Graphs, transparents) are left unoccluded.
- It needs the Deferred Lit Shader Mode. Cameras in the Forward Lit Shader Mode fall back to Post Effect, with a warning that says why.
- Do not combine it with HDRP's own Ambient Occlusion override, the scene would be occluded twice.
Debug
- Shows the occlusion alone over white, Multi-Bounce included when it is on.
Occlusion Parameters
These are set on the Amplify Occlusion Volume override. Each parameter has its own override checkbox, like any other Volume parameter.
Intensity
- Defines the intensity of the occlusion effect. It starts at zero, like every other override, so a fresh override does nothing until it is turned up.
Tint
- Defines the color of tint of the occlusion effect. With Injection it tints the indirect diffuse only.
Radius
- Defines the radius, or spread, of the occlusion effect, the blur amount is usually adjusted in relation to the spread size.
Power Exponent
- Defines the power exponent value of the occlusion effect, it allows you to easily exaggerate or reduce the overall strength.
Bias
- Occlusion bias, this value will directly influence which areas of your scene will display the effect.
Thickness
- Occlusion thickness heuristic, which allows for tweaking thin occluders such as vegetation. It only applies to the Heuristic thickness method of the GTAO technique. The Bitmask method and the CORTAO technique ignore it and use the per class Thickness of the Thickness Classes instead.
Multi-Bounce
- Lightens the occlusion of bright surfaces by the light that would bounce between them, per color, using the diffuse color of the GBuffer. Applies to the Post Effect and Debug apply methods and needs the Deferred Lit Shader Mode, it has no effect on Forward.
- Injection ignores it: HDRP's lighting always applies its own multi-bounce there. The setting is greyed out while the camera the Game View shows uses Injection.
- When used together with Indirect Lighting the first bounce is partly counted twice, so contacts on bright surfaces come out somewhat bright.
Thickness Classes
The Thickness Classes section of the Volume override sets how much occlusion groups of renderers take and cast, and how thick they are. It holds two settings that read the materials themselves, Unlit Receive and Transmission Thickness, and on Unity 6 (HDRP 17) three layer classes that group renderers by their Rendering Layers.
Unlit Receive
- Share of the occlusion Unlit materials take, 1 (the default) all of it, 0 none. Applies to the Post Effect and Debug apply methods only: Injection writes the lighting of Lit materials, so Unlit pixels get none from it anyway.
Transmission Thickness
- Scales the slab that materials with transmission (Translucent, with or without subsurface scattering) occlude with, 1 leaves it as it is, below 1 they cast a tighter shadow. It reads the material out of the GBuffer, so it covers the Lit materials with transmission.
- Needs the Injection apply method, the Deferred Lit Shader Mode, and the Bitmask thickness method or the CORTAO technique.
Layer Classes
Up to three classes, each with its own occlusion behavior. Set the Rendering Layers of your renderers, pick the same layers on a class, and its Receive, Occlude and Thickness settings then apply to them. The first class that has a layer in common with a renderer is its class. A class with no layers does nothing.
Layers
- The Rendering Layers of the class. A renderer on one of them is in the class. Unlit materials write no rendering layers, so they are never in a class, use Unlit Receive for them.
Receive
- Share of the occlusion the class takes, 1 all of it, 0 none. With Indirect Lighting it also scales the indirect lighting.
Occlude
- When off, the class casts no occlusion onto the rest of the scene. It still occludes itself.
Thickness
- Scales the slab the class occludes with, 1 leaves it as it is. Works with the Bitmask thickness method and the CORTAO technique only.
Requirements and notes
- Layer classes need Unity 6 (HDRP 17). HDRP 14 to 16 have no Rendering Layer Mask Buffer, so on Unity 2022.3 and 2023 the inspector shows Unlit Receive and Transmission Thickness only.
- Layer classes read the Rendering Layer Mask Buffer. Turn it on in the HDRP Asset (Rendering) and in the Frame Settings of the cameras. Projects upgraded to Unity 6 may have it off in the default Frame Settings of cameras, in the HDRP Global Settings. The inspector warns when it is off and offers to turn it on, the classes have no effect until then.
- Every renderer starts on the Default rendering layer, so a class that includes Default applies to all renderers that were not moved to other layers.
- HDRP keeps only the first 16 rendering layers of each renderer, so the classes ignore any layer after those.
- Unlit Receive and Transmission Thickness read the stencil and the GBuffer rather than the rendering layers, so they need no Rendering Layer Mask Buffer and work on every supported version.
| Unity |
HDRP |
Layer classes |
Unlit Receive |
Transmission Thickness
|
| 2022.3 |
14 |
No |
Yes |
Yes
|
| 2023.1 |
15 |
No |
Yes |
Yes
|
| 2023.2 |
16 |
No |
Yes |
Yes
|
| 6000.0 and later |
17 |
Yes |
Yes |
Yes
|
Distance Fade
The Distance Fade option provides a flexible method of fading the Intensity, Tint, Radius, Power Exponent and Thickness with distance.
Fade Enabled
- Enables the fade, the options below are only available when it is on.
Fade Start
- Distance, in units, where the fade starts.
Fade Length
- The length of the fade, in units, you can think of it as a feather effect.
Fade To Intensity
- The Intensity value to fade to. Keep in mind that you will be fading from the value set in the Occlusion Parameters to the value set here.
Fade To Tint
- The Tint value to fade to. With Injection it tints the indirect diffuse only, like Tint.
Fade To Radius
Fade To Power Exponent
- The Power Exponent value to fade to.
Fade To Thickness
- The Thickness value to fade to. Ignored by the Bitmask method and the CORTAO technique, like Thickness.
Bilateral Blur Control
Amplify Occlusion uses an edge preserving bilateral blur to eliminate dithering artifacts, several options are available for added control.
Blur Enabled
- Smooths the occlusion with an edge preserving blur.
Blur Radius
- The radius of the blur effect applied, in screen pixels.
Blur Passes
- Defines the number of passes used for the effect, higher values are more performance intensive.
Blur Sharpness
- Provides control over the occlusion blur sharpness, 0 gives softer edges and 20 gives sharper edges.
Indirect Lighting
Adds short range indirect lighting: the color of nearby surfaces bleeding onto the ones they occlude, gathered along with the occlusion.
Enabled
- Turns Indirect Lighting on. It needs the Deferred Lit Shader Mode, compute shaders, and the Post Effect or Injection apply method, it has no effect anywhere else.
- Post Effect gathers it from the current frame and adds it to the color. Injection gathers it from the previous frame into the GBuffer's baked lighting, so it follows the camera a frame late.
- It turns itself off wherever HDRP's screen space or ray traced global illumination is on.
- With probe volumes, Injection reaches only the pixels lit by lightmaps. Post Effect reaches them all.
- With Injection, HDRP's multi-bounce still applies, so the first bounce is partly counted twice and contacts on bright surfaces come out somewhat bright.
Intensity
- Scales the indirect lighting. 1 is the physically based amount.
Amplify Occlusion Instance
IMAGE PLACEHOLDER Amplify Occlusion Instance component on a camera
Amplify Occlusion Instance is an optional component. Add it to a camera to override how that camera's occlusion is computed and applied. The look of the effect stays in the Volume override. A camera without one renders with the defaults, Post Effect among them. The Scene View follows the camera the Game View shows: its Instance, or the defaults where it has none.
Apply Method
- How the occlusion is applied: Post Effect, Injection or Debug, see Ambient Occlusion Control. The inspector explains why the pipeline falls back to Post Effect when it cannot inject.
Sample Count
- Number of samples per pass: Low, Medium, High and Very High. Higher values will provide the best results at the cost of reduced performance. The default Medium value should suffice for most projects.
Technique
- How the occlusion is computed.
- GTAO (default), Ground Truth Ambient Occlusion, a horizon search along a few slices of the screen around each pixel. Thickness Method picks how its samples occlude what lies behind them.
- CORTAO, Circular Occluder Ray-Traced Ambient Occlusion. Every sample stands for a small sphere, and a set of rays over the hemisphere of the surface is tested against those spheres, so thin objects only darken what lies close behind them. Thickness and Thickness Method do not apply, the Volume's Thickness Classes scale the spheres per class instead.
- Indirect Lighting works with both.
Thickness Method
- How a sample occludes what lies behind it. GTAO technique only.
- Heuristic (default), treats every surface as solid behind it, scaled by the Volume's Thickness. It is the cheapest.
- Bitmask gives every sample a thickness of half the Radius, so thin objects such as poles, railings and foliage stop darkening what lies behind them and contacts tighten. It ignores Thickness, the Volume's Thickness Classes scale the slab per class instead. It costs more at the High and Very High sample counts. Pick Bitmask for scenes with thin geometry near the camera, or when dark halos show behind objects at large radii.
Normal Source
- Where the occlusion takes the surface normals from.
- Normals Texture (default) uses HDRP's normal buffer, with the detail of normal maps. It is free on HDRP, whose normal buffer always exists.
- Depth rebuilds the normals from the depth, without the detail of normal maps.
Full Resolution
- Computes the occlusion at full resolution. Off (the default) computes it at half the width and height, a quarter of the pixels, which is much cheaper with slightly softer contacts. A quick and efficient way to improve overall performance.
Temporal Filter
Amplify Occlusion uses temporal filtering to smooth the occlusion effect through the accumulation of occlusion calculations over time. Each frame needs fewer samples and the noise settles into a smooth result, improving the quality of the effect with a slight performance trade-off and possible ghosting.
With Post Effect and Debug the filter reprojects with HDRP's motion vectors, which also follow moving objects, when Motion Vectors are on in the camera's Frame Settings. Injection runs before HDRP renders its motion vectors, so it reprojects with the camera matrices alone.
Enabled
- Turns the temporal filter on. It is on by default.
Blending
- Controls the overall accumulation decay, from 0 to 1 (default 0.8), by defining how much of the history each frame keeps. Higher values settle the noise more at the expense of possible ghosting behind moving objects, lower values react faster but flicker more.
Response
- Controls how readily camera and object motion discard the history, from 0 to 1 (default 0.5). Higher values discard it sooner, giving less ghosting but more noise in motion, lower values keep it longer.
Technical Considerations
Player Builds
Managed Stripping Level Medium or High breaks HDRP itself in player builds (tested with HDRP 14.0.12 and 17.0.4): HDRP fails to start with a MissingMethodException for UnityEngine.Rendering.HighDefinition.Lit, and the frames come out black. This is in Unity's HDRP package and not in Amplify Occlusion. Use Minimal or Low with HDRP.
Per-camera Settings
The volume stack is global, so every camera renders the effect once an override is active. To keep a specific camera out of it, turn Custom Pass off in that camera's Frame Settings.
MSAA
Cameras with MSAA, which HDRP only allows in the Forward Lit Shader Mode, render without the effect, with a warning in the Console.
XR
The effect renders on XR cameras in Multi Pass and in Single Pass Instanced, with every feature, Indirect Lighting and Thickness Classes included.
What is not supported yet: Single Pass with the multiview extension, which HDRP takes on devices that have it, foveated rendering, and both eyes rendering into one shared texture. An XR camera that uses one of them renders without the effect, with a warning in the Console.
Deferred Only Features
Injection, Indirect Lighting, Multi-Bounce and Transmission Thickness need the Deferred Lit Shader Mode, set in the HDRP Asset and the Frame Settings of the cameras. On Forward, Injection falls back to Post Effect and the others have no effect, the inspector warns when that is the case. Indirect Lighting additionally needs compute shaders.
Troubleshooting
Nothing renders at all
- Custom Pass is most likely off in the HDRP Asset, under Rendering. The Amplify Occlusion volume override and Amplify Occlusion Instance inspectors both warn when that is the case.
- The effect is skipped while Intensity is left at zero.
- Cameras with MSAA, and cameras with Custom Pass off in their Frame Settings, render without the effect.
Injection looks the same as Post Effect, or falls back to Post Effect
- Check the notes on the Apply Method row of the Amplify Occlusion Instance, they say why the pipeline cannot inject. The most common cause is a camera in the Forward Lit Shader Mode.
The scene is occluded twice
- HDRP's own Ambient Occlusion override is active along with Amplify Occlusion. Turn one of them off.
Some materials are not occluded with Injection
- Materials HDRP renders forward (Hair, Fabric, Eye, StackLit, AxF, forward only Shader Graphs, transparents) are left unoccluded by Injection. Use Post Effect if they need the occlusion.
Thickness Classes have no effect
- The Rendering Layer Mask Buffer is off in the HDRP Asset or in the Frame Settings of the camera, or the project runs on a Unity version older than Unity 6, see Thickness Classes requirements.
Indirect Lighting or Multi-Bounce have no effect
- These need the Deferred Lit Shader Mode, see Deferred Only Features. Indirect Lighting also turns itself off wherever HDRP's screen space or ray traced global illumination is on, and Multi-Bounce does not apply to Injection, where HDRP applies its own.
Player builds render black
- Set Managed Stripping Level to Minimal or Low, see Player Builds.
|