Hi there,
Hoping someone can provide some help/advice.
I’ve built the foundations of a procedurally generated terrain system using UDynamicMeshActor which contains a UDynamicMeshComponent which in turn has a UDynamicMesh…
I create a grid of these on startup that are joined together (ie 5 x 5) in order to allow for reducing LODs for outer meshes. The dynamic meshes are just flat planes as I adjust the z coord using a Material which takes in a height-map generated using Perlin noise that is processed to modify the World Position Offset. I do it this way to avoid the hit of constantly recomputing the mesh on the CPU-side. Essentially, the meshes themselves never change or move (and the LODs are even static) as I can just move the meshes with the camera and the only adjustment that needs to be made is the texture coord offset used for the heightmap to the WPO. It works pretty well so far and ive got a grid of meshes with different materials representing different biomes at runtime.
The problem arises with collision detection. Given i’ve gone to the trouble of computing the changes to the heightmap on the GPU, i dont want to have to compute a collision mesh on the CPU that changes frequently (it’s supposed to be a very large world ie 4000km x 4000km as an experiment…) So, how do I allow for objects to still collide with the terrain given it’s being adjusted in the shader using WPO?
Thanks for your help!