3
$\begingroup$

I'd like to animate a train car entering and exiting a diorama from left to right. As the train car exits the station, "breaking the plane" that is the boundary of the station, the parts of the train car outside the station should be transparent.

Here's what the train car would look like passing through if there were no masking or holdouts or anything:

enter image description here

What I'd like is for it to be "chopped off" outside the diorama bounding box, resulting in something like this:

enter image description here

...but I don't want to accomplish this with booleans. It's way too expensive and intense, as the train will have many objects and shaders involved with it.

I can achieve the desired effect behind the station with compositing and render layers using holdouts. But the foreground part of the train as it exits, I'm lost on how to achieve that.

Thanks!

$\endgroup$
0
4
$\begingroup$

With Holdout:

  • Create a layer with the train and with a holdout object both visible (make sure that the holdout object is alpha blend and no shadow):

enter image description here

  • Create a second layer with neither of these 2 objects visible:

enter image description here

  • Render and mix in the Compositor through a Color > Alpha Over:

enter image description here

Or create a black and white image that will allow you to mask the left part:

enter image description here

  • Create 2 layers, one with the train, one without, use the black and white image as a mask in the Compositor:

enter image description here

$\endgroup$
1
  • $\begingroup$ That's really simple and brilliant - thanks! $\endgroup$ – Variable Apr 6 at 1:45

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.