added layer rasterization function