I am working on a shader for a small game that I am creating in Unity but I am having performance issues and need to optimize the shader. I require two colors per vertex and at the moment I have a texture that is split into two columns that gets samples two times per rendered pixel.
I can improve the performance of the shader by removing texture sampling entirely if I could simply encode two vertex colors per vertex. Unity only supports one vertex color per vertex; but I could encode the second vertex color as the UV coordinate.
If I can somehow find a way to swap vertex colors with uv coordinates in Blender; then I could encode both of the colors per vertex whilst also easily being able to switch between vertex colors in vertex color painting mode.
How would I approach doing this with Blender scripting?