- Home /
Change vertices colors without copying whole array
Hi
I have huge mesh (3.7 milion vertices) and I want to manipulate specific vertices of it (right now changing colors), but so far the only way to do this I've found is to copy whole array of colors32 or vertices, which is a pretty slow thing, considering I sometimes only want to change few hundred of vertices. Is there any better way to do it?
Answer by Bunny83 · Jan 25, 2018 at 02:36 PM
No, currently there is no way to lock the internal vertex buffer partially and only return a part of the data. If you have to modify the colors frequently i would recommend you cache the array and keep it. That way you don't have to reallocate the array everytime and you don't generate garbage. You can just modify your cached array and use SetColors32() on the same array.
Your answer
Follow this Question
Related Questions
Problem with setting vertices positions and smoothing groups. 1 Answer
How to manipulate(flatten) the Mesh of an object 0 Answers
Mesh filters missing their meshes when project cloned from bitbucket 2 Answers
Array index is out of range in MeshMorpher 2 Answers
Can't change verts on mesh after assigning to meshfilter. 1 Answer