Wireframe with consistent pixel thickness but not triangles?

Is there a way to have a wire frame renderer that only renders the edges (instead of all the triangles) while staying a consistent line thickness?

I’m trying to create the look of 80’s style vectorised 2D, where it was done by drawing lines on the screen. This meant the line thickness was the same no matter how close you got to the object. I have 2 different methods for this, and I would like the best of both worlds.

Wireframe modifier
Problem: Gets thicker when you get closer.
Wireframe modifier will follow the mesh correctly, but they are 3D pipes that get bigger the closer the camera gets. I can adjust the thickness of different objects to look right in the scene, but…

…if I make an animation where the camera zooms over the landscape, and gets close to things, some things are going to get really thick and look off.

Wireframe renderer
Problem: Renders triangles.
Exactly what I want - except it renders every single triangle, and I just want the edges! Like in the first screen shot above. See how the floor and the green box have triangles? I don’t want that…

…but see how when I get close, the lines don’t get thicker? I do want that!

How are you doing the last one? With materials? What renderer are you using (EEVEE)?

The last one is using the “Wireframe” node in the material like this (Found here.)

The results are the same in Cycles or Eevee, just Cycles looks better because the light bounces off the black surfaces slightly. The above screenshots are using Eevee though.

1 Like

For the wireframe modifier you can try to right click on the thickness factor and Add Driver.

One of the driver variable types is Distance. You can choose the object itself and the camera. Then scale that distance variable to whatever is appropriate.

Edit:
Maybe you could use a combination. Like the mountains look better in triangles I think.

Edit #2:
The driver should be multiplicative inverse to distance, like 1/(3*var) and you may have to clamp it with min() max()

Edit #3:
Also that Transparent BSDF is only Black because you haven’t enabled Alpha Blending. You should maybe use something like a Black Emission Shader.

Try the Freestyle mode, you can mark what edges to render:

This method below seems to be the best one yet that I had found:

1 Like

I would look into doing a Viewport Render https://blender.stackexchange.com/questions/124721/how-to-render-wireframe-for-the-entire-scene-not-just-one-object and bypassing EEVEE and Cycles entirely.

You could do white wires over black, then render flat solid color objects and use the compositor to get color.

So many good options, all appropriate for different situations! I went with one but I don’t want to mark any one as better than the other so I quoted them all and marked this post as the solution.

Hey man, that did it for me! I haven’t had to do anything other than multiply them by some very small value (eg. 0.00001) that seems to need to be different for each object, but I can work out the finer details later, maybe it’s got to do with it being multiplicative inverse like you said.

I did a quick example, the mountains, the green box, and one of the building clusters has the distance driver.
Far


Close

I didn’t make \tThe floor grid do it because that wouldn’t work well with it being so big, but it’s not bothering me at the moment and I suppose I could always break it up into chunks if I really wanted to do it. But isn’t it crazy how many hoops you have to jump through just to replicate old ways of doing things??

Yeah I am open to that. I tried the mountains and it looked OK at first but then it became too busy and faceted looking, especially when I add more mountains. I know they look glitchy in the screenshot but I intend to fix them by hand.

I had a quick go and I think that works pretty well! Though it does remove the option to render things in something other than wireframe, but that’s probably OK since my whole animation will look like that.

That does look really cool - but I think the wire will get bigger with perspective and not stay the same size relevant to the screen - but I could probably use a driver variable as in the other answer. Although the line stays flat on the surface of the object which will change thickness on the screen depending on the viewing angle, which isn’t what I want. But it’s a very good effect for the look in the screenshot in that thread.

Wouldn’t all objects be the same colour though?

1 Like