You may want to also take a look at shadow maps
But first I would suggest simplifying your project to better debug