big optimizations to the polygon shadow calculations