Generate Procedural Mesh

Hi ,

With Procedural Mesh Component, I managed to render the landscape as a mesh, divided up into sections just like the landscape. You can set the landscape to any size, any quad size, and it will match.

On the left is the landscape. On the right is the mesh output which is completely from blueprint, uvs and all. I have a few questions!

  1. The normals are smoothed as if the vertices are shared across triangles. However, I’m purposely creating every vertex of every triangle, then feeding unique elements into the triangle array with the intent on having completely faceted normals. Obviously this isn’t happening. Any help on achieving faceted normals without a shader?
  2. Is it possible to cast this as a static mesh so I can paint vertex colors?
  3. Any idea on sampling the terrain layers’ diffuse textures to a vertex color? Ideally I’d get each diffuse/albedo and X and Y coordinate in world space, look that up in uv space on the diffuse with tiling taken into account, then store that pixel color off. Then I’d determine the blend weight, lerp as needed, then store the result as a vertex color. Move to the next vertex and repeat. But, I don’t know if any of that sampling is available?

P.S. As you can see, triangles on the far right border of the procedural mesh are not set correctly. The linetracing is not hitting the terrain correctly at section borders, so I have to slightly bias the raycast inward per-border-vertex. I have it on the left and bottom borders but not the top and right.

And the blueprint just for fun:

Thanks for your help!