I have a whole bunch of little quads that I need to render, with shading that I want to control myself. I previously did this by calling DrawMesh on each one, using a MaterialPropertyBlock to change the main color according to my custom lighting. (This is all using the VertexLit shader, if that matters.)
So that worked fine, but I found that as the number of quads went up, the frame rate dropped precipitously. So I now combine them, using CombineMeshes, into one big mesh that draws super-fast.
But now I've lost my control over lighting. I suspect that there is a solution here involving shaders, but being still a newbie, I don't really understand shaders. For example, I really like the look of this shader:
...and it talks about "vertex color values," which sound quite promising. But how in the world do you define vertex color values? If I knew the answer to that, I could probably define the right color for the four vertices in each quad as I build up the one big mesh.
Or maybe there's a simpler solution I'm overlooking?
asked Feb 05 '11 at 11:34 PM