- Home /
Does setting Mesh.colors cause the entire mesh to upload to the GPU?
I have a Mesh object where I need to change the vertex colors periodically. This works fine, but I would like to know how Unity handles the changed color data? I assume the mesh is stored in a vertex buffer or something - does Unity have to transfer the entire mesh to the GPU, or is it able to transfer just the vertex color data?
Answer by The-IT664 · Apr 09, 2013 at 10:51 PM
I'm unsure as to the internal processing of meshes. But from my experience working with dynamic meshes, you will get the best performance when you only modify the array you are working with.
Additionally, storing a reference to the array and modifying it before setting it each frame is faster than allocating a new array or requesting the array from the mesh, modifying it and reassigning it.
Not quite as definitive as I'd like, but if you've seen performance differences when modifying a single array vs. all of them, that would indicate only the changed arrays are resent to the GPU. If nobody else chimes in I'll accept your answer.