ofPath: stroke width not respected

I’ve added a whole bunch of points to an ofPath instance, however, the stroke width isn’t being respected.
When it’s set to 0, nothing is visible. Anything greater than 0 (0.1, 10, 2), results in the stroke width being 1 itself.

In my setup(), I have:

path.setFilled(false);
path.setStrokeColor(ofColor::aqua);
path.setStrokeWidth(10000);

In my draw():

path.draw();

What am I missing here? I add my points using:

path.curveTo(x, y);

are you using the programmable renderer? openGL 3+ doesn’t support line width by default.

@arturo, yes. I am using the programmable renderer.
On a quick google search, I found that the following should work:

glLineWidth(5.f);

However, the above doesn’t produce thick lines.
Any clue as to how to enable this?

glLineWidth is deprecated in opengl 3+ and doesn’t work with most drivers. in order to get thick lines you need to create a stripe yourself in a mesh or use a geometry shader to do it in the GPU.

we have plans to include something like this in future versions but right now you have to do it manually.

Ah thanks. I found something using the geometry shader. I’ll try that.

Thanks @arturo!

Hey @ilmenite
I made this addon some time ago.


It still has some bugs but it should work fine.

best

Thanks @roymacdonald! I’ll take a look.