The Native Geometry Generator (NGG) is a private project that allows for chunk-based geometry generation using Unreal's UProceduralMeshComponent.
I have implemented the Marching Cubes algorithm to allow surface editing. Individual chunks register themselves to the chunk manager and allow for edits that can affect multiple chunks at once.
A rough overview of the functionality can be seen in the video
- You can use individual chunks to create a map which create a surface using the UMath::Perlin noise function.
- Editing of the surface using a spherical brush like:
- An actor can call either EditTerrain or EditTerrainOVERRIDE
- EditTerrain uses the chunk manager and allows for editing of terrain over multiple chunks
- EditTerrainOVERRIDE only adapts the individual chunk that is called. This may may be used, but I advise against it ;)
- For each individual chunk one can define:
- Extent: How large is the individual chunk
- Cube Resolution: The size of the cube that is used in the marching cube algorithm
- Feature Size: The size of the perlin noise features. A smaller value leads to more extreme differences which could represent a mountainous area. You do you :)
- Use Smooth Surface: Boolean that defines whether a more exact surface representation should be done or whether the edges of the marching cube are always snapped to 0.5.
- Expose the generation function so that users can overwrite this and have custom mesh generation (e.g. Underground tunnel systems)
- Expose VoxelData so that users can save the current version of chunks and the chunk state is not lost when destructing.
- Bugfixes (e.g. Chunks are currently not unregistered from the chunk manager if they are destructed)