Hi, I’m converting built-in Unity’s vertexlit shaders to CG. Is it possible to create a custom vertexlit lighting model with a surface shader? An example would be great.
I know that this can be done with plain CG code, but then I wouldn’t want to consider writing code for all of the passes (forwardbase and forwardadd), different light types and lightmapping.
It would be great to see an example of a vertexlit CG/surf shader, that properly handles all of the passes and light types. The CG vertexlit shader examples found on wikibooks isn’t good enough, because it uses performance-heavy branching.