Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Vectrosity - Fast and Easy Line Drawing

Discussion in 'Assets and Asset Store' started by Eric5h5, Sep 26, 2014.

  1. Eric5h5

    Eric5h5

    Volunteer Moderator Moderator

    Joined:
    Jul 19, 2006
    Posts:
    32,401
    Version 5.4.2 available now! Get Vectrosity here.

    Vectrosity is a complete line-drawing solution, which uses Unity's canvas system for GUI lines, and meshes for 3D lines drawn inside the scene. You can easily make lines, curves, end caps, textures and more, with a simple yet deep API. Drawing lines can be as easy as this:

    Code (javascript):
    1. VectorLine.SetLine (Color.yellow, Vector2(0, 0), Vector2(100, 200));
    Or you can get fancier and make all kinds of graphs, grids, selection boxes, and anything else to do with lines, including entire games made with vector graphics if you want.



    • Works on most platforms including mobile; doesn't need Unity Pro. Written in C# but works with any language.
    • "Free" anti-aliasing when used with textures, which means you don't need FSAA to have anti-aliased lines.
    • Can also use textures for making things like glowing lines without full-screen glow effects, dotted or dashed lines, etc.
    • 3D, 2D, and point drawing. Lines can be any number of pixels thick.
    • Can have continuous or discontinuous lines with arbitrary colors and widths for each segment. This way, with discrete lines, many "separate" lines can be drawn in a single line object.
    • Lines can have end caps, for making arrows, rounded ends, etc.
    • Many functions for easily making boxes, circles, splines, etc.
    • Fast — lines only have to update when they change, so static lines take no extra CPU time, and don't need to constantly redraw every frame like GL lines.
    • Includes a utility for quickly making customized 3D vector shapes from existing meshes, or automatically make wireframes in code with one function call.
    • Helper scripts for making 3D vector objects behave like standard game objects.
    • Complete documentation, plus a reference guide covering all functions.
    • Dozens of example scripts and demos, plus the complete "Tank Zone" game project is included free.
    • Low price, so most anyone can afford it.
    • Source code included.

    This topic should be used for Vectrosity 4 and 5 discussion; the original topic for Vectrosity 3 and earlier can be found here.

    --Eric
     
  2. thylaxene

    thylaxene

    Joined:
    Oct 10, 2005
    Posts:
    716
    Awesome Eric just what I needed to add a finishing touch to a client's travel app!

    Cheers.
     
  3. gecko

    gecko

    Joined:
    Aug 10, 2006
    Posts:
    2,240
    Is there a way to have a ScrollUV script attached to the vector lines automatically? (Or some other way to add a pulsing effect to the vectrosity lines?)
     
  4. Eric5h5

    Eric5h5

    Volunteer Moderator Moderator

    Joined:
    Jul 19, 2006
    Posts:
    32,401
    You can scroll the material's offset using VectorLine.textureOffset, or Material.mainTextureOffset (normally preferred since it doesn't need to compute UVs every frame). I imagine that expanding/contracting the line width in a sine wave pattern would be useful for a pulsing effect.

    --Eric
     
  5. Zeioth

    Zeioth

    Joined:
    Jul 31, 2014
    Posts:
    2
    What's the easier way to make a curve of more than 4 points? I'm having troubles to achieve a curve like this:



    EDIT: I already read about MakeSpline, but i need beziers for my project
     
    Last edited: Sep 30, 2014
  6. Eric5h5

    Eric5h5

    Volunteer Moderator Moderator

    Joined:
    Jul 19, 2006
    Posts:
    32,401
    You can use multiple bezier curves in a single line, as shown in the DrawCurve demo script.

    --Eric
     
  7. nhf75

    nhf75

    Joined:
    Apr 5, 2013
    Posts:
    35
    Hi, i'm using vectrosity for unity 4.6 now and my code is used to show me the distance between two points.
    In unity 4.6 with vectrosity 3.1 used to work fine.
    What i done wrong when i changed to vectrosity 4?
    The line not changing when raycast look to other point of terrain. The line stay in same place.
    Sorry for my english.
    Code (CSharp):
    1. using UnityEngine;
    2. using System.Collections;
    3. using Vectrosity;
    4.  
    5. public class VectrosityRadial : MonoBehaviour
    6. {
    7.         private Vector3[] _radial;
    8.         public static VectorLine _radialLine;
    9.         public Material _lineMaterial;
    10.         // Use this for initialization
    11.         void Start ()
    12.         {
    13.                 _radial = new Vector3[2] {Vector3.zero,Vector3.zero};
    14.              
    15.         }
    16.  
    17.         // Update is called once per frame
    18.         void Update ()
    19.         {
    20.                 if (_radialLine == null) {
    21.                         InstanceRadial ();
    22.                 }
    23.                 RaycastHit hit;
    24.                 if (Physics.Raycast (CameraSelect.Camera_Ativa.ScreenPointToRay (new Vector2 (Input.mousePosition.x, Input.mousePosition.y)), out hit, Mathf.Infinity)) {
    25.                         _radial [0] = ADM._SetaReloc.transform.position;
    26.                         _radial [1] = hit.point;
    27.                         Distancia ();
    28.                 } else {
    29.                         _radial [0] = ADM._SetaReloc.transform.position;
    30.                         _radial [1] = ADM._SetaReloc.transform.position;
    31.                         ADM._CanvasMenu.GetComponent<ADMCanvas> ()._distanciaText.text = "0 m";
    32.                 }
    33.         }
    34.         public void Distancia ()
    35.         {
    36.                 float _dist = (_radial [1] - _radial [0]).magnitude;
    37.                 ADM._CanvasMenu.GetComponent<ADMCanvas> ()._distanciaText.text = (_dist).ToString ("#####.##") + " m";
    38.          
    39.         }
    40.         void InstanceRadial ()
    41.         {
    42.                 VectorManager.useDraw3D = true;
    43.                 _radialLine = new VectorLine ("Radial", _radial, _lineMaterial, 3);
    44.                 _radialLine.Draw3DAuto (Mathf.Infinity);
    45.                 _radialLine.AddNormals ();
    46.                 _radialLine.AddTangents ();
    47.         }
    48.         public static void DestroyRadial ()
    49.         {
    50.  
    51.                 VectorLine.Destroy (ref _radialLine);
    52.         }
    53. }
    54.  
     
    Last edited: Oct 1, 2014
  8. Eric5h5

    Eric5h5

    Volunteer Moderator Moderator

    Joined:
    Jul 19, 2006
    Posts:
    32,401
    What is the code supposed to do, and what is it not doing now? I can't run it because it depends on other scripts.

    --Eric
     
  9. Eric5h5

    Eric5h5

    Volunteer Moderator Moderator

    Joined:
    Jul 19, 2006
    Posts:
    32,401
    By the way, version 4.0 (also includes 3.1.2) is on the Unity asset store now, which is...faster than I was expecting. Not complaining though....

    --Eric
     
  10. nhf75

    nhf75

    Joined:
    Apr 5, 2013
    Posts:
    35
    I would like to see the one point of line follow the hit of raytracer.
    The line not changing when raycast look to other point of terrain. The line stay in same place.
     
  11. Eric5h5

    Eric5h5

    Volunteer Moderator Moderator

    Joined:
    Jul 19, 2006
    Posts:
    32,401
    Oh, I see...you probably want to read the Vectrosity 4 upgrade guide, particularly this part: "Since the array of points used to create a VectorLine is no longer referenced after the line is created, use VectorLine.points2 (for Vector2 lines) or VectorLine.points3 (for Vector3 lines) instead." There's a code example of the old way compared to the new way.

    --Eric
     
  12. nhf75

    nhf75

    Joined:
    Apr 5, 2013
    Posts:
    35
    Thank you so much, it's worked!

    Code (CSharp):
    1. using UnityEngine;
    2. using System.Collections;
    3. using Vectrosity;
    4.  
    5. public class VectrosityRadial : MonoBehaviour
    6. {
    7.         public static VectorLine _radialLine;
    8.         public Material _lineMaterial;
    9.  
    10.         // Update is called once per frame
    11.         void Update ()
    12.         {
    13.                 if (_radialLine == null) {
    14.                         InstanceRadial ();
    15.                 }
    16.                 RaycastHit hit;
    17.                 if (Physics.Raycast (CameraSelect.Camera_Ativa.ScreenPointToRay (new Vector2 (Input.mousePosition.x, Input.mousePosition.y)), out hit, Mathf.Infinity)) {
    18.                         _radialLine.points3 [0] = ADM._SetaReloc.transform.position;
    19.                         _radialLine.points3 [1] = hit.point;
    20.                         Distancia ();
    21.                 } else {
    22.                         _radialLine.points3 [0] = ADM._SetaReloc.transform.position;
    23.                         _radialLine.points3 [1] = ADM._SetaReloc.transform.position;
    24.                         ADM._CanvasMenu.GetComponent<ADMCanvas> ()._distanciaText.text = "0 m";
    25.                 }
    26.         }
    27.         public void Distancia ()
    28.         {
    29.                 float _dist = (_radialLine.points3 [1] - _radialLine.points3 [0]).magnitude;        //_radialLine.GetLength ();
    30.                 ADM._CanvasMenu.GetComponent<ADMCanvas> ()._distanciaText.text = (_dist).ToString ("#####.##") + " m";
    31.            
    32.         }
    33.         void InstanceRadial ()
    34.         {
    35.                 _radialLine = new VectorLine ("Radial", new Vector3[2], _lineMaterial, 3);
    36.                 _radialLine.Draw3DAuto ();
    37.                 _radialLine.AddNormals ();
    38.                 _radialLine.AddTangents ();
    39.         }
    40.         public static void DestroyRadial ()
    41.         {
    42.  
    43.                 VectorLine.Destroy (ref _radialLine);
    44.         }
    45. }
     
  13. bererton

    bererton

    Joined:
    Jun 20, 2014
    Posts:
    34
    Hi Eric,
    A question for you. I'm having some trouble with the new Vectrosity 4, but I suspect it's an understanding issue. I'm making a 2D game using Unity 4.6. I have two cameras, one for UI and one for gameplay. Both are set to be Orthographic. The UI camera stays at a fixed location on the screen (so the buttons are always in the same place), and the main camera stays centered on the player.

    In terms of drawing order, I have a few sortingLayers, with UI on top and enemies,players, obstacles on lower sorting layers.

    I am using 2D lines and not 3d lines, and draw them using the mainCamera. Do I need to use the mainCamera to convert the points using Camera.main.WorldToScreenPoint() every time the object moves? Is there an easier way to do this?

    Also... using Vectrosity4, setting line.active=false doesn't seem to hide the line as per the docs (and it used to work in Vectrosity 3). Am I missing something?

    Thanks for any help you might be able to offer.
     
  14. bererton

    bererton

    Joined:
    Jun 20, 2014
    Posts:
    34
    Hmmm... one more thing I noticed is that upgrading to the latest Vectrosity made my Unity start crashing a lot as well... not sure why. Fortunately I was able to use Git to downgrade :-( I'm using Unity 4.60b18 so it's the beta and thus likely some bug or other.
     
  15. Eric5h5

    Eric5h5

    Volunteer Moderator Moderator

    Joined:
    Jul 19, 2006
    Posts:
    32,401
    I spent quite a lot of time developing Vectrosity with 4.6b18 and it never crashed, so I'm pretty sure any crashing isn't related to Vectrosity. Anyway b20 is out now so you can try that. See the notes in the changelog about line.active.

    I'd recommend just using one camera; you don't need two. The UI won't move when you move the main camera anyway. I doubt you need to use WorldToScreenPoint for anything, but without knowing what you're doing, it's hard to offer any advice.

    --Eric
     
  16. TheAryeh

    TheAryeh

    Joined:
    Jan 18, 2014
    Posts:
    4
    Hey Eric,

    I'm trying to switch my DLL to the Vectrosity 4 version, and each time I overwrite the last version I was using (the most recent version before 4 was released) I get this error:
    It goes away as soon as I swap out the new DLL for the old one. Intellisense is working as expected, allowing me to insert VectorLines without any issue. If I remove the one reference to my line, the error goes away, of course. I've gone through the upgrade guide and reduced my code down to one line call which seems to adhere to the upgrade recommendations. Here's my line:
    Code (CSharp):
    1. lineVec = new VectorLine("main", new Vector3[segmentNum], null, 40.0f);
    Would you have any ideas?

    Many thanks, and as always, awesome work,
    TheAryeh
     
  17. Eric5h5

    Eric5h5

    Volunteer Moderator Moderator

    Joined:
    Jul 19, 2006
    Posts:
    32,401
    I tried importing the Vectrosity 4 DLL into a Vectrosity 3 project, and it worked without errors (well, aside from the scripts no longer working of course). So unfortunately I'm not really sure. Unless you're not using Unity 4.6b19 or later?

    --Eric
     
  18. bererton

    bererton

    Joined:
    Jun 20, 2014
    Posts:
    34
    Hi Eric, thanks for the quick reply.

    I don't know why it was crashing... but as soon as I went back to Vectrosity 3 the stability was fine again under 4.6b18. It's weird... might be that Unity is less stable for some reason related to my particular project or machine configuration.

    Good point about only needing the one camera... I'll take out the second one.
     
  19. Eric5h5

    Eric5h5

    Volunteer Moderator Moderator

    Joined:
    Jul 19, 2006
    Posts:
    32,401
    The DLL was built with 4.6b19, so I'd recommend using b19 or later.

    --Eric
     
  20. bererton

    bererton

    Joined:
    Jun 20, 2014
    Posts:
    34
    Ah, well that would definitely explain potential stability issues. Thanks Eric.
     
  21. Eric5h5

    Eric5h5

    Volunteer Moderator Moderator

    Joined:
    Jul 19, 2006
    Posts:
    32,401
    Vectrosity 4.0.1 is out:

    Fixes:
    • Adding points to VectorLine.points2 or points3 works when drawing VectorPoints.
    • VectorPoints.Draw3D draws quads correctly.

    --Eric
     
  22. wbl1

    wbl1

    Joined:
    Apr 22, 2009
    Posts:
    159
    Sorry if this has already been asked, but Eric ... do you expect any issues with Vectrocity when Unity 5 finally comes out - specifically the webGL stuff?

    I am using Vectrocity pretty extensively and I want to make as smooth a transition as possible when Unity 5 does finally come out ... Thanks!
     
  23. Eric5h5

    Eric5h5

    Volunteer Moderator Moderator

    Joined:
    Jul 19, 2006
    Posts:
    32,401
    The idea is that all standard Unity code should work with WebGL, and Vectrosity doesn't use any weird hacks, so I wouldn't expect any issues.

    --Eric
     
    wbl1 likes this.
  24. AlienMe

    AlienMe

    Joined:
    Sep 16, 2014
    Posts:
    93
    Hi,

    Is there a way to "move" 3d lines in Vectrosity 4?

    With Vectrosity 3, we were taking the mesh gameObject generated for the 3d lines, and parented the vectorObject's transform, and the 3d lines would 'move' together with the parent transform.

    The only solution we've come up with for version 4 is to update all the points in the line every time the parent moves.

    Is there a better way?

    Thanks.
     
  25. Eric5h5

    Eric5h5

    Volunteer Moderator Moderator

    Joined:
    Jul 19, 2006
    Posts:
    32,401
    The normal way to move lines, in both Vectrosity 3 and 4, is to use .drawTransform with a particular transform, and move that.

    --Eric
     
  26. AlienMe

    AlienMe

    Joined:
    Sep 16, 2014
    Posts:
    93
    We'll try that. Thanks.
     
  27. Dabeh

    Dabeh

    Joined:
    Oct 26, 2011
    Posts:
    1,614
    Code (csharp):
    1.  • In addition to the 65K vertex limit per line, there is a 65K total vertex limit for all lines. So e.g. using two continuous lines with 10000 points each (40K vertices) will fail.
    Any possible workarounds for this? I'm using discrete and have a ton of points that need rendering.

    I might just have to stick to Vectrosity 3 if this isn't possible, which isn't really a bad thing; I just hate not having the newest and greatest!
     
    Last edited: Oct 9, 2014
  28. Eric5h5

    Eric5h5

    Volunteer Moderator Moderator

    Joined:
    Jul 19, 2006
    Posts:
    32,401
    You can make more than one canvas, and put different VectorLines on different canvases.

    --Eric
     
    Dabeh likes this.
  29. ichini

    ichini

    Joined:
    Oct 13, 2012
    Posts:
    23
    Hi,

    I'm having a hard time finding a good VectorLine / Mesh shader combination to use with Draw3D. Unfortunately my absent shader coding knowledge has me stuck to the defaults.

    Ideally it would allow for
    • a semi-transparent, directional-lit mesh
    • a line with alpha-channel textures (for 'free' anti-aliasing)
    • dimming of lines behind meshes (optional)
    So far none of the combinations i've tried tick all three boxes. Some even introduce weird issues:

    A Transparent/Diffuse-shaded mesh with the default VectorLineGlow (Particle/Additive (soft)-shaded) material for the line comes closest to what i'm trying to achieve. There is no 'dimming' of hidden lines, but what's worse is that Vectrosity seems to get confused about the z-index of the mesh and the line, resulting in the line 'blinking' when the object rotates.

    A vertex-lit line (e.g. Transparent/Cutout/VertexLit) seems to work without blinking (Transparent/Diffuse-shaded mesh). Also hidden lines are dimmed. But the anti-aliasing of the texture's alpha gradient is lost, and also lines seem to be temporarily drawn twice between some vertices, resulting in some blinking and width-changes as well.

    I've used an Unlit/Transparent shader for the mesh, which stops the blinking, but that looses the lighting.

    Any leads, insights, experiences you can share are highly appreciated. Some examples in the screenshot below, and here's the project I used (<1mb): http://static.trust.at/vectortest/Vectortest.zip

    Thanks!

    vectortest.png
     
    Last edited: Oct 9, 2014
  30. Eric5h5

    Eric5h5

    Volunteer Moderator Moderator

    Joined:
    Jul 19, 2006
    Posts:
    32,401
    After some experimenting, I used a copy of the Particles/Additive (soft) shader, changed "Queue"="Transparent" to "Queue"="Overlay", and used the new shader on the VectorLineGlow material, which seemed to fix the issue.

    --Eric
     
  31. ichini

    ichini

    Joined:
    Oct 13, 2012
    Posts:
    23
    Hi Eric,

    Thanks a lot, what a great fix and an incentive for me to dig into Cg shaders a bit more.

    Have you been able to reproduce the 'blinking double lines' as well? For me they appear when using e.g. the default VertexLit shader or Transparent/Cutout/VertexLit for the lines.

    All the best,

    georg.
     
  32. Eric5h5

    Eric5h5

    Volunteer Moderator Moderator

    Joined:
    Jul 19, 2006
    Posts:
    32,401
    That's just the result of the VectorLine mesh intersecting with the object's mesh; you could shrink the object slightly to avoid that.

    --Eric
     
  33. nhf75

    nhf75

    Joined:
    Apr 5, 2013
    Posts:
    35
    Hi all, I've been editing a shader to make it compatible with vectrosity. It works fine now. This shader serves to give visibility always on top off meshes. The difference is that you can choose the colors outside and inside of the mesh. Do not remove the "Cull Off" command. If you remove it, when you point to the end of a line, it will disappear.
     

    Attached Files:

  34. ichini

    ichini

    Joined:
    Oct 13, 2012
    Posts:
    23
    Ah, thank you, Eric, scaling the mesh to 0.999 in relation to the vector line indeed gets rid of the unwanted 'double lines'.

    nhf75: tried your shader as well - interesting effect, might be of use some day!
     
  35. knchaffin

    knchaffin

    Joined:
    May 18, 2013
    Posts:
    58
    I have been using Vectrosity in a scientific visualization context with Unity for about a year. I am using Vectrosity cubic curves to represent brain synapse connections and parameters with Unity 4.6b20. Prior to version Vectrosity 4, I was able to display 4096 cubic curves with 26 Vector3 points at a tolerable frame rate, for scientific purposes. I spent the last couple of weeks trying to get Vectrosity 4 working and finally succeeded by deleting every Vectrosity file and folder I could find in my scene and then carefully importing only the version 4 package. After getting this working, I ran my scene in Unity and promptly received the error that the canvas had more than 64K vertices. I began reducing the number of points per curve and eventually was able to get a successful launch with 4 points per cubic curve! How do I determine how many vertices Vectrosity will use per line segment? What else is consuming the canvas vertex count? Is Unity 4.6 likewise now limited to 64K vertices per canvas, or is this limit built into Vectrosity?

    The speed for 4096 curves with 4 points is also about 1/3 of the earlier version of Vectrosity with 4096 curves with 24 points. This tells me that even if I could have > 64K vertices by using multiple canvases (and the horrendous access logic), the speed would be unusable for my purposes. There are also other issues in which my dynamic curves update is not working any longer.

    I am going to revert to Vectrosity 3 as I see no way that version 4 is going to work for me. If anyone has any hints as to what I may be doing wrong or how I can address the vertex limit and the speed issue, please let me know.

    - K.N. Chaffin
     
  36. Eric5h5

    Eric5h5

    Volunteer Moderator Moderator

    Joined:
    Jul 19, 2006
    Posts:
    32,401
    Each canvas is a mesh and has the usual Unity mesh limitations. You can create more canvases and use VectorLine.rectTransform.SetParent to put different VectorLines on different canvases. It didn't seem like the 65K limitation was something people were running up against, but if that's not the case, then I'll think of something that's more automated than manually creating more canvases.

    As far as speed, the only case I'm aware of where Vectrosity 4 is slower is if you were using 1-pixel lines before with VectorLine.useMeshLines, since hardware 1-pixel lines are no longer possible when using a canvas. If you have some code that demonstrates otherwise, I'd like to take a look so I can see what's going on and fix it. Same thing with dynamic updating that doesn't work. (However, I expect in that case you're using the original arrays; as noted in the upgrade guide, you need to use VectorLine.points2 or .points3 now, since the original arrays are now only used to populate the VectorLine on creation and are no longer referenced afterward.)

    --Eric
     
  37. knchaffin

    knchaffin

    Joined:
    May 18, 2013
    Posts:
    58
    Thanks for your quick reply. I have reverted to Vectrosity 3 for Unity 4.3 and have everything working again. I have the process working well now for switching between Vectrosity versions, but I need to leave it set to Vectrosity 3 for the time being so that my research is not stymied.

    I am using MakeCurve to dynamically update the Bezier curve end points and control points. I assume that internally it is using points3. The VectorLines are set to Draw3DAuto. So basically per frame I call MakeCurve on each VectorLine as well as SetColor to change color (including alpha), 'lineWidth' to change width, 'material' to change material and 'active' to change whether to display the curve or not. I am using a custom material that uses the Particles/Additive(Soft) shader with no texture. The dynamic update that seems to not be working is that setting 'active' to false is not suppressing rendering. It is difficult to pull this out as a functional example since my hippocampus simulation involves Unity, CUDA and DirectCompute. I am not using 1 pixel hardware lines.

    K.N. Chaffin - Texas Tech University
     
  38. Eric5h5

    Eric5h5

    Volunteer Moderator Moderator

    Joined:
    Jul 19, 2006
    Posts:
    32,401
    As noted in the known issues in the changelog, VectorLine.active has no effect due to a bug in the current beta version of Unity 4.6. There are some workarounds you can use in the meantime.

    --Eric
     
  39. knchaffin

    knchaffin

    Joined:
    May 18, 2013
    Posts:
    58
    Thanks. I'll just stick to Vectrosity 3 since it is doing everything I need.
     
  40. nhf75

    nhf75

    Joined:
    Apr 5, 2013
    Posts:
    35
    Hi Eric5h5,
    How do I include shadow and add layer in vectorline as I did in vectosity 3?
     
  41. Eric5h5

    Eric5h5

    Volunteer Moderator Moderator

    Joined:
    Jul 19, 2006
    Posts:
    32,401
    You can change the layer with VectorLine.canvas.gameObject.layer (or canvas3D). Shadows aren't supported as far as I know.

    --Eric
     
  42. nhf75

    nhf75

    Joined:
    Apr 5, 2013
    Posts:
    35
    The vectorline has drop shadow of vectorline on the ground. If you don't want shadow, you must uncheck the cast shadown in mesh render of gameobject. Don't vectorline of vectrosity4 have shadow? What is the prevision if it will have in the future?
    Sorry for my english.
     
  43. Eric5h5

    Eric5h5

    Volunteer Moderator Moderator

    Joined:
    Jul 19, 2006
    Posts:
    32,401
    Canvases don't support shadows as far as I know.

    --Eric
     
  44. castor76

    castor76

    Joined:
    Dec 5, 2011
    Posts:
    2,517
    Hi Eric.

    I have been using Vectrosity 3 and I found it is pretty cool so far.

    However, I have come across some issue with trying to use it in the following case :

    1. I tried to make it work in Editor mode. Meaning, I was trying to draw line while I was inside Unity Editor and NON play mode. I think stuff fails and gives me null reference.

    2. I use line drawing mostly inside game , (which works fine) but I need to also use it in my GUI system (NGUI) but since my camera setting for Vectrosity is not correct to draw for the NGUI camera it is not showing. (NGUI camera is facing Z direction and my main camera is facing Y down direction.

    Question :

    1. Is there way I can make it work in Unity Editor in editor mode (ExecuteinEdiMode)
    2. Can I set specific line to be drawn to the specific camera ? (Camera setting per line)

    Thanks. ( I also wonder if these are somewhat addressed in version 4 if it is known stuff)
     
  45. Eric5h5

    Eric5h5

    Volunteer Moderator Moderator

    Joined:
    Jul 19, 2006
    Posts:
    32,401
    Vectrosity is designed to be used in play mode only. You can use SetCamera3D (and SetCamera in Vectrosity 3) to make Vectrosity use a particular camera.

    --Eric
     
  46. nhf75

    nhf75

    Joined:
    Apr 5, 2013
    Posts:
    35
    Is vectrosity3 will be discontinued? In vectrosity3 we used to do access mesh render to project shadows line over the terrain with _line1.vectorObject.renderer.castShadows = false/true, and we used to do one line of others lines of same class(script) be unvisible by one especific camera. If i use SetCamera3D i will set all lines of one class(script). In vectrosity3 i simple use one line: _line3.layer=1 to set only _line3 to be invisible by an specific camera with mask with transparentFx for example. Is vectrosity3 will be discontinued?

    -nhf75
     
  47. Eric5h5

    Eric5h5

    Volunteer Moderator Moderator

    Joined:
    Jul 19, 2006
    Posts:
    32,401
    Vectrosity3 won't have any new features, but it will continue to have bugfixes if necessary.

    --Eric
     
  48. castor76

    castor76

    Joined:
    Dec 5, 2011
    Posts:
    2,517
    I was asking about letting specific line to use specific camera only. Meaning, I need to have some lines using the one camera and other lines use the other camera.
     
  49. Eric5h5

    Eric5h5

    Volunteer Moderator Moderator

    Joined:
    Jul 19, 2006
    Posts:
    32,401
    You can use SetCamera3D with a camera, draw the lines that you want, then use SetCamera3D with another camera, and draw the rest of the lines.

    --Eric
     
  50. Ian76

    Ian76

    Joined:
    Sep 20, 2014
    Posts:
    3
    Hi Eric,

    I changed the queue tag to "Overlay" and it did stop the blinking, but now the line is not occluded by transparent objects. In other words, the line remains %100 visible even if it is behind partially transparent objects.

    Can we conclude that animated Vectrosity 3D Lines behave unpredictably when occluded by transparent objects?

    This is so strange because sometimes it works perfectly. I'm tempted to try Vectrosity 4 and see if the same problem occurs.

    Ian