Generate Procedural Mesh

[=;195577]
Hey guys,

I ended up doing this:

But i have a couple of issues:

The materials are wrong:

Also to dynamicaly update the mesh (add verticies, remove verticies) is there any better alternative with ue4 rhi?

I see FRenderResource object has BeginUpdateResourceRHI but i don’t really understand how to use it or what can i do with this method.
[/]

The easiest way of handling landscape materials would be to use worldspace position texture uvs/tiling and triplaner projection then you won’t have to calculate and send the uvs with the vertex data to the video card and you won’t have to worry about material borders. (there are multiple examples of triplaner texturing around for UDK that pretty much work as is, there are also materials nodes built in for landscape that handle it as well, they just didn’t suit my purposes).

You can also get a cross of ddx and ddy material nodes and use it as the normal as well if you set the material to not use tangent space normals, then you also can not send the normals to the video card.