Getting ready

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.

Get OpenGL 4 Shading Language Cookbook - Third Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.