I believe this filter is the only one handling Position pass in After Effect. By rendering an Object P Pass, you will be able to create 3D mask which stick on your objects.
This techniques comes from several Nuke scripts. Look at the following videos :
Download & Sources
- Pixel Bender shader : ft-Ppass2Matte
How to install it ?
Just copy the .pbk file into your “Support Files” folder in your AE install directory