Microsoft DirectX 8.0 (Visual Basic)

Directional Light

The following shader builds on the Transformation and Constant Shading vertex shader example by adding a directional light source.

; The directional light source.
dp3 r1.x, v1, c[8]   ; N dot L
max r1, r1.x, c[0000]   ; clamp greater than 0

; diffuse = dot*diffuse + ambient
mad oD0, r1.x, c[5], c[6]