1
$\begingroup$

I have a sphere intersecting with a plane -- I would like to be able to use the occluded portion of the sphere as a mask, or to appear in a particular colour or pattern. Is this possible in Eevee?

enter image description here

enter image description here

$\endgroup$
3
  • $\begingroup$ Does the plane need to be visible? Does it need a texture? $\endgroup$
    – Benus
    Commented Jan 23, 2022 at 0:06
  • $\begingroup$ The plane needs to be visible, the intended behaviour is as the sphere passes through the plane, the portion of the sphere that is behind the plane is sort of x-rayed into view $\endgroup$
    – Josh
    Commented Jan 23, 2022 at 0:30
  • $\begingroup$ is this going to be a still render? $\endgroup$
    – Aswin
    Commented Jan 23, 2022 at 0:32

1 Answer 1

3
$\begingroup$

EDIT: Removed old answer completely as it was overcomplicated. This solution uses cryptomattes which I did not know is now supported in Eevee!

Duplicate the sphere and assign a different material. Create an empty and animate that through the plane. Snap the two spheres on the empty and parent them to it.

Create two collections. Place one sphere and the plane in one, place the other sphere in the other. Go to the View Layer panel, check the Cryptomatte > Objects box. Create a new view layer on the top right and copy settings. In one view layer, disable one of the two collections, and in the other view layer, disable the other collection.

enter image description here

enter image description here

Now in the Compositor, make the following node tree.

enter image description here

enter image description here

$\endgroup$
1
  • 2
    $\begingroup$ Mind bending animation, I definitely have to play with this... $\endgroup$ Commented Jan 23, 2022 at 1:29

You must log in to answer this question.

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