A simple keyhole overlay effect, inspired by Dishonored's Peeping keyhole mechanic. It was created for Unity URP (6000.0.27f1) and for Serious Point Games as part of my studies in shader development. It could theoretically run on Unity 2022 since its using the same code I used for the effects's render feature and pass within Unity 2022, but it is untested.
The effect was built on top of the transition post processing code I have, You can refer to it at Github Repo Link. You can refer to the effect's documentation for more info (should be in the repo and its release as a PDF file).
- Create keyhole overlays with a slight blur to the keyhole edges
- Can use custom keyhole textures to have unique keyhole overlays
- Can fade the keyhole overlay in or out
- Can adjust its cutout values to determine how much is cut out or be used as a transition
- Clone repo or download the folder and load it into an unity project.
- Ensure that under the project settings > graphics > Render Graph, you enable Compatibility Mode on (meaning you have Render Graph Disabled).
- Add the render feature of the effect to the Universal Renderer Data you are using.
- Create a volume game object and load the effect's volume component in the volume profile to adjust values
- If needed, you can change the effect's render pass event in its render feature under settings.
Some of the shader code is based from Dan Moran's Shaders Case Study—Pokémon Battle Transitions YouTube video -Youtube Video Link-.