Smooth Shading

GuerrillaCG · 120K views · 2008 · 3:59

Open on YouTube

Computer graphics & renderingGame programming & enginestutorial

Why Stack Overflow recommends it

Stack Overflow users link it when answering or asking about vertex normals, smooth versus flat shading, and Gouraud shading in 3D mesh code.

Recommended by 2 people across 2 different months, 2012 to 2018.

What it is

A short 2008 computer graphics tutorial from the Guerrilla CG Project, presented by Andrew Silke. It explains how smooth shading removes hard creased edges on polygon models and shows how vertex normals change the way a surface is shaded.

What people said

Recommends JAre · 2012-11 · Stack Overflow · on “calculating normals for quad mesh”

If you need flat looking surface then your normals will be normals to the quad plane. If you need "soft looking" surface you need to blend( read this [LINK] and watch this [this video] cool simple video) normals - that will add sort of gradient.

Recommends Drew Noakes · 2013-02 · Stack Overflow · on “Most efficient algorithm to calculate vertex normals from set of triangles for Gouraud shading”

Each vertex belongs to one or more faces (usually triangles, sometimes quads -- I'll use triangles in this answer). A triangle that is not attached to any other triangles cannot be 'smoothed'. It is flat. Only when a face has neighbours can you reason about smoothing them together. For a vertex where multiple faces meet, calculate the normals for each of these faces. The cross product of two vectors returns a perpendicular (normal) vector, which is what we want. A --- B \ / C v1 = B - A v2 = C - A normal = v1 cross v2 Be careful to calculate these vectors consistently across all faces, otherwise your normal may be in a negative direction to that you require. So at a vertex where multiple fac

Cites Elbbard · 2018-07 · Stack Overflow · on “Recalculate normal of flat surface shader in Unity”

I'm making low poly water and I'm unsuccessfully trying to make the lighting work. I have made a shader which sets a color to the model and moves its vertices along the z axis. This tutorial [LINK] explains how to recalculate the normals in a shader. However it uses smooth shading which is explained very well in this video [this video] . For my low poly water I need flat shading which, based on my understanding of the video, requires me to split each vertices in 3 separate vertices that have the same position but a different normal. How can I achieve that? Here is how it looks in Unity for now. Don't mind the ugliness of the waves as I just started writing this. The problem is the smoothed shadow