• 3D
  • How to draw thick lines?

I'm trying to create an effect similar to this one as seen in the game Two Point Hospital, where there is a line drawn around the top of the room.

https://files.catbox.moe/scwnoj.jpg

I understand that it's most likely made with quads. However ideally I'd have a little bit more flexibility than that because not all of my lines are at right angles. I have been using ArrayMesh and Mesh.PRIMITIVE_LINES but haven't been able to figure out how to adjust the thickness of the lines.

Starting to think increasing the thickness of the lines might not be possible.

I'm willing to switch to just drawing long thin quads, but I'm not sure how I would do that since my edges are all pretty jagged as you can see from this screenshot. Every vertices is offset by a certain amount. And even if I just drew straight lines I'd still need to deal with diagonal lines. Diagonal lines alone, when using quads would need additional calculations in order to not see the sharp corners of quads being out of place.

https://files.catbox.moe/wsjixm.png

What method should I use?

I might give up and use 1px thick lines.

If I used quads, I'd need to adjust each of their vertices individually such that they stitch together correctly.

For example I'd have a set of vertices that define the overall shape. I'd have a quad for each set of two vertices. Then based on the angle of a line and it's neighbouring line, I'd need to calculate where they meet upon two corners.

You know what I mean?

But in looking for examples where this has already been done I haven't found anything.

I mean i guess... I figure out where two unadjusted quads would go, then take every two vertices that are supposed to touch, I could average them together.

That wouldn't account for line thickness though, I'd have sharper angles resulting in thinner lines.

While I'm looking for an answer I've implemented just the 1px thick line, you can see from this screenshot that it feels okay better than nothing but could be better.

https://files.catbox.moe/iy51d1.png

Well there's something called polylines that has been implemented in 2D for godot. I suppose I could try to write the same thing and use it in my 3D project.

https://github.com/godotengine/godot/pull/7352

I just want all my faces pointing up anyway. I'll try and work on it, C++ and myself don't get along often though.

Oh, it's on the material that's really interesting.

https://files.catbox.moe/3nvky8.png

I've done some looking into it and apparently there's been a regression and this feature doesn't work for now. Maybe it will be re-implemented when Vulcan arrives. Since for the time being it doesn't seem that many modern renderers support it.