Search Unity

[RELEASED] Volumetric Lines

Discussion in 'Assets and Asset Store' started by j00hi, Feb 20, 2015.

  1. j00hi

    j00hi

    Joined:
    Nov 18, 2012
    Posts:
    72
    My first asset has just been accepted. It is a scripting asset for rendering lines and line strips with a volumetric appearance. It is super-fast because it's a shader based technique.

    Here is the Asset Store link: http://u3d.as/content/johannes-unterguggenberger/volumetric-lines

    The asset should be quite self-explainatory, however, it lacks a proper documentation. Therefore, I will post a little getting started guide here. So, here we go:

    Getting started
    The asset is organized like follows:

    structure.PNG

    The folders Materials, Prefabs, Scripts, and Shaders contain all the things which you will need if you're going to use the volumetric lines. Everything in the ExampleScenes folder and it's subfolders is just for the example scenes. You can delete that if you don't need it.

    There are two example scenes included:
    • StaticLines
    • LaserCannon
    The StaticLines scene shows all the features the asset supports. It renders several lines and line strips with the volumetric lines technique.
    The LaserCannon scene shows a small terrain with a simple laser cannon on it. You can interactively rotate the cannon and fire laser shots. The shots are rendered with the volumetric lines technique.

    Here is how that looks like:
    vl_screenshot3.png

    In order to use the asset in your own project, go to the Prefabs folder and drag one of the prefabs into your scene. Please note that the volumetric lines DO NOT RENDER in the Scene view nor in the Game view unless the game is started. However, the Scene view shows debug lines, so you can see the orientation and size of the lines. You won't see the actual appearance of the lines until you press play. The following image should make it clear:

    play.png

    To customize the look of the volumetric lines, you have the options to change some values in the materials
    • Main Color
    • Line Width
    • LightSaberFactor
    and also the used texture will have a huge impact on the final appearance. For laser shots, the default particle texture works fine. Please pay attention to not overwrite your material settings if you are using them for different objects. Just create new materials based on your requirements - but that's nothing special to this asset, but to Unity in general. Just wanted to point that out since it happens to me all the time. ;)

    material.PNG

    Finally, there are different shaders which also affect the appearance of the lines. For single lines we have:
    • VolumetricLines/VolumetricLineAdditive ... additive blending + MainColor + LightSaberFactor
    • VolumetricLines/VolumetricLineAlphaBlended ... alpha blending + MainColor + LightSaberFactor
    • VolumetricLines/VolumetricLineAdditiveFast ... additive blending
    • VolumetricLines/VolumetricLineAlphaBlendedFast ... alpha blending
    Use the "Fast" variants if you don't need the MainColor or the LightSaberFactor.

    If you have any questions, please ask!
    Otherwise, I hope you enjoy this free asset.

    Update (August 2015)

    With the Unity 5 update, a proper scaling behavior has been implemented. Whenever the Volumetric Line object is scaled directly or in a hierarchy, the absolute width of the line also scales which is the expected behavior.

    This update may break some existing configuration slightly. In that cases, please adjust the line width of the material directly or via the MonoBehavior controlling a volumetric line (VolumetricLineBehavior.cs, for instance):
    vol_lines_editor.PNG

    Please note that these properties are drawn by a custom editor script. There seems to be a problem sometimes that this editor script doesn't set or store the values when the volumetric line has a prefab connection. If you experience any issues of that kind, please try to break the prefab connection and see if the problem still exists: Select the GameObject, then go to Menu GameObject --> Break Prefab Instance.

    Also make sure to avoid non-uniform scaling whenever possible. This asset can handle non-uniform scaling, but the scaled line width will be more accurate if you use uniform scaling (which is what you should do generally, regardless of this asset).
     
    Last edited: Aug 8, 2015
    NeilAgg, Kennai, twobob and 4 others like this.
  2. angelodelvecchio

    angelodelvecchio

    Joined:
    Nov 15, 2012
    Posts:
    170
    Thank you for this wonder !
     
  3. screenname_taken

    screenname_taken

    Joined:
    Apr 8, 2013
    Posts:
    663
    Is it mobile friendly?
     
  4. j00hi

    j00hi

    Joined:
    Nov 18, 2012
    Posts:
    72
    It is super mobile friendly in terms of performance since there can hardly be a faster algorithm for (fake) volumetric lines.
    And it should work fine on iOS and Android, has been tested on several devices with different GPUs.
     
  5. zebra6595

    zebra6595

    Joined:
    Jul 21, 2015
    Posts:
    1
    how exactly would you set the points and size of a VolumetricMultiLineBehavior script from another script?
     
  6. Shrandis

    Shrandis

    Joined:
    Oct 3, 2012
    Posts:
    30
    This asset is very easy to use and is definitely not performance hungry. However, I need to achieve something similar in Unity 4 but your asset store page says Unity 5.1.1 is required. Do you have a version that works in Unity 4 or can this one be made to work in Unity 4 somehow? I tried directly importing the package but it didn't work, figured I'd ask here before committing time to fixing it.

    I don't really need the advanced features, I only need the lightsaber effects exactly like this asset does them.
     
  7. j00hi

    j00hi

    Joined:
    Nov 18, 2012
    Posts:
    72
    In the latest update (which is live since a few days), I have added the method
    public void UpdateLineVertices(Vector3[] newSetOfVertices)

    Use that method to set or update the points.
    There is also a property LineWidth to set a new width. I think, however, only VolumetricLineBehavior and VolumetricLineStripBehavior have this property. I guess, I should add it to VolumetricMultiLineBehavior as well.
     
  8. j00hi

    j00hi

    Joined:
    Nov 18, 2012
    Posts:
    72
    I'll submit a Unity 4 version to the Asset Store.
     
  9. Shrandis

    Shrandis

    Joined:
    Oct 3, 2012
    Posts:
    30
    Thanks a lot. The unity 4 version works like a charm. You saved me a good amount of time.
     
  10. DarthDisembowel

    DarthDisembowel

    Joined:
    Jun 11, 2014
    Posts:
    54
    Hey, this asset worked great in the editor, much nicer than my cheap line renderers for generating a laser beam. I am able to use it in play mode in the editor with no problems, however when I build a standalone player I get the following errors, because the code is using UnityEditor, which can only be used in the editor. Am I doing something wrong, or do you have a fix for this?

    Code (CSharp):
    1. Assets/VolumetricLines/Scripts/Utils/ExposeProperties.cs(1,7): error CS0246: The type or namespace name `UnityEditor' could not be found. Are you missing a using directive or an assembly reference?
    2.  
    3. Assets/VolumetricLines/Scripts/Utils/ExposeProperties.cs(125,17): error CS0246: The type or namespace name `SerializedPropertyType' could not be found. Are you missing a using directive or an assembly reference?
    4.  
    5. Assets/VolumetricLines/Scripts/Utils/ExposeProperties.cs(140,69): error CS0246: The type or namespace name `SerializedPropertyType' could not be found. Are you missing a using directive or an assembly reference?
    6.  
    7. Assets/VolumetricLines/Scripts/Utils/ExposeProperties.cs(130,24): error CS0246: The type or namespace name `SerializedPropertyType' could not be found. Are you missing a using directive or an assembly reference?
    8.  
    9. Assets/VolumetricLines/Scripts/Utils/ExposeProperties.cs(153,75): error CS0246: The type or namespace name `SerializedPropertyType' could not be found. Are you missing a using directive or an assembly reference?
    10.  
    11. Assets/VolumetricLines/Scripts/Utils/ExposeProperties.cs(1,7): error CS0246: The type or namespace name `UnityEditor' could not be found. Are you missing a using directive or an assembly reference?
    12.  
    13. Error building Player because scripts had compiler errors
    I added #if UNITY_EDITOR to ignore ExposeProperties in the standalone and I don't get the errors anymore, and the volumetriclines work fine in the game. I just don't know if that's the best solution, or if I just did something wrong.
     
    Last edited: Sep 3, 2015
  11. j00hi

    j00hi

    Joined:
    Nov 18, 2012
    Posts:
    72
    Oh, wow... I'm very sorry about that! My bad.

    Here's the fix:
    Please move the File VolumetricLines/Scripts/Utils/ExposeProperties.cs into folder VolumetricLines/Scripts/Editor/

    I will upload a fixed version of the Asset.
     
  12. DarthDisembowel

    DarthDisembowel

    Joined:
    Jun 11, 2014
    Posts:
    54
    Awesome, thanks j00hi! :)
     
  13. Inspired2150

    Inspired2150

    Joined:
    Sep 28, 2014
    Posts:
    2
    Hello,

    First of all, let me apologize for being slower than the other folks in the thread, I am quite new with unity, have been learning it for maybe a year or so. I am attempting to generate a continuous laser beam from a muzzle of my laser turret to a raycast hitpoint on the target. However, it is not clear to me how to achieve just that. I don't understand how to feed all the right variables to the script.

    Basically right now I am modifying the vector3 EndPos variable and feeding it target coordinates, however it does not look very good because the laser "snaps" to the target.

    I have also tried feeding it Vector3.forward to simulate laser not hitting the target, but then the beam appears too short, and if I attempt to scale it nothing good happens.

    Could you please give me a few pointers how to properly utilize this asset? I am most interested in getting it to render "forward" whenever a raycast doesn't hit the layermask and I hitting the raycast hit coordinate when it does (I sort of solved that but I doubt very much that it's the right way to do it).

    Also, I have this silly idea of rendering the laser to an empty child object ahead of the turret whenever there is no raycast hit coordinate and when firing function is called, and rendering it to the raycast hit point when there is one. I guess that should work, but that would be considered highly immoral and probably illegal in some states.

    Edit: disregard that, that actually distorts the beam instead of producing the desired effect.

    Edit #2:

    So I've ended up writing the following code:

    Code (CSharp):
    1.    
    2. RaycastHit objectHit;  
    3. Vector3 fwd = transform.TransformDirection (Vector3.forward);
    4.  //Debug.DrawRay (transform.position, fwd * 50, Color.green);
    5.  if (Physics.Raycast (transform.position, fwd, out objectHit, 40, 1<<27)) {
    6.                
    7.                 if (objectHit.transform.gameObject.layer == 27) {
    8.                     EndPos= new Vector3(0,0,objectHit.distance/25); //This produces the laser of fitting length
    9.                 }
    10.             }
    11. else
    12. {EndPos= new Vector3(0,0,3); //Laser goes offscreen
    13.            }
    14.  
    And this is the result:

    LaserMissing.png
    Laser Missing the target

    Laser Hitting.png
    Laser Hitting the target.

    All in all, I am happy with the result, but I'm sure this isn't the right way of doing it.
     
    Last edited: Nov 17, 2015
  14. Magic73

    Magic73

    Joined:
    Jun 23, 2015
    Posts:
    132
    It seems it doesn't work well with an orthographic camera view....
    upload_2015-12-29_15-29-19.png
     
  15. twobob

    twobob

    Joined:
    Jun 28, 2014
    Posts:
    2,058
    You seem like a nice person,

    Here is some further reading if you hadn't spotted it

    https://github.com/keijiro/KvantSpray
    and
    https://github.com/keijiro/ManyCubes

    I kind of recall him doing something very clever with the 8 (or 12 or so) vertices for his cube problem, passing it directly to the GPU to get around the mesh creation problem. I also recall he did 3 or 4 very nice metric test for creating huge numbers. I did try to find the link again to no avail... perhaps you could have a look through his notes/blogs and spot it

    hope this helps
     
  16. j00hi

    j00hi

    Joined:
    Nov 18, 2012
    Posts:
    72
    It does work with an orthographic camera, but you probably have to use a very small line width:

    ortho_vol_line.PNG
     
  17. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    Perhaps an option is to use a very low fov perspective camera?
     
  18. Magic73

    Magic73

    Joined:
    Jun 23, 2015
    Posts:
    132
    Yes.. I have to scale the line width, when switching the camera from perspective view to the orthographic one. :)

    Thanks!
     
  19. DoctorMobius

    DoctorMobius

    Joined:
    Oct 2, 2014
    Posts:
    15
    Is anyone else experiencing a line disappearing when one point is outside the FOV?

    both points in fov.png

    Moving the camera so that the start point is outside of FOV hides the rendered effect.

    half in fov.png
     
  20. DoctorMobius

    DoctorMobius

    Joined:
    Oct 2, 2014
    Posts:
    15
    Solved. It turns out that I needed to recalculate the bounds of the mesh after updating it so that Unity's frustum culling didn't hide it.

    For anyone interested, I added this at the bottom of the SetStartAndEndPoints function:
    Code (CSharp):
    1. //Update the mesh bounds to avoid frustum culling
    2. mesh.RecalculateBounds();
     
    twobob likes this.
  21. Luiz_Thiago

    Luiz_Thiago

    Joined:
    Feb 27, 2013
    Posts:
    32
    Excellent Asset friend! I have two questions!

    The first is: I get a error (as image) when using UpdateLineVertices() method...
    The second question is: the line is "accumulating lighting", in the joints of Multiline, any solution for this?
     

    Attached Files:

  22. j00hi

    j00hi

    Joined:
    Nov 18, 2012
    Posts:
    72
    This happens most likely because you are calling it with a different number of vertices than the multiline is constructed with. Right now the implementation expects that you don't want to change the number of line segments but just update the positions of the existing line segments.

    The Multiline just creates multiple single volumetric lines and aligns their start- and endpositions.
    Have you already tried the Volumetric Line Strip which is also included in the asset?
     
  23. ksakins

    ksakins

    Joined:
    Aug 29, 2015
    Posts:
    16
    Hey, I appreciate the asset. The effect looks great, but I'm just getting started with it (and Unity to a large degree) so I'm having some troubles. I have a top down laser shot from a circle, and the line rotates around the Z-axis in the direction of the mouse click.

    I'm experiencing some interesting effects where the line seems to distort or angle whenever I click in various directions. For instance, the line looks wider when I shoot along the Y-axis, but thinner when I shoot along the X-axis. I was mainly noticing this when in Play mode and I maximized the Game window. I then experimented with setting the Display Ratio to 5:4 instead of Free Aspect, and it seemed to make the lines look better. What am I missing?

    Here's a photo of me manually adjusting the Game window size, horizontally. The laser seems to scale and possibly rotate? Screenshot (12).png Screenshot (13).png
     
    Last edited: Aug 19, 2016
  24. pantsdefender

    pantsdefender

    Joined:
    Oct 30, 2016
    Posts:
    5
    Just wanted to check if anyone knew if the Volumetric Lines version 2 method was ever implemented to account for artifacts with intersection and some Camera Points of View?
     
  25. lilZ

    lilZ

    Joined:
    Dec 3, 2016
    Posts:
    2
    Does anybody had issues with volumetric lines, when using 16:9 aspect ratio?
    I'm not very good at english, so i think pics will explain problem better than me :D

    shot1.PNG shot2.PNG
     
  26. j00hi

    j00hi

    Joined:
    Nov 18, 2012
    Posts:
    72
    First of all sorry that this asset hasn't received much love lately. But that is about to change. New version coming in the next few days which finally includes the shader optimizations by Lex Darlog which he contributed on GitHub. Thank you so much for your efforts!

    To address some of the questions here:

    I'm afraid this is just how this particular rendering technique works. It is basically creating a fake volumetric line in a computationally very cheap way in clip space. Therefore, it also suffers from some artifacts. That artifacts are less noticeable if the lines are further away but can become very obvious depending on camera settings like aspect ratio, field of view and distance to the camera. Maybe in your case, a simple 2D texture would produce better results? Have you also tried Unity's own line renderer?

    This would definitely solve some of the above mentioned problems. At the moment, however, I can't tell if or when I'll implement Volumetric Lines version 2.

    This is a similar problem as described above. The distortions depend on the aspect ratio and distance to the camera and, unfortunately, are inherent to the technique.
     
  27. ksakins

    ksakins

    Joined:
    Aug 29, 2015
    Posts:
    16
    Actually a line renderer with the preprocessing bloom effect is what I ended up using. It seems to give me the effect I want. Any thoughts on performance of the line renderer versus the volumetric approach? I doubt I'll go back to trying something different, just curious though. I'd like to keep the cost of my effects to a minimum, but I know Unity's preprocessing stack comes with some overhead, and I'm not sure how much relative to anything else I'd find.
     
  28. j00hi

    j00hi

    Joined:
    Nov 18, 2012
    Posts:
    72
    Have you applied the bloom effect only to the laser shots or to your whole rendered game? Bloom costs a bit of performance, especially on mobile! Volumetric line rendering should be somewhat compareable to Unity's line renderer in terms of performance, but I don't have any exact numbers. However, if you are using a lot of laser shots/lines, I suspect Unity's line renderer to be faster.
     
  29. ksakins

    ksakins

    Joined:
    Aug 29, 2015
    Posts:
    16
    That's a good question. I believe it's applied to my whole scene right now, but that's probably because I didn't realize I could apply it only to a specific object! That's probably a good thing to research on my end. But yes, the game will be multi-player and a lot of laser shots are expected.
     
  30. j00hi

    j00hi

    Joined:
    Nov 18, 2012
    Posts:
    72
    Well, imo the costs are actually the same whether applied to the laser shots only or to the whole scene, because it is a screen space effect. I was just thinking, if you'd only apply it to the laser shots, there has to be cheaper way of achieving the effect.
     
  31. bgolus

    bgolus

    Joined:
    Dec 7, 2012
    Posts:
    12,352
    Correcting for aspect ratio should be pretty straight forward.

    float aspectRatio = _ScreenParams.x / _ScreenParams.y;
    float2 posOffset = v.texcoord1.x * lineDirProj + v.texcoord1.y * float2(lineDirProj.y, -lineDirProj.x);
    posOffset.y *= aspectRatio;
    clipPos.xy += posOffset;
     
  32. j00hi

    j00hi

    Joined:
    Nov 18, 2012
    Posts:
    72
    Thanks for your suggestion.
    The problem with that solution is that it changes the curvature of the volumetric line at the ends and distorts the line extremely at steep camera positions towards the line. This destroys the volumetric line appearance since the three different quads become apparent.

    I have to give it some more thoughts, but right now, every attempt to counter the aspect ratio-related behavior actually makes it worse in some way.
     
  33. j00hi

    j00hi

    Joined:
    Nov 18, 2012
    Posts:
    72
    Huh, I think, I found a solution!
    Wasn't that straight forward, but looks promising right now.
    Basically, what needed to be done is to
    1) Calculate the line in screen space instead of clip space by scaling the x-coordinate with the aspect ratio
    2) And scaling the offset x-coordinates by the inverse aspect ratio

    I will have to do some more tests and if it looks correct in all cases and from all positions, I will publish an update.
     
  34. nullref

    nullref

    Joined:
    Aug 2, 2013
    Posts:
    3
    Hello. Your asset is really impresive. I am using it in an ongoing project. My question is: How do you create MaterialXX(Instance) in the editor? (like in the image below the winkface emoticon) I´ve been googling for an answer and found a workaround for what I need, however i would like to know how you create this material instances. There is even MaterialXX(Instance)(Instance)(Instance)(Instance)(Instance)(Instance) in some lines in the hierarchy in StaticLines scene. Thanks for your help, time and for this awesome and free asset.
     
  35. j00hi

    j00hi

    Joined:
    Nov 18, 2012
    Posts:
    72
    Hi and thanks!

    In the next couple of days, v2.0.0 of the asset will be available on the Asset Store. Amongst other changes, it features a cleaner way of handling materials and relies on a template material of which copies are created.
     
  36. Shadowfita

    Shadowfita

    Joined:
    Nov 19, 2016
    Posts:
    2
    A brilliant asset. I've been using this for a little lightsaber game and it's great! The one question I had was regarding emitting light. For now I've just been using lights for the emission but would it be better to use an emissive material? (I know nothing about shaders.)
     
  37. j00hi

    j00hi

    Joined:
    Nov 18, 2012
    Posts:
    72
    The volumetric lines "live" only in screen space, so they aren't actually present on their "real" place in the scene. By using emissive materials, you might not get the effect you are looking for.

    Could point lights added to the GameObject do the trick? (Like in the example scene with the laser cannon)
     
  38. Deleted User

    Deleted User

    Guest

    Great asset! It's exactly what I'm looking for except for one problem. It is a bit hard to describe so I'll do what I can. I can't seem to see the lines against the default skybox. When looking from the player camera in the game view, a line in front of the terrain or an object shows up perfectly, but one against the skybox does not appear. Specifically, I'm using these as lasers for a sci-fi gun. Am I using something wrong?
     
  39. jim00

    jim00

    Joined:
    Feb 1, 2015
    Posts:
    57
    why i get a green line in the middle? How do i disable the middle green line? thanks

    Note: I'm using Unity 2017.1.1f1 (64bit)

    Clipboard-20171005.png
     
  40. Benbyy

    Benbyy

    Joined:
    Jun 27, 2017
    Posts:
    1
    Hello. Thank you for this asset. I like it, but I'm having a problem. Do you know why the included prefab would render in FRONT of the terrain and BEHIND the trees of a terrain? Spatially speaking, the object is between the camera and the terrain/trees.
     
  41. mickeeyj

    mickeeyj

    Joined:
    Feb 22, 2018
    Posts:
    3
    Greetings, this a a great asset, thx so much for sharing.

    Just wondering if you know why the actual shot_prefab would not be visible on a new scene, it works fine of the example scene .. and the shot_prefab objects are being instantiated just not visible!?
     
  42. phanmay

    phanmay

    Joined:
    Nov 2, 2015
    Posts:
    1
    Idont show Unity 2017.4 ! Please Support for you! Thạnk
     
  43. Tahan

    Tahan

    Joined:
    Nov 10, 2015
    Posts:
    12
    Hello, can someone help me to make this line dotted?

    (Like this for example)



    I tried to do this, but the texture is displayed stretched.
     
  44. j00hi

    j00hi

    Joined:
    Nov 18, 2012
    Posts:
    72
    Umm, sorry, haven't looked into this thread for a long time.

    Based on the comments, there seem to be several issues with the asset as of now, but it's still usable in the latest Unity version - is this correct?

    Regarding some of the problems:

    If the asset does not appear in front of the skybox, that could mean, please try a different "RenderQueue" setting. It should be on the "Transparent" render queue, but please try other values as well.
    That could also be the issue with the terrain-tree-case or the "not visible on a new scene"-case.

    Please, report if that solved the issues or, if not, how to reproduce the issues!

    Which problems were there with Unity 2017.4?

    Regarding the dotted line: In order to preserve the volumetric appearance, the best way would be to construct it from many small VolumetricLine segments, each of which are a separate line.
     
    twobob likes this.
  45. Fattie

    Fattie

    Joined:
    Jul 5, 2012
    Posts:
    476
    Just reporting that Volumetric Lines is still working perfectly in 2018 Unity.

    Works perfectly in 2018 Unity!

    Here we added some lines on Terrain, using Volumetric Lines:

    screenshot 2.png

    (I really don't know any other effective way to add "lines on Terrain" than this. It's priceless.)
     
  46. HungryAdi

    HungryAdi

    Joined:
    Jan 20, 2018
    Posts:
    2
    Hey, I am trying to use this asset for laser rifle shots for an ios game. I can instantiate the shots and see them briefly appear in the scene view, but they are completely invisible in the game view, anybody know what I'm missing?

    Thanks!
     
  47. owen_proto

    owen_proto

    Joined:
    Mar 18, 2018
    Posts:
    120
    @j00hi Do you have any suggestions as to how to reduce artifacts on lines that are not straight like the one below? It's particularly noticeable along the forward axis. I've tried adding hundreds of vertices to smooth out the appearance but it doesn't eliminate the artifacts, especially depending on the angles between vertices.

    https://www.dropbox.com/s/0l4r923w1qe7084/volumelineartifacts.png?dl=0
     
  48. Fattie

    Fattie

    Joined:
    Jul 5, 2012
    Posts:
    476
    @OldLegWig - actually what is the problem? the red "hair" or?

    Don't you just have the "light saber" value on a weird setting? (try the other extreme?)

    notice my thankfully perfectly smooth lines on the "ski run", three posts up ..
     
  49. owen_proto

    owen_proto

    Joined:
    Mar 18, 2018
    Posts:
    120
    It happens regardless of the how much/little "lightsaber" is applied on a line that is curved as dramatically as that one. I suppose the solution is the volumetric lasers "version 2" mentioned earlier in this thread. An improved method is found here: https://web.archive.org/web/20170920123302/http://prideout.net:80/blog/?p=61
     
  50. bgolus

    bgolus

    Joined:
    Dec 7, 2012
    Posts:
    12,352
    This is an incredibly difficult thing to fix properly. Ultimately it's caused by the geometry making the line can often overlap, causing those areas to get brighter due to the shader drawing to those pixels 2 or 3 times (depending on culling).

    This is a regular trail renderer, sloppily hand dragged in the editor, but the problem is the same.
    trailOverlap.gif

    Increasing the point count helps reduce the overlaps to some degree, but as you saw above it really just means you now get more thin versions of those "hairs" as @Fattie put it rather than removing them entirely.

    "Solutions": (in quotes for a reason)
    • Use a line texture without a glow, just a solid, hard edge. Doesn't actually fix anything, just makes it so the overlaps aren't obvious. If you want the glow you'll need to use a post process effect.
    • Use a shader with a stencil or depth write to prevent self overlaps. This will prevent the extra hairs, but the line likely won't look as smooth anymore as those edges will instead look slightly misaligned.
    • Use a shader with a BlendOp Min or BlendOp Max. How well these work is highly dependant on the content, both the line and what's in the scene behind it. And when it does work you may still get the same misaligned look as the stencil or depth options.
    • When you get too close to viewing a line like this edge on, switch to multiple quad sprites instead. This requires a far more complex setup than what the above is intended to accomplish, requiring either even more fancy line geometry, geometry shaders, or dynamic mesh generation on the CPU. This can also get really expensive quickly.
    The main benefit of the technique used by this asset is it doesn't need any of the above making it quite inexpensive to render. The downside is it's an approximation of both a real 3D shape and a screen space glow which can have some unfortunate artifacts like the one you're seeing.