HOME | DD

vasilnatalie — Alternate edge line technique for Cycles by

#blender #edge
Published: 2018-04-02 01:08:25 +0000 UTC; Views: 817; Favourites: 9; Downloads: 12
Redirect to original
Description So I finally got around to figuring out Blender's edge line.  And, yes, it's powerful.  It's also a pain in the ass to use, and slow, and it doesn't show up on rendered preview.  How are you ever supposed to get good settings from something you have to render every time to tweak the values?

So I tried this out.  This is basically how MMD makes edge line.  And actually, Blender probably does something similar as part of it's Freestyle suite.

Copy a mesh.  Give it a new mat.  Reverse the normals (ctrl-shift-n in edit.)  Leave the modifiers on, and add a new one like in the pic.  I'm adding the displacement modifier just to create thickness in the mesh-- to bring it slightly outside of the body along its normals.  Notice I'm not even giving it a texture to work from, I just want it all working evenly.  You could just scale it out by normals, but a displacement mod like this is fast, and it's nice to leave it in a state where it can be tuned, driven, or reversed.

The material is simple too.  If we're backfacing, we draw nothing-- full white transparency shader.  So you can see through the mesh, since you reversed the normals.  If we're front facing, I'm giving it a flat black diffuse for a black outline.  (You can mix this with a transparency shader or use a different color if you want.)  I suppose it wouldn't be a bad idea to do a minimum(is camera ray, backfacing) to prevent it from screwing with other stuff.  But in the Cycles settings, we've disabled visibility to everything except Camera rays, so I don't think it matters.

You can tune the strength of the displacement modifier, or use a driver to link its strength to camera distance/fov to create a somewhat relative edge line.  Of course, that's still going to be per-object, not per-pixel, not as beautifully tuned as Blender Freestyle.

Not quite as good, but it previews and it's faster.
Related content
Comments: 3

BluePixieArt [2018-04-02 23:43:32 +0000 UTC]

In Blenders internal rendering engine, there's an option in it for line edge, but cycles doesn't have it unfortunately. its one of those things thats only in Blender Render. I've used it before and it works like MMD's lines if i remember correctly.

👍: 0 ⏩: 1

vasilnatalie In reply to BluePixieArt [2018-04-03 16:50:06 +0000 UTC]

Oh, didn't know that.  I don't think doing it like this, with camera ray visibility and a second mesh, will be any slower.  Realized the right way to do the displacement is in the nodes with experimental features + true displacement for a per-pixel relative line.  Could use vertex color or a texture to tune line thickness as well that way.

👍: 0 ⏩: 1

BluePixieArt In reply to vasilnatalie [2018-04-03 17:00:27 +0000 UTC]

Yeah that would work, the only fallback that I can think of off the top of my head is dense mesh being doubled for lines, I don't know how the blender internal line settings work but I've used both ways and are both pretty viable options depending on whether you use blender internal or cycles

👍: 0 ⏩: 0