Search Unity

  1. Good news ✨ We have more Unite Now videos available for you to watch on-demand! Come check them out and ask our experts any questions!
    Dismiss Notice

Fast Line Renderer

Discussion in 'Assets and Asset Store' started by jjxtra, Apr 25, 2016.

  1. jjxtra

    jjxtra

    Joined:
    Aug 30, 2013
    Posts:
    1,198
    Sending an update @mwb87, re-download in about an hour.
     
  2. mwb87

    mwb87

    Joined:
    Mar 19, 2019
    Posts:
    13
    It works fine now, thanks for the quick action :)
     
  3. mwb87

    mwb87

    Joined:
    Mar 19, 2019
    Posts:
    13
    Hi @jjxtra,

    I have a small additional question. Is it possible to uniform scale a texture? I now use "Line UVX scale" but when a selection gets larger it (logically) stretches.

    selection.png

    I would like to keep the texture (a dot) the same size, and repeat over the length of a line. Vectrocity has a "textureScale" option, but I can't find anything like that in the documentation. Is this something FastLineRenderer can do?

    Thanks
     
  4. jjxtra

    jjxtra

    Joined:
    Aug 30, 2013
    Posts:
    1,198
    Nothing like this exists currently, but you could break your selection into additional line segments to compensate, for example the longer sections could be two separate lines that are half the length. Does that make sense?
     
  5. mwb87

    mwb87

    Joined:
    Mar 19, 2019
    Posts:
    13
    That's too bad.

    I get what you are saying, but I think that makes the code too complex to archive this.
    Thanks for your answer.
     
  6. jjxtra

    jjxtra

    Joined:
    Aug 30, 2013
    Posts:
    1,198
    You already have 8 line segments. This would take it to 12.
     
  7. mwb87

    mwb87

    Joined:
    Mar 19, 2019
    Posts:
    13
    My selection is based on a grid, so each side need to be the length of a grid cell. An I have different grid sizes, so its needs to be flexible.

    selection.png

    But i turns out i wasn't too bad to achieve :)
    Thanks for the suggestion though.
     
  8. Bambivalent

    Bambivalent

    Joined:
    Jan 25, 2017
    Posts:
    11
    Hi, I'd like to make a continuously drawn graph, like a seismograph. I only need around 15 points, but the whole graph = all points needs to be moving all the time.
    Is it correct that I have to reset the lineRenderer on every frame via Update() and then redraw the whole graph? Or can I "recycle" the existing graph and manipulate the existing points to save gpu time?
    upload_2020-5-8_23-21-30.png
     
  9. lmaxsmith

    lmaxsmith

    Joined:
    Nov 21, 2016
    Posts:
    1
    Hey, I'm using Fast Line Renderer to draw wireframes of thousands of objects in a scene, all read from a file and drawn at runtime. It's working great but I'm really trying to optimize to allow for a disgusting amount of content. I currently have a fastlinerenderer script on every object instance. Less than 100 line segments per object. I'm wondering if it might be better performance to have fewer fast line renderers that hold multiple objects? Or if it's just as good to keep tons of fast line renderers. (Targeting mobile ARM devices)
    Asking for insight here before making major changes to the code because it will be a significant move. Thanks.
     
  10. jjxtra

    jjxtra

    Joined:
    Aug 30, 2013
    Posts:
    1,198
    If you have a lot of changing line renderers, then having one per object is better. If you have mostly static lines, then just use one line renderer.
     
  11. Whitepot

    Whitepot

    Joined:
    May 19, 2017
    Posts:
    13
    Hi there, I'm having a problem when drawing a (curved) animated line in the UI. In the first frame after calling Apply() (after I have set everything up with AppendCurve(...)). The line is stretched out, then in the subsequent frames it returns to normal.


    In this image you can see the stretched line in the background in white. Then in the next frames it looks as it should (see image below)


    I set up the curve as follows:
    Code (CSharp):
    1. _lineRenderer.Reset();
    2. FastLineRendererProperties props = new FastLineRendererProperties();
    3. lineRenderer.ScreenRadiusMultiplier = _screenRadiusMultiplier;
    4. props.GlowIntensityMultiplier = 0;
    5. props.GlowWidthMultiplier = 0;
    6. props.Radius = _radius;
    7. props.Color = Color.white;
    8. props.Start = point1.position;
    9. props.End = point2.position;
    10. _lineRenderer.AppendCurve(props, curvepoint1.position, curvepoint2.position, _noOfSegments, _startCap, _endCap, _animationTime);
    11. _lineRenderer.Apply();
    Is there anything I should be doing or avoiding to stop this from Happening?

    Thanks in Advance.
     

    Attached Files:

unityunity