Set depth function.