1. A method comprising: creating a patch for a block of pixels, wherein each pixel has a plurality of samples; clustering samples into layers by splitting a depth interval into bins, marking the bins with at least one depth value, and locating the largest gaps in depth values between bins; generating a predictor function for a layer using actual depth sample values and sample positions in screen space to predict a depth value at each sample; computing a difference between the predicted depth value and the actual depth value of samples in a layer; and encoding the difference.