- Home /
Per Vertex WrapLambert Fallback
I've written a surface shader that contains a custom Lighting model (wrap lambert) and everything else is pretty typical (texture, normal map, rim lighting). It looks exactly how I want it to, except for when the lights are set to "not important". It switches to a Vertex lit version of my shader, and I completely loose the custom lighting model.
The wrap lambert lighting is probably the most important part of my shader. I would happily loose all the other features if I could somehow create a fallback wrapLambert shader that works on a per vertex mode when the per-pixel shader is not supported.
I understand the calculation I need to do to make this happen, but I don't know how to implement it. Is there somewhere I need to put the fallback code? or some kind of #ifdef statement I can use so that there can be custom code for the vertex lit path?
Your answer
![](https://koobas.hobune.stream/wayback/20220613081237im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Need help with using world position in shader 1 Answer
Vertex program max instructions limit 2 Answers
Z-priming alpha-per-vertex 0 Answers
Strange artifacts on Vertex Color Shader 0 Answers
Problem of color in custom vertex shader 0 Answers