How to render back faces only?

I am trying to build a material that will render only the back faces of an object.

I’ve turned on “Two sided” to make sure that back faces are rendered, “masked” blend mode so that I can selectively choose which parts of the object to render. Finally I’ve took the “twoSidedSign” node, inverted it, and clamped between 0 and 1. My thought was since “twosidedsign” outputs -1 whenever a back face is rendering, and 1 whichever a front face is rendering, this would mask only front faces.

Instead, the entire object doesn’t render. I’ve attached a screenshot of the rendering. Any ideas>

Perhaps I’m misunderstanding how the TwoSidedSign node works? Is there any way to visualize what the output of each node is for a particular pixel?

Is there a better way to render only the back faces of an object rather than making a custom material?

What happens if you turn two sided off in the main node?

If everything is two sided and you only want to render the inverse of the visible faces then it will render nothing? Though you may be right about it not being how that node works.

Out of curiosity, why is this being done dynamically? Normally I’d just flip faces in the modelling program to get shells around things.

Hey natemartinsf -

Try doing a LERP between 0 and 1 (A = 0 and B = 1) while using the Two Sided Sign node as your Alpha.

-Eric Ketchum

I’m working on implementing a way to move 3d objects around using the mouse pointer (for assembling machines, etc, in-game).

I’m trying to implement the algorithm in this paper:

The algorithm finds the closest occluded point behind the object the user is trying to move. The method they suggest is to render the depth map of all objects except the target object, then render the depth map of the back faces of the target object. If you compare the two depth maps, you can find the closest occluded point.

There very well might be better ways to achieve this, but I wanted to see if I could do the method in the paper.