But clearing and rebuilding a mesh takes a lot of processing power. Set up the mesh during initialisation and position the verts of those not needed in any one frame outside the clipping range of the camera. If you have a particular location for hidden verts, it's easy then to check if they're in use or not when you need a new one. They'll still render, but it's still quicker than creating a new mesh every frame.
Think of it like Dimming an Array. You create the 1000 (or however many) items at startup, then use them as needed, then ignore/put away once not needed.
Or, to be poncey, think of it like actors in a stage play. They're all hired before the show opens. When the character walks offstage, the producers don't shoot him and then quickly hire a new actor just before the character's next scene - they just hide him in the green room. Better for everyone :)
Think of it like Dimming an Array. You create the 1000 (or however many) items at startup, then use them as needed, then ignore/put away once not needed.
Or, to be poncey, think of it like actors in a stage play. They're all hired before the show opens. When the character walks offstage, the producers don't shoot him and then quickly hire a new actor just before the character's next scene - they just hide him in the green room. Better for everyone :)