hi,guys.
I want to procedurally generate a large terrain. I used UProceduralMeshComponentCreateMeshSection::CreateMeshSection to generate all the hexagonal plots for this terrain. There are about 10,000 blocks, (6*10,000 triangles, 6 triangles per hexagon), but after generating all the plots, the program becomes very
slow. UProceduralMeshComponent performance is not very bad. Is there a better way to do it?
here’s my code.each plot has an index, because I can change its Material later in the game.
I’ve figured out the problem, there’s too much material addition. My code is equivalent to adding a material to each element. So there are too many materials, reaching tens of thousands. Finally causing the program to slow down.