What’s the best mesh component to use for a mesh generated at runtime?

Hi guys,

I’ve decided to port my game over to a more powerful engine (UE5.1). I’ve never used unreal engine before and the first thing I will implement is my terrain.

I have a class which generates a terrain when the game begins and outputs an array of all the vertices. Each vertex has a position, colour and normal. I don’t have an index buffer as my terrain will be flat shaded and all the vertices are already arranged in the correct order.

So I’ve looked into how to generate a mesh given this information and have found several different possible classes such as:

ProceduralMeshComponent - Although if I’m correct, does not support LOD. Speaking of LODs I’d love to try the nanite system if it’s possible

CustomMeshComponent - Not sure what this class is best suited for

StaticMesh - which I believe requires an external object file rather than creating at runtime?

There are several other similar classes but I’m not sure what the best tool for the job is.
In the future I’d like the terrain to be a static physics object and also to have lighting and shadows on it.

If anyone could give me any pointers that’d be great. C++ is preferred over blueprints as it’s what I know best.

Thanks

1 Like