I'm writing an application in openGL. I want to implement very smooth toon shading. I've read (and seen in Maya) that replacing the vertex normal with the average of its vertex normals neighbors helps smoothing the shading. Is there a convinient way to do it in OpenGL? I load the vertex normal for each vertex from the obj file, but I'm not sure which vertex normals are neighbors... Thanks!
Asked
Active
Viewed 268 times
0
-
Which language? Related: [How can I optimize my Soft Normal calculation function?](https://stackoverflow.com/questions/61336175/how-can-i-optimize-my-soft-normal-calculation-function/61336810#61336810) – Rabbid76 Oct 02 '21 at 20:45
-
C++ and Glsl. From my understanding, the answer to the question in the link above suggests adding the face normal of each adjucent face to the vertex normal and then normalizing it. Will it work the same way as averaging the neighbor vertex normals? – hannak Oct 02 '21 at 21:32
-
1No, the average is not a [Unit vector](https://en.wikipedia.org/wiki/Unit_vector). (nva + nvb +nvc) / 3 != normalize(nva + nvb + nvc) – Rabbid76 Oct 02 '21 at 21:34
-
11. neighboring faces are those that share at least one vertex so you average all faces normals that share at least one vertex ... – Spektre Oct 03 '21 at 06:45