I'm going to make a game similar to AudioSurf for iOS, and implement in it "generate of route to certain parameters". I used the example of Extrude Mesh from Unity Procedural Example and this answer on question - link But in iOS there is considerable lag in the extrusion of the object, and if the whole route extrude early in the game - it takes a lot of time, it also has a display problem of the track, consists of a large number of polygons... Can you advise me how to display the generated route or what is the best way to generate route?
-
+1 More or less just because of how much I'd love to have a game like that on my phone. – Mick MacCallum Sep 07 '12 at 21:21
-
Asked by OP in [Unity Answers](http://answers.unity3d.com/questions/315059/how-to-improve-performance-while-generating-extrud.html), question answered there as well. – Jerdak Sep 10 '12 at 14:11
1 Answers
You can tremendously increase the performance in procedural mesh generation by-
- Instead of generating new meshes, you can edit the vertices and triangles arrays of the mesh i.e use fixed size triangle and vertex array-
create a class "RoadMesh" and add functions to it like- UpdateRoadMesh(Vector3 playerPosition) this function will calculate and set the values of vertices and triangles at the far end on the road depending on the current position of the player, While updating the array values when you reach the end on the vertices and triangles array start using the beginning indexes as the player would already have crossed those points . as no new mesh is created and the vertices are also edited once every few frames it will have tremendous performance..

- 587
- 1
- 6
- 28