Multimesh is just a name I came up with for a simple concept - a vertex buffer that manages rectangular elements for maximum efficient drawing.
Multimesh essentially allows you to have a large number of rectangular "items" all stored in a vertex buffer, and upon drawing, will only render the rectangular items that are present, very efficiently with a single draw call on a vertex buffer object.
Two points
You can add rectangular items with append(). An integer value is returned representing the index, or position, of the item in the buffer.
When you remove() an item by index, then that index will be re-issued to an existing item that was from the back of the list. The number returned by remove() is the old, now no longer used index num of the item that was moved from the back. You will need to update the old index of the moved object in your own code.
Still Missing
append and append_raw need to return the added item's integer index. Will add that as a fast-follow after merging.
Anicdotes
The class can probably be renamed. It also includes MultiMeshUV and MultiMeshUVAtlas. The atlas is basically an int-indexed list of uv coordinates for a texture. That list is used by the MultiMesh to simplify building the items.
Also
Implicitly, this branch also included an update to Network2/Message 🤷♂️. It sets some constant properties to constexpr, now that that feature is available.
Multimesh
Multimesh is just a name I came up with for a simple concept - a vertex buffer that manages rectangular elements for maximum efficient drawing.
Multimesh essentially allows you to have a large number of rectangular "items" all stored in a vertex buffer, and upon drawing, will only render the rectangular items that are present, very efficiently with a single draw call on a vertex buffer object.
Two points
append()
. An integer value is returned representing the index, or position, of the item in the buffer.remove()
an item by index, then that index will be re-issued to an existing item that was from the back of the list. The number returned byremove()
is the old, now no longer used index num of the item that was moved from the back. You will need to update the old index of the moved object in your own code.Still Missing
append
andappend_raw
need to return the added item's integer index. Will add that as a fast-follow after merging.Anicdotes
The class can probably be renamed. It also includes
MultiMeshUV
andMultiMeshUVAtlas
. The atlas is basically an int-indexed list ofuv
coordinates for a texture. That list is used by theMultiMesh
to simplify building the items.Also
Implicitly, this branch also included an update to
Network2/Message
🤷♂️. It sets some constant properties toconstexpr
, now that that feature is available.