Method 1.
If the two layers are layer 1 and 2, make them both 3D, then separate layer 2 less than 1 pixel in Z space (say .5) and parent 2 to 1. Sometimes this leaves a little fringing if the backside is darker than the front side, so the other alternative is below.
Method 2.
Again make the layers 3D, but leave them with the same exact position numbers, parent 2 to 1, and add these Opacity expressions to make the layer invisible when the camera is on it’s backside.
To layer 1.
a = toWorldVec([0,0,1]);
b = thisComp.layer(“Camera 1”).position – toWorld(anchor_point);
c = dot(a,b)/length(b);
if (c > 0) 0 else 100
Then this expression on the second layer down:
a = toWorldVec([0,0,1]);
b = thisComp.layer(“Camera 1”).position – toWorld(anchor_point);
c = dot(a,b)/length(b);
if (c < 0) 0 else 100
The only difference between the two is the direction of the > (or) <
These are Dan expressions from earlier posts.
If your looking to make a 3D Book, Serge has a beaut, here:
https://www.nyc-visual.com/3D_Book_M.html