3
$\begingroup$

With Geometry Nodes, is it possible to create a backface culling type effect for instancing faces? That is, prevent faces the camera will never see from populating with instances?

Really the question should be: can we prevent such faces from populating with points? Since the instances rely on the points. This would be for a setup using the Distribute Points on Faces node.

$\endgroup$

1 Answer 1

6
$\begingroup$

Yes, you can accomplish that by calculating the dot product of the normal of the face and the location of the camera:

enter image description here

The result from the dot product calculation will be a float between -1 and 1. -1 if the vectors are the exact inverse of each other (back) and 1 if the vectors match exactly (front).

Add a Compare node set to Greater Than after the dot product if you want to tweak the selection a bit. Might be needed if some of your instances "pops" in from nowhere.

$\endgroup$
1
  • $\begingroup$ This is excellent! It will be useful for many situations, even beyond the use I originally intended. $\endgroup$
    – Mentalist
    Jul 1, 2022 at 18:16

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .