Procedural Meshes - Unable to Produce Sharp Edges

  1. Fill an array of vertices array and array of triangles(integers) to create two square surfaces, that are perpendicular to each other, with 6 or 8 vertices.

  2. Calculate tangents and normals

  3. Add Spline Mesh Component with these data.

  4. Result: Whether you make faces separate by duplicating vertices on the merge points, or not, result is same: Transition is smooth.

I am unable to produce hard edges with procedural mesh generator in blueprints.

I was able to fix this issue by coding my own “Calculate Sharp Normals” function. Looks like, existing “Calculate Normals and Tangents” function in the engine matches vertices by their coordinates, not indices; and this is a wrong approach to calculate normals in most cases. Instead, I assigned averages of matching triangles’ normals to each vertex.

Here is the comparison. Base Color input of the material is connected to VertexNormalWS node.

I will continue developing this function to be able to use smoothing groups.

How could you get a “Sharp normals”? I can only set one normal direction for each vertex, it is always smooth.

I am facing same problem in procedural mesh generation. Is there any solution?

I have a function library which have this function: “Calculate Normals Non Pure”. This function calculates normals correctly, which Kismet’s function can’t do.

Even it is made with only blueprint, it is faster than native calculation function of Epic’s Kismet Function Library.

You can create smooth or sharp normals. Also you can use smoothing groups too.

118074-untitled.jpg

Links:

Alternative:

CAN SOMEONE FROM EPIC ADD THIS TO THE ENGINE AS A NATIVE FUNCTION? YOUR EXISTING FUNCTION IS CALCULATING VERY WRONG NORMALS

Noooo. This is not an answer, please do not mark. This is a bug. Please put this to issues.unrealengine.com