added tile-based clipping