- Home /
Shadow acne/artifacts in creating toon shader shader graph URP
I am trying to follow this guide in creating a custom lighting shader starting from the URP unlit shader graph. https://www.youtube.com/watch?v=DOLE4nrK97g
Also using some code from this accompanying blog post - https://blogs.unity3d.com/2019/07/31/custom-lighting-in-shader-graph-expanding-your-graphs-in-2019/
These don't work as expected anymore. Without throwing any errors they simply do not get the cast shadow attenuation data at all. I tried some fixes from this forum thread and got the following result to happen in the attached image - https://forum.unity.com/threads/shadow-and-distance-attenuation-do-not-work-in-urp-unlit-graph.803025/
by adding
#pragma multi_compile _ _MAIN_LIGHT_SHADOWS
#pragma multi_compile _ _MAIN_LIGHT_SHADOWS_CASCADE
at the top of the HLSL file it seems to get the shadow data now, however the shadows look really terrible and not like shown in the video or the blog post. In the attached image I have removed the Lambert lighting logic and only left the shadow attenuation logic. I have my URP shadow quality settings set to maximum. A simple capsule and cylinder has all these jaggies and artifacts and the character is just a mess of flashing black when walking around.
Can someone help me understand why it appears the shadowmap resolution is so low or incorrect, and how I can get clean shadow data in an unlit graph so I can continue making my custom lighting solution?
Your answer
Follow this Question
Related Questions
URP Blit Render Feature not rendering in Single Pass Instanced VR 0 Answers
Rigged 2D Sprite looks weird after adding a shadergraph material 0 Answers
Help combining Cutout + Toon Shader 1 Answer
Custom Shader not working on build (Windows and URP) 0 Answers
Ojbect with Unity's default Toon Light/outlined Shader drawing black when seen from inside? 0 Answers