- Home /
Possible to change vertex colors of static objects?
Hey all!
Currently in the process of optimizing a mobile project and realized that due to some of my visual tech, I haven't been making use of Unity's nifty batching features. A core aspect of the game involves dynamically changing the vertex colors on meshes near the player. Problem is, I don't seem to be able to modify vertex colors on objects marked batching static during play. Is there any way to accomplish this?
For reference, here is my scene setup:
I'm currently using a single material applied to everything in the environment (and an edge detection image effect on the camera) in case I have to use GPU Instancing. If batching isn't possible for what I'd like to do here, are there any other tricks I could use to reduce the draw calls?
This is all relatively new to me, so any advice would be greatly appreciated.
Thanks!
I've also been experimenting with manually calling this function:
StaticBatchingUtility.Combine(EnvironmentParent);
` But no luck. Is there anything else I could do to batch objects with interactive vertex colors?
Answer by Eric5h5 · Dec 05, 2016 at 05:31 PM
Static means "unchanging", so no, that's not possible. Dynamic batching is for objects that change, but it has restrictive limits on the number of vertex attributes that can be used in an object (otherwise the time spent batching exceeds the time you would save by having combined objects). Instanced objects also have to be identical.
Ah, that's what I thought. Thanks! I'll shift focus to manually combining meshes then.