BNPR Exclusive: Edge Nodes [Part 3]

The unveil

Edge Nodes Version 1.0

Edge Nodes Version 1.0

Finally, the edge nodes are here. It has been 3 months in development, and we are proud to present edge nodes version 1.0. Since it is based on 2D image maps, it does not work the same as Freestyle–it does not use 3D data. Edge nodes simply exploits the already available edge detection filters within the Blender compositor.

Download link to edge nodes version 1.0

UPDATE: Download Edge Node version 1.1

Disclaimer: Edge nodes is not a replacement for Freestyle or Blender’s own “Edge” post processing option, it is meant to complement them.

How to use edge nodes

Line set setup
The essence of the setup are the line set node groups. You can either use:

  • 1 line set setup (Normal and Z combined)
  • 2 line sets setup (Normal and Z separated)
  • more than 2 line sets setup (More than 1 normal line sets + Z line set)

The nodetree is ready for 1 line set and 2 line sets setup. For more than 2, you may need to make your own blending nodes. One line set will not likely do well on a large scene. It will likely require you to utilize render layers and object/index passes in creative ways to achieve great lines for the whole image.

There are 2 parts to make this work. First you need normal edge detection (for organic shapes), then you need Z depth edge detection (to detect parallel normals and non organic shapes). The 6 bigger node groups (with “(C)”, which means combined) have both of them inside. Next to them are separated normal and Z pass edge detection sets.

Line Sets

Line Sets

1 line set setup: (Please uncheck switch inside of Line Adjust)
Link 1 of the bigger node (with C) group to “Line 1 In” of Line Adjust node group.

2 line sets setup: (Please tick the switch inside of Line Adjust)
Z depth must be linked to “Line 1 In” of Line Adjust; then connect 1 of the normal line sets to “Line 2 In” of Line Adjust node group.

Top: 2 lines setup; Bottom: Combined setup

Top: 2 lines setup; Bottom: Combined setup

There are 2 workflows.

  • append/link nodetree to another blend file
  • append/link model into blend file

For appending and linking nodetree to another file, you need to know which nodetree to append/link. Depending on how many line set setup you will be using, you’ll be selecting different line sets. To be safe you just need to append/link all the nodetree. But you don’t really need to.

You must have these appended/linked:

  • Line Adjust
  • UI Part 2 (ungroup after linked)

For the second workflow (append model into blend file), just make sure you make a copy of the empty blend file, for backup.

Tweak Places

Tweak Places

What and how to tweak

  • Remove noise (remove low level noise, use small value)
  • Depth (if dark or bleeding, increase value)
  • Level of Details (LOD) (useful on 1 line set setup, to adjust line details)
  • Line 1 / 2 adjust (separated adjustment for 2 line sets setup)
  • AA on/off (select to either use AA (subtract method) or non-AA lines (greater than method))
  • Thickness with erode/dilate (Add thickness or lower thickness)
  • Colors (change color of the edges)

Render setup: At least 5x Full Sample AA (FSAA)

The one downside to using compositor based edges is in this situation is the need for FSAA to get smooth lines. The way the line sets extract the edges breaks any anti-aliasing that would normally exist in the edge detection filters.

One solution to this issue is the use of a node that would sample and give back the AA we need without using FSAA, which can be very resource heavy. One possibility is SMAA: http://www.iryoku.com/smaa/ integrated into a new node–it can also utilize openCL.

What is going on inside the node groups
For the geeks among us, this part is for your guys.

4k normal line set:

4k Line Set

4k Line Set

Separate normal channel to RGB, Laplace filter to get edges, then combine the edges from each channel to product composite edges. Good for big renders, bad for close edges and small render.

Set 1 normal line set:

Set 1 normal line set

Set 1 normal line set

This is fast fake FXAA (not FSAA). The idea is to produce factor for blending of a solid and blur edges

Set 2 normal line set:

Set 2 normal line set

Set 2 normal line set

A combine of a blur edge and a solid edge. Line is blurred and looked AA-ed

Set 3 normal line set:

Set 3 normal line set

Set 3 normal line set

Another iteration of set 2, this time it is Laplace filtered then blurred.

Set 4 normal line set:

Set 4 normal line set

Set 4 normal line set

The simplest set of them all, the building block of all the normal pass edge detection. Very lightweight.

Set 5 normal line set:

Set 5 normal line set

Set 5 normal line set

Heavy, uses fake FXAA then combined with blurred of the same edges. Since the edges are still colored, we separate them to RGB channel and condition them individually. Then we combine them into 1, producing very nice AA-ed edges.

Z depth line set (prior fix: version 1.0):

Z Depth line set

Z Depth line set

This convert Z depth to BU/Meter, the depth then converted to black and white values using color ramp. The value is repeated to avoid grey values from overstretching with extreme depth.

Credits

Main developers

  • Daniel Kreuter from Austria
  • Lee Posey (The Jikz) from USA
  • Bong Wee Kwong (Light BWK) from Malaysia

Active beta testers

  • Metin Seven
  • Dylan Ü
  • Barkóczi Gergely
Edge nodes implementation on Metal Gear Rex model

Edge nodes implementation on Metal Gear Rex model (http://sketchup.google.com/3dwarehouse/details?mid=41518cc434bb9fcdb7cf6279dc1abd0e)

Please use and abuse this setup plus improve upon it!!

Download link to edge nodes version 1.0

UPDATE: Download Edge Node version 1.1

 

You may also like...

  • vicentecarro

    nice one! I’ll do a few test in our Anime models.

  • mapsy

    Looks very cool, but how can I import it into my .blend? Can someone please point us to a video or tutorial that we can use to import *this* nodetree? I found some tips about grouping nodes, saving the file, then appending the group, but … I can’t get these to group. If I leave the RenderLayer node out, blender still won’t let me group them, but it doesn’t tell me why…..

    Maybe they already are grouped. When I try appending some or all of the names I see listed in “nodetree”… I gets nuttin.

    • mapsy

      I think I found my answer… yep. I’m willing to make a screen video or image sequence, as a tute, if my fellow blenderheads need it.

      • twr

        Good for you? But what is the answer????

  • mapsy

    Updated link to version 1.1 is here: http://db.tt/uxRy57Qf

  • Joshua Sander

    Wow !! Such an amazing work guys, thanks for this nodes !! (while i understand only a fraction of all the topic im willing to try this setups’s and learn from them, thank you again 😀 )

  • Cosedimarco Marco

    Hi everyone.

    One note. Next time you use a model taken from the Warehouse PLEASE give credit to the original modeller.
    “Edge nodes implementation on Metal Gear Rex model”: Honestly I can’t see any implementation in the pose. Metal gear Rex was uploaded in 2008 in the warehose. in the same pose you published.
    http://sketchup.google.com/3dwarehouse/details?mid=41518cc434bb9fcdb7cf6279dc1abd0e

    • Light

      Sorry for the over sight, it is updated and linked to the origin of the model.
      Sorry for taking us this long.

  • Pingback: How to get silhouette with contour rendering in Cycles | CL-UAT()