I'm working on a custom shader using Unity 2018's new shader graph feature. Previously, I was using this shader, which worked great for awhile, but it ended up constantly breaking for seemingly no reason. I was also limited to how I could modify it, since I didn't know much about coding custom shaders.

Unity's shader graph option is exactly what I need, and I'm hoping to recreate what I was using before in the graph. So far, I was able to get vertex colors and alpha transparency working. But, there's still a few issues:

1) Shadows show through transparent faces, no matter how high the alpha value is for those colors: enter image description here

2) When looking at transparent objects behind other transparent objects, there is an obvious sorting error. All objects belong to the same mesh, so the best way I can think of is to hide transparent faces behind other transparent faces. I was able to figure out how to modify the previous shader's code to achieve this, but am not sure how to implement this functionality in the graph. enter image description here

3) Shadows are all the same, no matter the alpha value for vertex colors. The previous shader modified the strength of the shadows to be relative to the transparency of each face. enter image description here

Is there a way to address these issues when using a PBR Shader Graph? Any help is appreciated; this is the basic setup I have so far: enter image description here


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.