
264 III Bending the Pipeline
/* create the depth texture with a 16- bit depth internal format */
glGenTextures(1, & depth_texture);
glBindTexture( GL_TEXTURE_2D_ARRAY, depth_texture);
glTexImage3D( GL_TEXTURE_2D_ARRAY,0,GL_DEPTH_COMPONENT16, width , height ,
number_of_shadow_maps, 0, GL_DEPTH_COMPONENT, GL_FLOAT , NULL);
/* set up the appropriate filtering and wrapping modes */
glTexParameteri(GL_TEXTURE_2D , GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
glTexParameteri(GL_TEXTURE_2D , GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
glTexParameteri(GL_TEXTURE_2D , GL_TEXTURE_MAG_FILTER, GL_NEAREST);
glTexParameteri(GL_TEXTURE_2D , GL_TEXTURE_MIN_FILTER, GL_NEAREST);
/* ...