jsocol / indirect3d

The worst pure-software 3D engine ever!

Home Page:http://jamessocol.com/indirect3d

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Add directional lights

jsocol opened this issue · comments

Directional lights have a direction, but no position. This direction is represented by a 3-vector, rather than a homogeneous vector. All rays from the light are parallel, so they effectively model distance light sources like the sun or moon.

When calculating the impact on vertex color, we care about the normal (for diffuse) and half-normal (for specular) vectors, but we don't care about distance and attenuation, and we don't need to calculate the light direction vector—we just have it.