Please, help me. I have a problem with Freestyle (eevee/cycles) I want to draw cube lines behind with transparency. I have already experimented with groups and collections (already in the past). Post image processing from two renders will also not work. I need animation with a tree in the foreground.
-
$\begingroup$ Try looking here - I played around for a minute, but couldn't find the correct combo to show the outlines properly, but I definitely was able to show lines behind the transparency. Maybe you'll have more luck than me - blender.stackexchange.com/questions/9425/… $\endgroup$– Christopher BennettCommented Jun 30, 2020 at 13:40
-
$\begingroup$ link Thanks. Now my problem has increased :) $\endgroup$– Tomcatdima BCommented Jun 30, 2020 at 17:01
-
$\begingroup$ my file is in the folder by link $\endgroup$– Tomcatdima BCommented Jun 30, 2020 at 17:02
1 Answer
You can do this using the compositor.
Go to Render Properties > Film and check the box Transparent. Then go to Render Properties and check the box Freestyle. (but don't have any linesets in Freestyle Line Set under View Layer Properties)
Put the plane with an image using alpha in a collection. Put the object that will have freestyle lines in another collection.
Disable the freestyle-object-collection by unchecking the box next to it in the Outliner. (keep the collection with the image checked/enabled)
Make a second viewlayer by clicking the Add View Layer icon. (usually in the top right of the screen).
In this viewlayer check the box next to the freestyle-object-collection, but uncheck the box next to the plane-with-image-collection.
Also in this viewlayer we do want a freestyle lineset: View Layer Properties > Freestyle Line Set, and click the plus icon to add one.
In the Compositor window, create two Render Layers nodes. Set one to the first viewlayer (with the plane-with-image-collection enabled), and the other to the second viewlayer (with the freestyle-object-collection enabled and with the freestyle lineset), and plug them in an Alpha Over node. Plug the Alpha Over node in a Viewer node.
Render and then select the Viewer node in the Image Editor.
-
$\begingroup$ This is a band-aid solution, especially for cycles renders. Is there a way to do this so that light rays can still interact with both objects? $\endgroup$ Commented Jul 10, 2023 at 17:24
-
$\begingroup$ Does nothing for self-overlapping transparent geometry, ie, on one same object, transparent faces on top of other transparent faces causing the behind edges not to be freestyled. $\endgroup$ Commented Jan 3 at 11:10