Smooth shading

Question

I'm trying to understand smooth shading. This is how I see it right now. Instead of just one normal over the whole face, Blender interpolates different normals at each point on the face. And the way it does it is as I've tried to sketch in the image below. Here I have chosen a quad.


1 love
Reply
  • Dwayne Savage(dillenbata3) replied

    I'm going to throw my 2 cents in. Blender uses Phong shading not Gouraud shading. Sorry, I don't know which algorithm of Phong. I think it Blinn-Phong, but I could be wrong.  Why does this matter to your discussion? Phong is calculating a weighted average between all vertices per pixel. This is why you can get strange results from Poles(N, E, 6+) and N-gons. Gouraud is more linear and the tessellation(Making it triangles) is included in the calculation.(Technically not true, but visually it is) You can get similar results in blender by adding a triangulate modifier. What's my point? That the perceived interpolation changes based on angle of view, and that it's not as linear as it appears to be.  

    Note: Poles in quad modeling are any non-terminating vertex that doesn't have 4 edges connected. Think of a subdivided plane. The outer edges are terminating vertices. Nose poles(AKA N-poles) have 3 edges. Extrude Poles(AKA E-Poles) have 5 edges. 6+ poles...You guessed it have 6 or more edges. 

  • Martin Bergwerf replied

    Oh, that's interesting, Dwayne! I am pretty sure that it's indeed Blinn-Phong, but I don't know what that is exactly (I just remember the name).

    (Maybe not something a modeler needs to know/worry about too much...)

    1 love
  • Martin Bergwerf replied

    Found a nice picture at  https://opengl-notes.readthedocs.io/en/latest/topics/lighting/shading.html 

    Doesn't go too deep into the weeds, but makes it more clear, what we are talking about:

    Phong.png


    1 love
  • Dwayne Savage(dillenbata3) replied

    Nice image spikeyxxx. I've been looking for a way to better explain it. I only started learning this as I've been looking into custom normals for NPR shaders. Although it might be a mute point since Dillon Goo(Creator of the Goo Engine) is now partnering with the dev team to create an NPR workflow/engine in main Blender. They have already created an NPR branch version.

    • 👍
  • Martin Bergwerf replied

    Okay Tom tfsuper3d ,

    I think we figured it out now; I was wrong the first time, the Smooth Shading interpolates between the Vertex  Normals,not between the Face Normals (I actually knew that, but thought it made no difference). So, to put it all together in one picture; the Vertex per Face Normals (used for Flat Shading) are averaged to make the Vertex Normals and then the Vertex Normals are linearly interpolated, something like this:
    mooth Shading_01.png

    1 love
  • Tom Fransson(tfsuper3d) replied

    No problem Martin I know you know. You showed me vertex interpolation in another post which I unfortunately deleted for a reason I don't know. But it's more than that I assume, as Dwayne was talking about if you look at it at the pixel level, but as you said a modeler doesn't need to worry about it that much, unless you want to customize the directions with a python script. Then you should know the algorithm, I guess. Thank you both for all your help.

    1 love
  • Martin Bergwerf replied

    Here's something fun (as you mention customizing the directions), among the many ways to change the direction of Normals, there is this little-known Shortcut:

    in Edit Mode, R, N allows you to Rotate the Vertex Per Face Normals of your Selection.

    1 love