we make AR apps. and here's a request:
1，we need to put a 3D wig model on some customer's head...
2，this wig can rotate / and obscured by the head properly when the customer's head rotates.
3，Is This Client's Request Possible?
many apps could do facial recognize/tracking, and 2D overlay. we do that too.
but 3D wig...yes we can do an AR 3D wig model over your head, **but the part behind the head...how to make that obscured?** I don't have any clues right now. maybe vuforia's smart terrain?? any comment is appreciated.
if you can track where the face is, and the orientation… you could calculate roughly center of head position from that, and hence where to place your wig.
typically the back faces of any 3D model won;t be drawn anyway, so you’d be ok there.
If you need to do a cutout geometry… there are a few shaders around (there is one on the unity wiki) that can render an invisible object… it just renders the Z-buffer only as if there was an object there… for example a head shape… This can be useful to cut holes in geometry… which might be useful to you. but you might not need it if the back face culling is enough.
might be good to know a little extra info… like how far head is expected to turn ?
That can actually be done fairly easily. What you do is use a plane to display what the camera sees. Then position the center of the 3D wig so that the plane/screen cuts the wig in half. That way when you rotate half of the wig will be made invisible.
The down side is if the algorithm determining the head location is not spot on, you can get the effect where the wig is much bigger or smaller than the persons head.
I think this approach need some extra work like:
1，**I need to know the customer's head's geometry in runtime every frame.**
2，AND THEN I could attach depth mask shader to it so it could obscure the wig behind.
so, now you give me 2nd step solution, how to do the 1st step?
@DerDude87 , @JonPQ