Face normal vs vertex normal

Most people do most of their work in fragment shaders. That’s where you set the final color of each fragment, so that’s where you check your normals (which you’ve either calculated in the vertex shader or precalculated) and light the fragment accordingly.

This is an excellent site for fragment that has many examples: https://thebookofshaders.com

There are two main sites where people share their shaders:

Vertex: https://www.vertexshaderart.com
Fragment: https://www.shadertoy.com

Both of these have tutorials.
These use glsl, but conceptually they are much the same.

1 Like