new depthmap algorithm