Shader Learn

07 Surfaces and light

Stylized: banded light and Fresnel rim

The same sphere with a rewritten lighting formula: banded brightness, glowing edges.

26
18
01

Runs once per pixelDrag numbers, or edit the code

JS sidegl.uniformMatrix4fv(uModel, …) // rotation -0.35 / 0.10

Stylizing means rewriting the lighting formula: band the brightness for a cartoon look, and use 1 − dot(N, V) for a rim light.

Try it

  • Set the bands to 2
  • Increase the rim strength
  • Turn banding off and compare with smooth lighting