Hello again Unity Community! Development on my little project has continued over the past year, but I’ve run into another snag. Hopefully somebody can get me unstuck!
In a post above, I wrote “shadows should work but I have not checked” regarding my texel lighting shader. As you can see, shadows very much DO work, and fall along the pixel grid of textures. I am very proud of this charming effect. It’s fantastic and crunchy in motion.
However, in my project I’ve started to use Unity’s “terrain” module to create natural environments. It’s a big timesaver, but its multi-texture shader will need to be modified for per-texel lighting. See here, where the shadow cast across the wood is pixelated (using my shader) but the shadow across the grass, which is a terrain object, is not (using unity’s standard terrain shader).
I tried modifying the Unity terrain shader, but found it pretty difficult to understand. In particular, the “Standard-FirstPass” terrain shader seems to be a surface shader rather than a vertex / fragment shader.
It seems that this type of shader doesn’t expose the lighting and shadow calculations I would need to modify in order to get texel-based shading to work. This “surf” step seems to be designed for texture blending or other simple activities, while lighting, shadow, and other passes are automatically generated and therefore not editable.
Does someone more knowledgeable than I am have any suggestions for how I might create a terrain shader with the same lighting model as the standard shader, but also with the texel-shading modifications I created above? How should I go about this? Would I be better off converting the standard shader to have all the properties needed to render terrain, or would it be smarter to convert the standard terrain shader from surface to vert/frag and then modify it?
Are there any good resources for either of those options?

