Line renderer's thickness and transparency arbitrarily expands at different camera angles

Avatar
  • updated

Image 779

When facing forward this is what the line looks like:

Image 780

When turning camera angle 30~40 degrees to the left, this is what it now looks like:

Image 781

It seems like the only solution to this problem is to not have the line cross in the negative coordinate spaces. For example, as long as the start and the end of the line are positive integers, this problem will not occur no matter how arbitrarily large the line is. But, if the start of the line component is a negative integer (including position in transform) this problem will slowly get more exaggerated the further into the negative values you go into. 

Any other changes to the component do not seem to change this behavior, even if the line is non-volumetric, non-dashed, opaque, etc.

EDIT:

I misjudged, after doing some testing I found out that positive integers are thoroughly affected too, in the same way, but only some hundreds of meters distance away from the world origin (0, 0, 0)

Reporting a bug? please specify Unity version:
2022.3.8f1
Reporting a bug? please specify Shapes version:
4.3.1
Reporting a bug? please specify Render Pipeline:
Built-in render pipeline
Avatar
kai

Bump. Does anyone else have this problem or is it already solved in some other version? I just purchased the asset so I would like to believe this can be solved with utmost haste...

Avatar
Freya Holmér creator

the algorithm for anti-aliasing and line thickness struggles when the endpoints of the lines are at extreme values relative to the camera frustum, for example, in my testing, if you use -100 to 100 you won't have as much of an issue (unless your camera is really close to the line by the same order of magnitude)

Right now there's no fix for this yet, but I could look into it for the next update. That said, I have tried fixing this before and it's somewhat non-trivial to find solutions that won't also incur a big preprocessing overhead to the shader in clamping these coordinates

Avatar
Freya Holmér creator

if you want a temporary fix that only works when thickness and dashes use meters, you can disable the line thinness fading feature by commenting out line 184 in Line 2D Core.cginc, and recompiling

Image 782

Avatar
kai

I will do this; thank you so much! I am not that technical, so I am not sure I can follow what was explained, but I hope in the future of Shapes it may be fixed.