Decals in URP & HDRP
Published: 31 May 2022
New in 2021! URP (URP12) supports a Decal Projector much like HDRP has had since HDRP6!
๐จ Starting with Unity 2022.1 / URP14 Render Layers are supported! https://docs.unity3d.com/Packages/com.unity.render-pipelines.universal@14.0/manual/renderer-feature-decal.html
Many of us who aren't super comfortable writing our own shaders relied on 3rd party tools for decal projections or went with simple quads for decals. As of Unity 2021, URP now has a Decal Projector much like HDRP has had for a while. It's not perfect, but it's a big improvement over the quad-based decal systems I've implemented before. I'm hopeful the URP one continues to get improvements as new URP and Unity releases come out.
In this tutorial I'll show how to enable decals in URP, review all the configuration options in the render asset and what they do, and go over what all the decal projector options do. We'll do the same again for HDRP so you have an informed starting point for adding decals into your game regardless if you're using URP or HDRP.
Unfortunately, the Built-in render pipeline still doesn't support them without custom shaders, so you'll have to write your own or use a 3rd party solution to get a similar result over there.
๐จโ๐ป As always, all code from this video is available on GitHub:
โซ URP: https://github.com/llamacademy/urp-decal-projector
โซ HDRP: https://github.com/llamacademy/hdrp-decal-projector
๐ท๏ธSave 25% on the ultimate C# IDE: JetBrains Rider with code LLAMACADEMY: https://www.jetbrains.com/store/?section=personal&billing=yearly
๐ Resources ๐
โซ Decal Rendering in URP 12: https://docs.unity3d.com/Packages/com.unity.render-pipelines.universal@12.0/manual/renderer-feature-decal.html
โซ Decal Shader in URP12: https://docs.unity3d.com/Packages/com.unity.render-pipelines.universal@12.0/manual/decal-shader.html
โซ Decal Projector in HDRP: https://docs.unity3d.com/Packages/com.unity.render-pipelines.high-definition@12.1/manual/Decal-Projector.html
โซ Decal Shader in HDRP: https://docs.unity3d.com/Packages/com.unity.render-pipelines.high-definition@12.1/manual/Decal-Shader.html
๐งก Believe in LlamAcademy's mission and have received value from the videos? Here's how you can show your support:
๐ Patreon: https://www.patreon.com/llamacademy
๐ YouTube Member: https://www.youtube.com/channel/UCnWm6pMD38R1E2vCAByGb6w/join or click the Join button on any video
๐ Take my Unity ShaderGraph Course:
https://www.gamedev.tv/p/unity-shader-graph?affcode=45216_kuvg0bp7
๐ Get yourself some LlamAcademy merch: https://llamacademy.myspreadshop.com/
๐ธ Use my Affiliate Link for Humble Bundles https://humblebundleinc.sjv.io/9g4ak4
๐ธ Publisher Sale! 50% OFF an entire publisher's Assets! Publisher changes weekly! https://assetstore.unity.com/publisher-sale?aid=1101l9QvC (affiliate)
๐ธ Save up to 50% on NEW Assets: https://assetstore.unity.com/?new_sale=true&orderBy=1&aid=1101l9QvC (affiliate)
Some links may be affiliate links, which at no additional cost to you, gives me a small portion of the purchase.