Hi
So in Unity 4 there is a new Mesh method called “MarkDynamic()” that is supposed to create “better performance when continually updating mesh”. But what does it actually do?
Carl Emil
Hi
So in Unity 4 there is a new Mesh method called “MarkDynamic()” that is supposed to create “better performance when continually updating mesh”. But what does it actually do?
Carl Emil
I’m not sure, but I’ll bet it flags it so the mesh doesn’t get cached or something. There’s no reason to cache a mesh that is constantly being altered… and caching is work, so not caching will up performance in the case of a mesh that updates frequently.
Thanks lordofduct. I tested it a bit with a mesh compound system I’m building and found no significant performance boost. I’d like to know in more detail what it does. Perhaps a Unity developer could explain?
This is a part from the DirectX documentation which explains it very well, but must not be the most fitting in the case of how Unity does things:
In case of Unity I think I recall a thread where it was mentioned that it also impacts how the mesh is stored to be more optimized and naturally it will not constantly resend the mesh as it does not change, making best use of VBOs etc.
though U4 in general has a much more opted mesh storage (distinct buffers and only reuploading the vertex buffer not the index buffer, uv buffer etc which already can have a major impact) than 3 so the direct impact will likely require a more sophisticated benchmarking when comparing it to U3
Hi,
I would like to know when this function has to be executed : only once after the mesh creation, or before every update of its content ?
The documentation for this totally sucks.
I call this function before setting my vertices since I have been led to understand that it simply sets an internal flag.