Smoothed shading like Blender

Is there a quick way to get shading like Blender’s smooth option?

There is no built in way afaik

The smooth option in blender recomputes the normals of the mesh by averaging the normals of the surrounding faces for each vertex.

You can look at how GeometryBatchFactory gather triangle data to compute the tangents, you could do the same and just average the normals.

I know this topic is old, but I’m finding it relevant to something I am curious to figure out.

Suppose we are generating a platform for a 3D side-scrolling game, think of worms with 3D terrain.

We gather all data necessary to construct the geometry, such as scanning a boolean array, or using a buffered image and fetching the pixel data.

Then we start plotting the vertices relative to the terrain’s own node, based on the terrain image/array.

In this step, are we completing the mesh, and then further creating another new version of it with re-calculated normals, or is there a good way to generate smooth, connected and flowing terrain in that phase?

It is nearly always better to generate the normals with the mesh because then you know which direction they should actually point.

Doing it from triangles will always be error prone. No matter what technique you pick, I can probably come up with some likely edge cases where it points normals incorrectly.