Optimizations in FBO and shadow layer creation