void renderShadowMap(){
  glUseProgram(shadowProgram);
  glUniformMatrix4fv(shadowProgramVPUniform,false,light.get(matrixBuffer));
  glBindFramebufferEXT(GL_FRAMEBUFFER_EXT,fbo);
  glViewport(0,0,shadowMapSize,shadowMapSize);
  glClear(GL_DEPTH_BUFFER_BIT);
  glDrawArrays(GL_TRIANGLES,0,6 * 6 * boxes.length);
  glBindFramebufferEXT(GL_FRAMEBUFFER_EXT,0);
  glUseProgram(0);
}

void renderShadowMap ( ) { glUseProgram ( shadowProgram ) ; glUniformMatrix4fv ( shadowProgramVPUniform , false , light . get ( matrixBuffer ) ) ; glBindFramebufferEXT ( GL_FRAMEBUFFER_EXT , fbo ) ; glViewport ( 0 , 0 , shadowMapSize , shadowMapSize ) ; glClear ( GL_DEPTH_BUFFER_BIT ) ; glDrawArrays ( GL_TRIANGLES , 0 , 6 * 6 * boxes . length ) ; glBindFramebufferEXT ( GL_FRAMEBUFFER_EXT , 0 ) ; glUseProgram ( 0 ) ; }
render the shadow map into a depth texture .
