WithLineWidth does not work with Arrowhead, CircleXZ

First time trying to adjust line width, it didn’t turn out well. ArrowHead becomes a 2-stroke shape, CircleXZ completely disappear.

Screen Shot 2022-01-17 at 23.26.44
Screen Shot 2022-01-17 at 23.26.51

                    using (m_Draw.WithLineWidth(pivotLineWidth, true))

PS: my original reason for this is due to using a render scale < 1, which cause the lines to become very aliased, I wonder if ALINE has any solution to counter this problem.

UPDATE: looks like this fails specifically on macOS, with Metal API.

On Windows it’s indeed fine.

MORE UPDATE: this falls specifically on macOS with Intel GPU, any line width value > 1.0f creates quite a few rendering error, not just disappearing lines, but also flickering artifacts.

Here is a comparison:

@aron_granberg not sure how often ALINE receives update, but would like some workaround for this.


Hmm, well that’s annoying. I don’t have a mac to test on, so this is going to be tricky to debug.
Can you try to find the aline_outline shader in the project (it’s in the ALINE package) and see if any warnings show up?

You might also want to report this to Unity since it seems to be either a Unity bug or a driver bug (or possibly a bug in my shader that only shows up on some GPUs).

I do not believe it’s a bug in driver or Unity,

The line width is not consistent between HiDPI and Normal DPI screens.

Say if you set it to 2px, it’s apparently thicker on Normal DPI screens.

This is a shader issue.

That would be expected given a line that is 2 physical pixels wide, and this package represents all line widths as physical pixels (same as most other things in Unity).

I will try to debug this, but it will be tricky since I don’t have access to a similar setup to you.

I would like to be able to download v1.5.1 somehow, before the performance improvement had been made, but Asset Store isn’t helping…

(I do have v1.4.1 due to having backup of my older codebase, but now I also depends on FixedString feature introduced in 1.5.0 so reverting to 1.4.x is difficult…)

@aron_granberg PS: If things are not this bad I wouldn’t want to downgrade:

Just tested, v1.4.1 doesn’t suffer from the same CircleXZ glitches, so I am quite confident this is related to the v1.5 shader speed up changes. (it does create some label2d rendering glitches, not sure it has anything to do with me converting FixedString to string; But it seems like my best bet would be v1.5.1 for now, please provide us a way to rollback).

I’ve sent a download link for you to be able to downgrade in a PM.

I have found some time to test v1.5.1, it doesn’t cause any issue when LineWidth value > 1; while both 1.5.0 and 1.5.2 has glitches.

So the current available version of ALINE is incompatible with Intel GPU, at least on macOS.

Thanks for investigating! @bitinn

Yeah, it seems like I sadly will have to revert the 1.5.2 changes. Even though they made things faster, having things actually work is a higher priority.