Static batching messing with vertex colors?

Does static batching modify vertex colors somehow? Such as converting the colors to a lower bit depth?

I am storing data in vertex colors which I’m then using, in my vertex shader, to look up and blend between values in a StructuredBuffer.

This works fine with a “DisableBatching” = “True” tag, but once I allow static batching the vertices are no longer retrieving the correct data from the buffer.

There are no calculations being done in local space in my shader, so I don’t think that batching “gotcha” applies in this case.

I was able to fix the problem I was having by packing the data differently - I’m now storing part of the data in the primary texture coordinate so there is far less data that now needs to be packed into the vertex color.

This makes me think there is some kind of change to the precision of the vertex color when static batching is enabled, but I can’t find any documentation about that. It’d be nice to get an explanation of what’s going on, but this specific problem is solved.

I think it’s related to this bug : Unity Issue Tracker - Meshes lose vertex color in builds with Static Batching enabled when certain Shaders are present in the scene

(by the way, since I did that bug report, the “certain shaders” part was added by QA, I don’t use any of the shaders mentioned in my real scenes, so I don’t know how related it is)

Anyone have any hints on how I can work around this? I use vertex colors a lot and static batching keeps wiping them in my scenes.

Static Batching causes all sorts of issues. I ran into a problem where Static Batching causes very obvious UV seams: