Possible to compute normals based on crease angle?

For dynamically generated geometry, is it possible to compute normals based on crease angle (like in VRML/X3D/OpenGL)?

I have geometry for which I have some adjacent triangles almost coplanar and I want those treated like single large flat facets, but other adjacent triangles that aren’t remotely coplanar that I want rendered smooth.

VertexData.ComputeNormals() options looks like it’d be possible to specify facets but I’m not sure exactly how it works and I can’t find examples of options use in the playground.

We do not get the angle as an option (yet):
Babylon.js/mesh.vertexData.ts at 2398db98c84c45773b71d8bd503dc04533f411d6 · BabylonJS/Babylon.js (github.com)

You can check there all the option we already have in place

I know that @jerome did a lot of work there

1 Like

Thanks @Deltakosh . creaseAngle would be a useful option to have I think.

For the time being I’ll just modify my geometry creation function to use unique vertices where I want hard edges.

1 Like