How to make volumetric material disappear inside object

Hi!
I’m trying to find a solution for this, but is kind of hard cos I don’t know exactly how to explain it with my limited english skills,

I made a nebula volumetric material (square) and a “spaceship window” (Icosphere) to travel through the nebula- how do I make the “spaceship” cut through so the nebula doesn’t show inside my “ship”?

I hope that is understandable…
Thank you very much.

EDIT:
It just occurred to me to render in two different layers.

You could use the object coordinates of your icosphere to punch a hole in the volumetrics like this:

1 Like