URP_ShaderGraphCustomLighting icon indicating copy to clipboard operation
URP_ShaderGraphCustomLighting copied to clipboard

Vertex Lit Support

Open F11BOT opened this issue 3 years ago • 1 comments

Thank you for you work, it has helped me a lot exploring new ideas and learn about shaders without having to mess much with shader code!

There is a way to set every shader to vertex lit, but I wanted to make only some of them using this technique to have better performance, is there a way to make a vertex lit shader using your resources?

F11BOT avatar Sep 01 '23 10:09 F11BOT

Should be possible to do lighting calculations in the Vertex stage in Shader Graph by using a Custom Interpolator. For info/examples see : https://www.cyanilux.com/tutorials/intro-to-shader-graph/#custom-interpolators https://docs.unity3d.com/Packages/[email protected]/manual/Custom-Interpolators.html

In particular, I think the usual vertex lighting that URP uses applies only to Additional Lights (and just diffuse), so you'd want to pass that subgraph through the interpolator. Could also handle Main Light calcs in vertex stage as that may be cheaper.

Cyanilux avatar Sep 01 '23 19:09 Cyanilux