BufferGeometry (was) not completely smooth
(edited see Bottom)
When I started with THREEf, I noticed that my self-made THREE.Geometry cylinder at the seam was not smooth.
The last vertices were however “exactly” in the angle 2 * Math.PI. That is why I then formed the last faces with the first vertices in connected geometries. This works perfectly with Geometry. With BufferGeometry there is however a problem with the uv’s.
To make my addon THREEf as uniform as possible for Geometry, BufferGeometry (indexed, non-indexed), I made some tests. With THREE.CylinderGeometry, the seam is smooth and vertexNormalHelper shows normal at the top oblique.
If I change to CylinderBufferGeometry ( is indexed ), there are two different normals at the seam. The seam is clearly visible. The normals at the top are horizontal.
In three.js I’ve seen that at function CylinderGeometry (… after fromBufferGeometry (… then this.mergeVertices () is executed with an epsilon of 0.0001.
This means that Geometry and BufferGeometry are not identical in appearance.
I am supposed to take BufferGeometry because it is more efficient. But I have a seam. Merge vertices also requires resources. My current method (non-indexed) of working with other arrays first and then writing to buffers is also not very efficient. My non-indexed BufferGeometry is always flat shaded.
(I am now quite uncertain how to do it. )
EDIT Mai 21: I have now found: If I remove
geometry.computeVertexNormals();
the seam is smooth.
I probably have to test further variants!
Pictures of the seam (and German text):
http://xprofan.net/intl/de/php,html,js/3d-grafik-webgl-mit-three-js/?q=94096&pg=-1#94096