I am using WebGL, porting some of my older programs written in OpenGL. There is a cone with Archimedean Spiral basis. It goes from 0 to Math.PI and symmetrically to axis X in the opposite direction. The problem is about lighting transition at the tip of the cone, it is not smooth. But it is smooth at the basis of pyramid.
On the left it is divided into ten sectors, and on the right is divided in forty sectors. The problem is visible on the both. The normal is calculated as the gradient of the Archimedean Spiral in each point.
I understand why it happens, and geometrically it should happen for any shape. But just in case, there are the equations upper part of this hearth cone:
The spiral is described as F(φ) = [φ * cos(φ), φ * sin(φ)]
The calculated normal ∇F(φ) = [sin(φ) + φ * cos(φ), -cos(φ) + φ * sin(φ)]
And the Z coordinate which is really not important in our case.
Particularly I tried different suggestions, for instance as described here: Low polygon cone - smooth shading at the tip
But it worked somehow similarly to gl.TRIANGLE_FAN, which acts differently, the tip faded in a single colour, and then interpolated to the other normals of each triangle.
Solved:
Thanks to all. Solution worked as expected, see following set screenshots.
On the left is a cone divided in ten sectors, and on the right is the cone divided in forty sectors.