The position should be supplied in vertex attribute zero and the normal in vertex attribute one. Uniform variables for the ADS shading model should be declared and assigned, as well as uniforms for the standard transformation matrices. The ShadowMatrix variable should be set to the matrix for converting from object coordinates to shadow map coordinates (S in the preceding equation).
The uniform variable ShadowMap is a handle to the shadow map texture, and should be assigned to texture unit zero.