Procedural Mesh Generation

Just wondering if it was possible to code a procedural generated mesh to use as terrain.

Hi Jon,

You can generate the visual mesh by using FDynamicMeshBuilder. You can create arbitrary geometry with that class, if you search the source code from GitHub, you should see a lot of examples of it being used.

If you wanted to do voxelized terrain like minecraft. You would need to handle collision by likely using raycasts against the voxel octree you create.

Hope that helps!

Nick (Epic Games)

There is also a UCustomMeshComponent which apparently simply takes triangles. Would that be usable just as a component of a “terrain” actor?

Using FDynamicMeshBuilder seems a bit tricky when you want to draw it and don’t know the engine, but need to get a primitive drawing interface and a view somehow.

I tried to find out about FDynamicMeshBuilder by studying the source. What I saw is that FDynamicMeshBuilder draws to a PrimitiveDrawInterface. Where would I get the PDI from? Is this really the way to go if you want to create a mesh component that can be added to an actor?
Or should UCustomMeshComponent be used? I tried including it, but the header cannot be found (private?).

Could you explain in more detail how to achieve this?

How could arrange for it to begin FDynamicMeshBuilder generate , I see that are separate instructions , as they work together , I suck at this from the mesh.