Why do these meshes look different?

I’m trying to draw some beams, and some of them need to be curved, so I tried using MeshBuilder.ExtrudeShape.

See this example playground: https://playground.babylonjs.com/#IR1UDP#1

The D-beam (2 ExtrudeShape-meshes) is shaded smooth, while the I-beam (1 CreateBox-mesh) looks flat.

All meshes have the same material. I’m guessing this has something to do with UV shading, but I can’t figure out how to correct it. So, how do I get the flat result with ExtrudeShape (and also how do I get the smooth result with CreateBox) ?

I’m pretty sure it has to do with the vertex normals. They both have the same reflectivity. What do you mean “smooth”?

You can get a similar effect on the box as the straight segment of the extruded shape with

box.forceSharedVertices()

Thank you, couldn’t find this in the docs.
I did found out myself I can have the flat shading on the ExtrudeShape mesh with :

extrudeshape_curved.convertToFlatShadedMesh();

1 Like