Master the fundamental concepts of software rasterizer through this focused micro-challenge.
In 1975, Bui Tuong Phong published a model that broke real-time lighting into three terms. It is empirical, not physically based, but fast and convincing enough to dominate games for three decades before PBR took over.
max(0, N dot L) where N is surface normal, L is light directionThe Blinn-Phong specular term uses a half-angle vector instead of a reflection vector:
cLoading…
For example, a surface with normal (0,0,1), light at (2,2,5), and eye at (0,0,5) produces a bright specular lobe when N dot H is near 1. Diffuse depends only on light angle; specular depends on both light and view angles.
shininess controls highlight tightness (32 is moderately glossy)You will implement Blinn-Phong lighting for a single surface point with given normal, light position, eye position, and material constants. This task asks you to compute L, V, H, and print the final RGB color. Even PBR renderers retain the same N dot L diffuse structure introduced here.
Write a C program that implements the Blinn-Phong lighting model for a single point on a surface.
Requirements:
Three hints are available for this task, revealed one at a time inside the code workspace so you can struggle productively before seeing them.
All starter code and reference implementations are available for your local setup.
View on Github