Added realtime shadows and fix bugs

Added realtime shadows and fixed some bugs.