1
$\begingroup$

I tested it on 3.4, 3.5 and 3.6 - same result everywhere, here's the .blend file

I have a two Render layers in my scene. One Layer have a Grease Pencil object with "Line Art" modifier that is pointing to a collection. With this two layers setup, I have a node tree in the compositor that have a Alpha Over node with those two layers connected and factor depending on "Greater than" of Depth (Z) passes of each render layer (See screen).

The problem is that if two objects that are in the line art collection, are too far away in the "depth" axis - the line art is drawn over the objects from another layer, even if it's further away. I made a simple sceneenter image description here that shows the issue, you can find it in the attachment

compositor: enter image description here

render if objects within the collection are far away: enter image description here

and this is how it looks when I move the object closer to each other (but it is still in front of the large box (See animation) enter image description here

So - my question is - is this a bug or expected behavior? Is there anything I can do to prevent this behavior and make grease pencil to respect the Z pass as it does when the objects are close together?

$\endgroup$

1 Answer 1

1
$\begingroup$

You need your GP object to calculate the stroke depth based on its 3D location.

In the Object tab, under Viewport Display disable Show In Front:

Object tab

Then in the Strokes section of the greasepencil tab, set the Stroke Depth Order to 3D Location:

gp tab

$\endgroup$
1
  • 1
    $\begingroup$ thank you, that seems to fix the issue! At first I wasn't sure why I had stroke Depth Order disabled, but it was caused by show in front. Thanks again! $\endgroup$ Aug 22, 2023 at 4:18

You must log in to answer this question.

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