1
$\begingroup$

I am modeling a cartoon character with a mouth that is designed to only be displayed on a single cheek, not in the middle. Its parent is a head mesh. I made two copies of the mouth: one on the left cheek of the head, the other on the right. I am wondering if there is any way to make the mouth on the side of the head that the camera is not primarily facing disappear? (i.e: if the camera is directed to the left side of the head, then the left mouth is visible, but the right one is not, and vice-versa.)

Because the camera is primarily facing the left side of the model, I need the right mouth (higlighted) to disappear.

enter image description here

I am using Blender Internal.

Blend file: Blend

$\endgroup$
4
  • $\begingroup$ Welcome to BSE, is it possible to attach screen shots? And upload your .blend file? $\endgroup$ – Georges Jun 19 '16 at 1:14
  • $\begingroup$ Sure, fixed the OP. $\endgroup$ – Refracktor Jun 19 '16 at 1:29
  • $\begingroup$ Do you want this to be automatic or using a switch would be fine? $\endgroup$ – Georges Jun 19 '16 at 1:32
  • $\begingroup$ If it could be automatic, that would be great because I am planning on rendering in 8 angles / 8 different cameras around this. But if a swith would be easier, I'll take it. Thanks! $\endgroup$ – Refracktor Jun 19 '16 at 1:36
3
$\begingroup$

The answer is using a Light Path node, just like Todd just said, but I'm using a different approach and a different node factor, since according to attached images, this has to happen while both mouths would be visible from a 3/4 angle:

1- Create a plane to go directly in the center of your character, The cube in the image here represents your character's head, the two spheres represent the mouth.
enter image description here
2- Assign a simple transparent material to the plane.
3- Mix a transparent shader to the material of the mouths (the spheres in this example), add a Light Path node, Add node>Input>Light Path, use the Transparent depth as a factor. This will make the object that this material assigned to, disappears when it falls behind an object with a transparent material, which is the plane here. Check the image below.
enter image description here
That's it check the animated GIF below to see how this will work, no need to say that from a front view, both of the mouths will show, so you can extrude the far edge of the transparent plane to the left or right to solve that issue.
enter image description here

$\endgroup$
2
  • $\begingroup$ Is there no way to do this in Blender Internal? If not, I can manage the switch from Internal to Cycles. $\endgroup$ – Refracktor Jun 19 '16 at 4:02
  • $\begingroup$ I know next to nothing about BI but I think this doable using a script $\endgroup$ – Georges Jun 19 '16 at 9:36
0
$\begingroup$

You can do this easily by mixing your color shader with a transparent shader with the factor coming from a Camer Light Path node.

In the example below I've got a Red Cube with a Green Circle on opposite sides. There is a mirror surface behind the cube so we can see the back of the cube. Initially both side show the green circle.

When I update the green material to include the transparent shader with the camera light path node, you can see that only the circle that faces the camera shows. You can check the back circle by viewing the mirrored surface.

enter image description here

$\endgroup$
1
  • $\begingroup$ I just noticed that this is not a complete answer due to the fact that you can see the part of the face where the other mouth should be. I'll update it shortly. $\endgroup$ – Todd McIntosh Jun 19 '16 at 1:35

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.