These setup instructions are for the Universal Render Pipeline (URP).
Requirements
- Unity 2021 / 2022 (LTS versions preferred).
- Universal Rendering Pipeline 7.5 or later (import the Universal RP package from the Package Manager).
- Windows / Mac desktop platforms.
URP Import & Initial Setup Walkthrough
Configuration
- Make sure your project meets the above requirements.
- Import Shiny SSRR asset into your project.
- Enable Depth Texture option in the Universal Rendering Pipeline asset.
- Select the URP Renderer and add the “Shiny SSRR” render feature to the list:
- Render Pass Event: specify when Shiny will be executed in the render loop. By default, Shiny reflections will be added after all opaque and transparent objects have been rendered.
- Camera Layer Mask: specify which cameras can render Shiny reflections.
- Ignore Post Processing Option: enabling this option will force Shiny to run even if the camera has post processing option disabled.
- Use Deferred: enable this option if URP is running in deferred rendering path.
- Custom Smoothness/Metallic Pass: this advanced option is only available in forward rendering path. In forward, Shiny reads the smoothness/metallic values from the material attached to the gameobjects. When this option is enabled, Shiny will read the smoothness/metallic values from the output of a custom shader pass named “SmoothnessMetallic” (Red channel = smoothness, Green channel = metallic).
- Use Screen Space Normals: this option is only available in forward rendering path. By default, Shiny will read the bumpmap texture attached to the material of the gameobject. However, when enabling this option, the Reflections scripts can be configured so they use the normals from the URP DepthNormals pass. This option is useful if your scene use shaders that modify the normals.
Deferred vs Forward Rendering Modes
In URP you can choose between deferred or forward rendering mode. Make sure you select the same rendering method in the Shiny SSRR render feature.
- In deferred, you can now jump to Global & Local Volumes section to finish the configuration of the asset.
- In forward, in addition to create a volume, it’s required to add a “Reflections” script to the gameobjects you want to receive reflections (you can add the script to a parent and specify that it will include all children).
Why are Reflections scripts required in Forward Rendering Path?
Forward rendering path only guarantees 2 camera special textures: depth & normals. Smoothness and Metallic information are not available to full screen effects, and this is what the Reflections scripts do: gather the smoothness and metallic information from the materials themselves and pass that info to Shiny shaders.
Reflections scripts can also be used to add reflections to transparent objects which by nature are not compatible with deferred rendering path. Check the demo scene included with Shiny as it contains a puddle gameobeject example.
Advanced topic: there’s an advanced way to avoid using Reflections scripts: enabling the option “Custom Smoothness Metallic Pass” in the Shiny Renderer Feature. This option will execute a custom pass using the same shaders in the scene that have a special pass named “SmoothnessMetallic”. This option is aimed to experienced developers that prefer this approach and can use ShaderGraph or custom shaders to add this special pass. This pass must output the smoothness in the red channel and metallic in the green channel.
Global & Local Volumes
The main approach with Shiny SSRR 2 will be to add the effect to a Global Volume in order to affect the whole scene. This way to set it up is ideal for scenes where the general settings will be applied to your entire environment. However, sometimes you will need specific locations on your scene to have different settings, or even not ve affected by the Screen Space Effect.
To solve this, you can use Local Volumes, with custom settings for that specific volume, and add the Shiny SSRR script only refered to that particular area. This setting works with both Forward and Deferred Rendering Path.
Demo Scene
If everything is properly setup, you should be able to see the reflections in the included demo scene.