Search Unity

  1. We are migrating the Unity Forums to Unity Discussions by the end of July. Read our announcement for more information and let us know if you have any questions.
    Dismiss Notice
  2. Dismiss Notice

Draw curved lines with texture and glow

Discussion in 'General Graphics' started by Stnaire, Jan 18, 2019.

  1. Stnaire

    Stnaire

    Joined:
    Sep 4, 2017
    Posts:
    6
    Hi,

    I'm looking for an efficient way to draw curved lines and to make an object follow them.

    I also need to draw them using a custom image and not a solid color.

    And on top of that I would like to apply an outer glow to the lines only, not to the rest of the scene.

    I don't ask for a copy/paste solution for each of these elements, I list them all to give some context.

    I did something similar in a web app using the html5 canvas to draw text progressively. Here a gif showing you the render:



    I only use small lines to draw what you see above. Here a very big letter with thinker lines so lines are more visible:



    Of course it's not perfect, but the goal was to keep it simple and efficient. And spaces on the outer edges are not very visible in normal size.

    This is used in an educational game working on mobile as a progressive app. In real world usage I attach a particles emitter to it for better effect :



    And it runs smoothly even on low end devices.

    I don't want to recreate this exact effect on Unity but the core functionality is very close.

    Because of how I did it the first time, I thought about creating a big list of segments to draw manually, but unity may have better tools to create this kind of stuff, maybe working directly with bezier curves.

    I a beginner in Unity so I don't really know what is the most efficient way to do it.

    I looked at the line renderer which seemed (at first) to be a good choice but I'm a little bit worried about performances with a list of 500+ points (considering mobiles are a target).

    Also, the glow I would like to add may impact on the technique to choose.

    Do you have any advice or direction to give me?

    Thank you very much.
     
    Last edited: Jan 18, 2019