Is there a way to render wireframe/lines only, with materials?

I’m trying to figure out if there’s a way to apply some materials to objects (or, single lines/curves, or a point) that will let us apply materials, e.g. an emission glow, so that it only applies lines, points, edges, etc. but not to faces, something like the example below?

(Would love to be able to do this with or without transparent faces, so that a “solid” object with glowing edges could be made.)

thanks

1 Like

Yep, use a wireframe modifier:


2 Likes

Hey! Wasn’t this different a minute ago? :wink:

1 Like

Yeah, I was wrong back then :slight_smile:

Lol… but…

Yeah!! I think this will do it. Not sure why I didn’t look in modifiers, I guess I just never noticed it. Thanks.

Oh - hang on -

Is there a way to get this to work on curves without converting them?

1 Like

This is kind of an equivalent to wireframe modifier made with geometry nodes that you can use in curve objects as well as mesh ones. Here the curve has a bevel, so it’s already implicitly converted to mesh that’s why the geometry nodes set up starts with a mesh to curve.

1 Like

The solution proposed so far has three major downsides:

  • The line width is not constant - it is in world space not screen space, so the edges closer to the camera will be thicker than those far away
  • There is no occlusion. All the lines from the back will also be displayed.
  • It adds significant extra scene geometry

Here’s what I’ve found to be the best way to show the wireframe:

  • Add a Grease Pencil Line Art object which references the object or Collection.
  • Enable ‘Edge Marks’ and make sure all edges in the source mesh are marked with the Grease Pencil edge attribute.
  • Set the Stroke Thickness to Screen Space

This will give you the ability to add perfect wireframes with screen space line widths and occlusion.

4 Likes

Also note that with my method it is trivial to make it use dashed lines, as per the original inspiration image:

The best way to do dashed lines is, surprisingly, not by using the Grease Pencil dashed lines modifier, because the length of the dashes correspond to the line resolution. Instead, use a transparent image texture mapped to the material, like so:

This will keep the dashes consistent, even if the line resolution varies.

2 Likes

The reference doesn’t use occlusion:

This is for sure a good option, just something to note. It may not be the best option for replicating some of these examples

2 Likes

In general in 3D, triangles and voxels are the only things that are renderable, -they have either a surface or a volume that light rays can intersect with, whereas curves don’t have that, they’re infinitely thin. So in order to render lines, silhouettes, etc. you either make a mesh out of it or you use a post-process like Freestyle.

1 Like

There is a way to disable occlusion also if you play around with the Occlusion Range properties. It’s pretty unintuitive though.

3 Likes

Forgot to mention you have to remember to set the Stroke Thickness to Screen Space if you want consistent line width.

2 Likes

Great tip! I’ve been trying to figure out how to do this for weeks :grin:

1 Like

Thank you for this setup! Its almost exactly what I need, as Im dealing with curves. The only problem is the whole object is being assined the wireframe material. Is there a way to assign one material to the object and another material to the wireframe, that you can think of?

1 Like

Just you you know the line art object creates some heavy dependencies in the scene and it can slow down the scene a lot. So it is best to bake it first once settled with the correct look.

1 Like

Ah don’t remember why I set it up like that, probably just a silly mistake. The set material node should be between the curve to mesh node and the join node so it only affects the wireframe and leaves the original geometry with it’s original material