3
$\begingroup$

I believe I have a specific enough problem to ask this question.

Basically, I want to render the crossroad object in front of the black border of the image. but I also want it to be where it is because it's important that the people and bikes go through it. Is there a way to achieve that in compositing (or some other way)?

my scene

I'll admit I'm quite new to compositing and I already have some compositing setup there.

$\endgroup$
2
  • $\begingroup$ Maybe it would help how you set this up and what are the components of the scene? At the moment I have no idea if these are all 3D objects, or if the black border is an image overlay and so on... $\endgroup$ Commented May 22 at 11:14
  • $\begingroup$ the black border are bunch of planes as images applied to a plane with geo nodes and it is the closest object to camera. the crossroad is normal plane with array modifier and procedural material on it. I could show you a side view, but I don't think I can get it to one image $\endgroup$ Commented May 22 at 14:29

1 Answer 1

3
$\begingroup$

Yes, you can do this with compositing. The general setup is:

  • Create separate collections for the "Border", "Crosswalk", rest of the "Scene", and the "Studio" for camera and lighting.

    enter image description here

  • Create a new "Crosswalk" view layer. In this layer, uncheck the "Border" collection to disable it for the layer, and toggle on "Holdout" for the "Scene" collection. (The "Holdout" icon can be enabled in the filter pull-down above the icons.) When this view layer is rendered, the crosswalk will be drawn as if the border wasn't there, but any other parts of the scene that overlap the crosswalk will be held out as alpha=0 areas of the image.

    enter image description here

  • Composite the two layers with an "Alpha Over" node. The crosswalk "foreground" will be placed on top of everything else, but the parts of the scene that should appear in front of the crosswalk will be visible through the alpha=0 holdouts.

    enter image description here

Here are the original and composited scenes side by side:

enter image description here    enter image description here

Note that anything that appears on top of the crosswalk under the border area needs to be part of the "Crosswalk" collection. (If not, the border will show through those held out areas, instead of the intended object.) In your scene, you may need to separate the rain into the parts that appear over the (ends of the) crosswalk, and make them part of the "Crosswalk" collection, versus the rest of the rain which should be part of the "Scene" collection so it will be covered by the border wherever there is no crosswalk.

My example blend file:

$\endgroup$

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.