Open Lasercar opened 3 years ago
I think this happens when the generated mesh get more than 65535 vertices. Can you check that and report back?
Yep, the MeshBlender mesh has more than 65535 vertices.
In general, creating such a big mesh is bad design. In your example, the rail road will be drawn entirely each frame, even if only 1% of it is in the camera field. I would suggest creating a script that will only build the track out of a certain number of curve or a certain distance, to prevent reaching the mesh vertex limit and enable frustrum culling.
As for going past the limit, I think it is possible to ask Unity to manage meshes with more vertices but I never tried it. It should also be possible to change the MeshBender code to create a new mesh when the limit is reached, but this will require some code refactor, and you would need to manage the normal smoothing where the two mesh connect.
Ok. Not sure where to start for all of that though.
When a repeating spline mesh tiling is extended to a long distance, it breaks and repeats onto itself. I've checked and no one else has reported this. I'm using Unity 2020.3.14f1.