Fade Objects with C# and the Standard URP Shaders
Published: 19 Jul 2022
Learn how you can easily fade out objects that are using the standard URP shaders that obstruct view to the player using C# code!
In this tutorial you'll see how to determine which material properties to adjust for the standard URP shaders:
⚫ Universal Render Pipeline/Lit
⚫ Universal Render Pipeline/Complex Lit
⚫ Universal Render Pipeline/Simple Lit
⚫ Universal Render Pipeline/Unlit
⚫ Universal Render Pipeline/Baked Lit
as well as learn the process to determine which properties to modify for any other shader when documentation is lacking!
In my tests this performs on average, 0.04ms per frame with the code here, which is, in my opinion, for most cases "good enough" performance to use when you do not know how to make a shader to do this, or just want to keep using the standard URP shaders.
Using the Built-In Render Pipeline? It's a very similar process. Check out this GitHub repository: https://github.com/llamacademy/fade-objects-standard-shader with accompanying video tutorial:https://www.youtube.com/watch?v=dIC4wbUgt5M for the same effect, but for the Built-In Render Pipeline.
👨💻 As always, all code from this video is available on GitHub: https://github.com/llamacademy/urp-fading-standard-shaders
🏷️Save 25% on the ultimate C# IDE: JetBrains Rider with code LLAMACADEMY: https://www.jetbrains.com/store/?section=personal&billing=yearly
🧡 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.