r/unity_tutorials • u/LlamAcademyOfficial • Jul 19 '22
Video Objects Obstructing View of Your Player? Don't know how to write your own shaders? You can just fade out those objects that are in the way using C# and the built-in URP shaders!
158
Upvotes
2
3
u/mechkbfan Jul 20 '22
Really like how your videos just solve on problem at a time, so it's easy to digest / set as a goal with a spare hour
3
u/LlamAcademyOfficial Jul 19 '22
Full Tutorial on YouTube
Hey all! Happy #TutorialTuesday!
This week you can learn how you can easily fade out objects that are using the standard URP shaders that obstruct view to the player using C# code! It's a common in "top-down" games that something will come between the camera and the Player. Using this relatively straightforward technique you can follow your standard workflow and standard shaders to achieve a simple fade-out effect.
In this tutorial you'll see how to determine which material properties to adjust for the standard URP shaders:
Universal Render Pipeline/LitUniversal Render Pipeline/Complex LitUniversal Render Pipeline/Simple LitUniversal Render Pipeline/UnlitUniversal Render Pipeline/Baked Litas 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.
As always, the full project is available on GitHub!
Using the Built-In Render Pipeline? It's a very similar process. Check out this other GitHub repository with accompanying video tutorial for the same effect, but for the Built-In Render Pipeline.