added extra stuff to support shadow mapping