added black sky option, refCounting to cached materials