There is an option for outputting z-depth when you render your scene.. I'm not sure if that will help or not.. Good Luck