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, May 26, 2010.

Thread Status:
Not open for further replies.
  1. Eric5h5

    Eric5h5

    Volunteer Moderator Moderator

    Joined:
    Jul 19, 2006
    Posts:
    32,401
    Actually I covered this earlier in this topic: http://forum.unity3d.com/threads/49941-Vectrosity-fast-and-easy-line-drawing/page13 (near the bottom). Basically you have the object drawn with a solid color, and then the vector lines drawn on top of it.

    You can have an array or List of VectorLines (var lines = new VectorLine[10], var lines = new List.<VectorLine>()).

    If it's something that you want to use, I'll be happy to add lowercase letters; I just didn't know if anyone was going to bother. Or you can add some yourself; there's a bit in the docs about that.

    --Eric
     
  2. Werit

    Werit

    Joined:
    Dec 12, 2010
    Posts:
    38
    I'm trying to draw a large circle, but no matter how many segments I give it, it just will not complete the circle. It works fine on small ones, in this example I am going for a radius of 60. The VectorManager is set to use 3d drawing.

    Here is some of the code...


    float radius = 60;
    float segments = radius * 10;

    Vector3[] pts = new Vector3[segments*2];

    Color[] colors = new Color[segments*2];
    for (int i = 0; i < segments*2; i++)
    {
    colors = Color.red;
    }

    rl = new VectorLine("test", pts, colors, null, 1);
    Vector.MakeCircleInLine(rl, new Vector3(transform.position.x, transform.position.y, 0),radius , segments);
    Vector.DrawLine(rl);

    EDIT: Any radius over 43 causes it to be incomplete.
     
    Last edited: Feb 23, 2011
  3. Eric5h5

    Eric5h5

    Volunteer Moderator Moderator

    Joined:
    Jul 19, 2006
    Posts:
    32,401
    There are a few issues with that script: 1) segments should be int, not float, 2) the colors array needs to be half the length of the points array (one entry per line segment), 3) setting VectorManager to 3D drawing only affects lines drawn with the VectorManager scripts; you'd want to use DrawLine3D for that line. If you just want the circle to be red and don't plan on changing the segment colors later, you can just use Color.red in place of the colors array.

    --Eric
     
  4. Werit

    Werit

    Joined:
    Dec 12, 2010
    Posts:
    38
    Eric,

    1) Fixed.
    2) Fixed.
    3) Fixed.

    Still shows the same behavior, but it manifests itself at a radius of 45 instead.

    4) If I am using Vector3's, there doesn't seem to be any prototype for VectorLine() which allows me just the use of Color.red rather than an array.

    Thanks!
     
    Last edited: Feb 23, 2011
  5. Eric5h5

    Eric5h5

    Volunteer Moderator Moderator

    Joined:
    Jul 19, 2006
    Posts:
    32,401
    There is, but you have to specify "ref" when using C#, due to me accidentally putting that in for some reason (for this overload only). I fixed that for the next version, but in the meantime, change line 46 of the VectorLine.cs script to this:

    Code (csharp):
    1.     public VectorLine (string lineName, Vector3[] linePoints, Color color, Material lineMaterial, float width) {
    then you won't need to use "ref". As for the other thing, using this code:

    Code (csharp):
    1.         float radius = 60;
    2.         int segments = (int)radius * 10;
    3.        
    4.         Vector3[] pts = new Vector3[segments*2];
    5.        
    6.         VectorLine rl = new VectorLine("test", pts, Color.red, null, 1);
    7.         Vector.MakeCircleInLine(rl, new Vector3(transform.position.x, transform.position.y, 0), radius, segments);
    8.         Vector.DrawLine3D(rl);
    I get this, if I put the camera at (0, 0, -200):

    $circle.png

    --Eric
     
  6. Werit

    Werit

    Joined:
    Dec 12, 2010
    Posts:
    38
    aha!

    The culprit is the tilt of my camera, which is 310 degrees on the x axis. Even if I zoom out (orth size), the bottom of the circle just won't show.

    The camera is also at 0,-25,-20. Moving the camera back a bit (y and z) results in the full circle showing.
     
    Last edited: Feb 23, 2011
  7. Eric5h5

    Eric5h5

    Volunteer Moderator Moderator

    Joined:
    Jul 19, 2006
    Posts:
    32,401
    The full circle should always be shown...if you move the camera after drawing the line, you need to call DrawLine3D again.

    --Eric
     
  8. fucrate

    fucrate

    Joined:
    May 23, 2010
    Posts:
    5
    Hey Eric,

    I'm really liking the package, but I'm having weird issues with the 3D lines and I can't seem to find the solution anywhere. For some reason when my camera is near enough to a line that a significant portion of it goes out of view, the entire line snaps to being drawn very poorly, very thin and even dotted looking, and it snaps back when you put the entire line within view.

    I've got a demo showing it happening here: http://dl.dropbox.com/u/2173641/WebPlayer/WebPlayer.html

    Use the mouse to look around and WASD to move, try to look at the red lines and see it snap from looking good to looking really bad when you get close enough.

    Any suggestions?
     
  9. Eric5h5

    Eric5h5

    Volunteer Moderator Moderator

    Joined:
    Jul 19, 2006
    Posts:
    32,401
    Yeah, the math for WorldToScreenPoint has problems in situations like that. I'd recommend using more points in the lines, which will at least minimize the effect if it can't be removed altogether.

    --Eric
     
  10. fucrate

    fucrate

    Joined:
    May 23, 2010
    Posts:
    5
    Cool, I can deal with that. Would adding more points to the lines create a performance issue?
     
  11. Eric5h5

    Eric5h5

    Volunteer Moderator Moderator

    Joined:
    Jul 19, 2006
    Posts:
    32,401
    No, unless you added bazillions more points.

    --Eric
     
  12. Sammual

    Sammual

    Joined:
    Oct 28, 2008
    Posts:
    176
    Hi, I just bought Vectrosity and I got 29 errors while importing the package.

    Assets/Vectrosity/Scripts/Curve/DrawCurve.js(12,20): BCE0018: The name 'VectorLine' does not denote a valid type ('not found').

    One instance of [The name 'VectorLine' does not denote a valid type ('not found').] for every entry of VectorLine. Am I missing something?

    I am running Unity 3.2 and Behave and Vectrosity are the only packages included.
     
  13. Eric5h5

    Eric5h5

    Volunteer Moderator Moderator

    Joined:
    Jul 19, 2006
    Posts:
    32,401
    I guess the Vector scripts aren't in Standard Assets. If you look on the asset store, you can see in the package contents how the folders and scripts should be set up.

    --Eric
     
  14. Sammual

    Sammual

    Joined:
    Oct 28, 2008
    Posts:
    176
    That was it. For some reason I didn't have Vectors.js in the Standard Assets.

    I have a few questions for you.

    1) How would I draw a circle defined by three points rather then a center and radius?
    2) How would I draw a line when I have a point and a slope?
    3) In your Drawing Points example (below) how would I sort dotPoints by Y and then X value (I can't find any documentation on using JS Multidimensional arrays is Unity 3.2 and it is driving me nuts.

    Code (csharp):
    1.  
    2. var dotSize = 1.0;
    3. var numberOfDots = 50;
    4. function Start () {
    5. var dotPoints = new Vector2[numberOfDots];
    6. for (p in dotPoints)
    7. p = Vector2(Random.Range(0, Screen.width), Random.Range(0, Screen.height));
    8. var dotColors = new Color[numberOfDots];
    9. for (c in dotColors)
    10. c = Color(Random.value, Random.value, Random.value);
    11. var dots = new VectorPoints("Dots", dotPoints, dotColors, null, dotSize);
    12. Vector.DrawPoints(dots);
    13. }
    14.  
    Thanks,
    Sammual
     
  15. Eric5h5

    Eric5h5

    Volunteer Moderator Moderator

    Joined:
    Jul 19, 2006
    Posts:
    32,401
    Using some math, no doubt...that's not my area of expertise though. ;) There aren't any built-in functions for that, if that's what you're asking, but you can add your own.

    Not quite sure what you mean by sorting them. Multidimensional arrays in JS are exactly the same as in C#, so you can use the MSDN docs:

    Code (csharp):
    1. var intArray = new int[20, 20];
    2. intArray[1, 2] = 5;
    --Eric
     
  16. sibhod

    sibhod

    Joined:
    Apr 13, 2009
    Posts:
    20
    I'm sorry if this is obvious, but I couldn't find anything on the subject.

    I setup a line to attach to a game object like so:
    VectorManager.ObjectSetup (gameObject, line, Visibility.Dynamic, Brightness.Normal);

    Yet when I move, rotate, or scale the gameObject, the line doesn't update or follow. Is there an update method I need to call on Update or a setting I have wrong or something?

    Thanks!
     
  17. Eric5h5

    Eric5h5

    Volunteer Moderator Moderator

    Joined:
    Jul 19, 2006
    Posts:
    32,401
    Does the gameobject have some kind of active renderer? See the section in the docs about creating invisible bounds meshes, if you don't want the "real" mesh to be seen. This is necessary for Visibility.Dynamic to work, so OnBecameVisible and OnBecameInvisible will have something to work with. (Note that using Visibility.Always doesn't require this, since the line is always drawn.)

    --Eric
     
  18. sibhod

    sibhod

    Joined:
    Apr 13, 2009
    Posts:
    20
    The gameObject is just a Cube, so yes it has a mesh renderer, and I was animating it's position, scale,and rotation with iTween. The line would not update to the transform of the cube if the mesh renderer was enabled or disabled. I seemed to fix the problem by adding an update like so:

    void Update ()
    {
    Vector.DrawLine( line, gameObject.transform );
    }

    Is this the wrong way to handle it?
     
  19. Eric5h5

    Eric5h5

    Volunteer Moderator Moderator

    Joined:
    Jul 19, 2006
    Posts:
    32,401
    The line should update automatically when using the VectorManager.ObjectSetup function. The idea is that you call that function once, then you can manipulate the object as normal and the associated vector line object will just work, which you can see in the Tank Zone demo for example, so calling DrawLine manually in Update isn't necessary. Not sure what would cause it not to update. Is the mesh renderer active?

    --Eric
     
  20. wesrm

    wesrm

    Joined:
    May 20, 2009
    Posts:
    193
    Hi Eric,

    I just picked up Vectrosity. Nice work!

    I'm having an issue where the line is not drawing. I'm trying to set the line points based off the touch position and an object being dragged. I'm not sure what I'm doing wrong.

    Thanks,
    Wes

    Here's the code that draws the line and sets the point positions based off touch position .

    Code (csharp):
    1. touchLine.points2[0] = new Vector2(touchPoints[0].position.x, touchPoints[0].position.y);
    2. touchLine.points2[1] = new Vector2(itemsManager.currentItem.transform.position.x, itemsManager.currentItem.transform.position.y);
    3.                
    4. Vector.DrawLine(touchLine);
    5. Vector.SetTextureScale(touchLine, 1.0f);
    In my Awake function, I setup up the line as follows.

    Code (csharp):
    1. //setup vector lines
    2.         Vector.SetCamera (camera, CameraClearFlags.Depth, true);
    3.         touchLine = new VectorLine("touchLine", new Vector2[2], lineMaterial, 8.0f);
     
    Last edited: Mar 8, 2011
  21. wesrm

    wesrm

    Joined:
    May 20, 2009
    Posts:
    193
    Hi Eric,

    I just picked up Vectrosity. Nice work!

    I'm having an issue where the line is not drawing. I'm trying to set the line points based off the touch position and an object being dragged. I'm not sure what I'm doing wrong.

    Thanks,
    Wes

    Here's the code that draws the line and sets the point positions based off touch position .

    Code (csharp):
    1. touchLine.points2[0] = new Vector2(touchPoints[0].position.x, touchPoints[0].position.y);
    2.                 touchLine.points2[1] = new Vector2(itemsManager.currentItem.transform.position.x, itemsManager.currentItem.transform.position.y);
    3.                
    4.                 Vector.DrawLine(touchLine);
    5.                 Vector.SetTextureScale(touchLine, 1.0f);
    In my Awake function, I setup up the line as follows.

    Code (csharp):
    1. //setup vector lines
    2.         Vector.SetCamera (camera, CameraClearFlags.Depth, true);
    3.         touchLine = new VectorLine("touchLine", new Vector2[2], lineMaterial, 8.0f);
     
  22. Eric5h5

    Eric5h5

    Volunteer Moderator Moderator

    Joined:
    Jul 19, 2006
    Posts:
    32,401
    What happens if you try hard-coding the coordinates for debugging purposes? For example, try Vector2(100, 100) for touchLine.points2[0] and Vector2(200, 200) for touchLine.points2[1]. If I try that with your code I get a diagonal line as expected. If I had to guess, is it an issue with itemsManager.currentItem.transform.position? That would normally be world-space coordinates, and lines using Vector2 coords are in screen-space.

    --Eric
     
  23. wesrm

    wesrm

    Joined:
    May 20, 2009
    Posts:
    193
    Thanks for the help Eric. The issue was that I needed to convert my object in the itemsManager from world to screen point. This makes the line appear, but it's not correct. I was using the line renderer to draw a line from an object in my scene and the finger point on the screen. The object is being dragged around the screen by touch drag. I'm wanting to draw a line from the object to the finger point, so I need to change points2[0] and points1[0]. Is this possible?

    Thanks,

    Wes
     
  24. Eric5h5

    Eric5h5

    Volunteer Moderator Moderator

    Joined:
    Jul 19, 2006
    Posts:
    32,401
    Seems like WorldToScreenPoint is right. See the demo Highlight.js script, where the 3D spheres are connected by lines to a point. Or maybe you're using GUI-space coords, in which the screen-space coords need the Y flipped?

    --Eric
     
  25. wesrm

    wesrm

    Joined:
    May 20, 2009
    Posts:
    193
    Hi Eric,

    Thanks for the help. I got it working : )

    Code (csharp):
    1. void SetLineAndDraw(Touch touch)
    2.     {
    3.         if(itemsManager.currentItem != null)
    4.         {
    5.             linePoints[0] = touch.position;
    6.                
    7.             Vector3 screenPos = Camera.main.WorldToScreenPoint(itemsManager.currentItem.transform.position);// set to screen space
    8.             linePoints[1] =  screenPos;
    9.            
    10.             Vector.DrawLine(touchLine);//draw line
    11.             Vector.SetTextureScale(touchLine, 1.0f);
    12.         }
    13.     }
    I have one more issue that I can't figure out how to solve. I am dragging an object with touch and connecting the touch point and object with a vector line. Here's what I'm having trouble with...

    1. When the user lifts there finger off the screen, I need to make the vector line invisible. When I was using the Line Renderer, I was setting it's enabled property to false. How can I do this with Vectrosity? I am using a 2D Line so from my understanding, I can't use the VectorManager to set visibility.

    Thanks!

    Wes
     
  26. Eric5h5

    Eric5h5

    Volunteer Moderator Moderator

    Joined:
    Jul 19, 2006
    Posts:
    32,401
    Since the line is actually a mesh, you can disable the renderer as usual using vectorObject. i.e., touchLine.vectorObject.renderer.enabled = false. Or you could disable the object: touchLine.vectorObject.active = false.

    --Eric
     
  27. wesrm

    wesrm

    Joined:
    May 20, 2009
    Posts:
    193
    Excellent! Thanks Eric! Left a 5-star review on the Asset Store.

    -Wes
     
  28. Eric5h5

    Eric5h5

    Volunteer Moderator Moderator

    Joined:
    Jul 19, 2006
    Posts:
    32,401
    Thank you!

    --Eric
     
  29. cube3_

    cube3_

    Joined:
    Apr 12, 2010
    Posts:
    3
    Hello all,

    Just bought Vectrosity.

    I am trying to create some axis / world-grid gizmo's. It works fine until I resize the screen. The gizmo's do not seem to transform properly anymore because of a changed aspect ratio / screen size in 2D space. It either offsets on the screen, or disappears completely.

    I do redraw the grid and transform again if the screen size and width is changed. And destroy the old lines. using the Vector.DestroyLine Method.

    drawing is done via method:

    Code (csharp):
    1. Vector.DrawLine(gridLine,transform);
    You can view the effect on:
    http://dl.dropbox.com/u/20857460/Blog/Games/livebox/world-grid/Permalinks/transform-issue.html

    Please help.
     
    Last edited: Mar 15, 2011
  30. Eric5h5

    Eric5h5

    Volunteer Moderator Moderator

    Joined:
    Jul 19, 2006
    Posts:
    32,401
    Did you call Vector.SetCamera after changing the screen size?

    --Eric
     
  31. exiguous

    exiguous

    Joined:
    Nov 21, 2010
    Posts:
    1,749
    Purchased today. Really awesome work. Thanks alot for that. This will probably speed up my own work and/or make the result look better ;).
     
  32. cube3_

    cube3_

    Joined:
    Apr 12, 2010
    Posts:
    3
    No, but now I did and it works *blush*. Just recently started using unity. Thanks for the fast reply Eric. Like the work you are doing on Vectrosity.

    Cube3.
     
  33. Eric5h5

    Eric5h5

    Volunteer Moderator Moderator

    Joined:
    Jul 19, 2006
    Posts:
    32,401
    Thank you both. :)

    --Eric
     
  34. exiguous

    exiguous

    Joined:
    Nov 21, 2010
    Posts:
    1,749
    so here are my questions ;) :
    1. how about using assets from your sample projects? especially i'm interested in the glow textures. are they included in the license?

    2. i draw some 3d lines in 3d space with Vector.DrawLine3D and see them. but when i rotate around the objects the lines get thinner and disappear when viewed from along their plane. i guess this is intended or at least "normal behavior". will it work to call Vector.DrawLine3D again every time the camera position and/or rotation has changed to adjust all stored lines towards the camera? or is there another workaround for this?

    many thanks for your effort
     
  35. Eric5h5

    Eric5h5

    Volunteer Moderator Moderator

    Joined:
    Jul 19, 2006
    Posts:
    32,401
    1. Yep, feel free to use those.

    2. Yes, call DrawLine3D whenever the camera or line moves.

    --Eric
     
  36. Ippokratis

    Ippokratis

    Joined:
    Oct 13, 2008
    Posts:
    1,521
    Hi. I use this script
    Code (csharp):
    1.  
    2. #pragma strict
    3. //Attach VectorManager to an object on the scene
    4. var maskMaterial:Material;
    5. var myMaskLine : VectorLine;
    6.  var linePoints:Vector3[];
    7. var width:float;
    8. var color:Color;
    9. var lineWidths:float[];
    10. var lineColors:Color[];
    11.  
    12. function Start ()
    13. {
    14.    
    15.     lineWidths = new float[linePoints.length*0.5];
    16.     lineColors = new Color[linePoints.length*0.5];
    17.     for(var segments:float in lineWidths)
    18.     {
    19.         segments = width;
    20.     }
    21.     for(var segments:Color in lineColors)
    22.     {
    23.         segments = color;
    24.     }
    25.     //VectorLine (name : String, points : Vector3[], color : Color[], material : Material, lineWidth : float, depth : int = 0, lineType : LineType = LineType.Discrete, joins : Joins = Joins.Open) : VectorLine
    26.     myMaskLine = VectorLine("MyMaskLine", linePoints, lineColors, maskMaterial, width, 0, LineType.Discrete, Joins.Open);
    27.  [COLOR=blue]   //myMaskLine.smoothWidth = true;[/COLOR]
    28.    
    29.     Vector.SetCamera3D();
    30.     VectorManager.useDrawLine3D = true;
    31.     VectorManager.ObjectSetup (gameObject, myMaskLine, Visibility.Always, Brightness.Normal);
    32. }
    33.  
    34. function Update()
    35. {
    36.     Vector.SetWidths(myMaskLine, lineWidths);
    37.     Vector.SetColorsSmooth (myMaskLine, lineColors);
    38. }
    Problem is that when I uncomment //myMaskLine.smoothWidth = true; I get

    I set in the editor the linePoints as an Vector3 array with 4 members.
    Any suggestions on what I should do to get smooth interpolation between line segments widths?

     
    Last edited: Mar 17, 2011
  37. Eric5h5

    Eric5h5

    Volunteer Moderator Moderator

    Joined:
    Jul 19, 2006
    Posts:
    32,401
    You need to use Vector.SetWidths. However, I'll put better error checking for this case into the next version so this doesn't happen.

    --Eric
     
  38. Ippokratis

    Ippokratis

    Joined:
    Oct 13, 2008
    Posts:
    1,521
    Ok, thanks Eric. You have some nice new (for me) methods here :)
     
  39. mohydineName

    mohydineName

    Joined:
    Aug 30, 2009
    Posts:
    301
    I must say I am very impressed by this library. Great work Eric!
     
  40. Mousey

    Mousey

    Joined:
    Oct 29, 2008
    Posts:
    16
    Hi Eric.

    I bought Vectrosity on Monday (from your website, not through the asset store), but it's only tonight and the weekend that I'll get to have a proper play! What I briefly looked at was great though, including your excellent documentation.

    Anyway, my question is simply - how do we get future updates?
     
  41. Werit

    Werit

    Joined:
    Dec 12, 2010
    Posts:
    38
    Is there a faster way to do this? It seems to cost me ~200fps.

    Code (csharp):
    1.  
    2.     public VectorLine vl = null;
    3.    
    4.     void OnGUI()
    5.     {
    6.        
    7.         Vector3[] pts = new Vector3[100];
    8.  
    9.         if (vl == null)
    10.         {
    11.             vl = new VectorLine("circ", pts, Color.blue, null, 1);
    12.         }
    13.  
    14.         Vector.MakeCircleInLine(vl, new Vector3(transform.position.x, transform.position.y, 0), radius, 50);
    15.         Vector.DrawLine3D(vl);
    16.     }
    17.  
     
    Last edited: Mar 18, 2011
  42. Eric5h5

    Eric5h5

    Volunteer Moderator Moderator

    Joined:
    Jul 19, 2006
    Posts:
    32,401
    Move that code out of OnGUI; only OnGUI-specific code should be in there. You only need to make the circle once, and the line only has to be redrawn if it changes or the camera moves.

    --Eric
     
  43. Eric5h5

    Eric5h5

    Volunteer Moderator Moderator

    Joined:
    Jul 19, 2006
    Posts:
    32,401
    If you buy it through the asset store, then updates are handled automatically. If you buy it through my website, then right now I have to do that manually. I'm going to implement a better system though. I started doing that a while ago, then put it on hold in favor of the asset store; however it turns out that I actually get more sales through my site, plus I keep more like 98% instead of 70%, so I'm going to go back to focussing on my site more.

    --Eric
     
  44. Werit

    Werit

    Joined:
    Dec 12, 2010
    Posts:
    38
    I have improved it a bit, as the camera can move (zoom):

    Code (csharp):
    1.  
    2.     public VectorLine vl = null;
    3.     float clast;
    4.  
    5.     void OnGUI()
    6.     {
    7.        
    8.         Vector3[] pts = new Vector3[100];
    9.  
    10.         if (vl == null)
    11.         {
    12.             vl = new VectorLine("circ", pts, Color.blue, null, 1);
    13.             Vector.MakeCircleInLine(vl, new Vector3(transform.position.x, transform.position.y, 0), radius, 50);
    14.         }
    15.  
    16.  
    17.         if (clast != Camera.main.orthographicSize)
    18.         {
    19.             Vector.DrawLine3D(vl);
    20.             clast = Camera.main.orthographicSize;
    21.         }
    22.     }
    23.  
     
  45. Eric5h5

    Eric5h5

    Volunteer Moderator Moderator

    Joined:
    Jul 19, 2006
    Posts:
    32,401
    Really, it's a bad idea to use OnGUI for code that's not using GUI.x functions. Better to use Update, or better yet just redraw the line when the camera is actually zooming instead of constantly checking.

    --Eric
     
  46. dilbertian

    dilbertian

    Joined:
    Aug 13, 2010
    Posts:
    74
    I am new to Vectrosity and noticed loads of warnings coming up in my debug once I had added my own custom line materials that say: Shader wants normals, but the mesh <line name> doesn't have them. I started re-reading the documents and notice that the material parameter says that if different line depths are used, the material should use a shader that writes to the depth buffer for this to work reliably. First of all, I didn't think you could do shaders unless you had Unity Pro but when I right clicked on my project tree and clicked on Create, sure enough it was there so I created a shader. So how do I get my shader to use vertex colors and once I do that, how do I associate my shader with my material?

    In the meantime I see there is a "work around" to use a null for your material parameter but now all of my lines are white - not exactly what I was going for and totally unacceptable for a finished product.

    At this point I am stuck, can anybody point me in the right direction for getting started with materials with shaders and/or how to satisfy the minimum requirements to restore color to my lines while stopping the flood of warnings clogging up my debug console?
     
  47. Eric5h5

    Eric5h5

    Volunteer Moderator Moderator

    Joined:
    Jul 19, 2006
    Posts:
    32,401
    Best thing to do for shaders is look at existing ones and modify them as needed. The particle shaders, for example, use vertex colors. To use a shader in a material, just select it from the appropriate drop-down menu in the material. The default shader in Vectrosity (the one you get if you use null for the material) does vertex colors, so you can supply a color when making a line, and it will use that instead of white, so that's probably the easiest thing to do.

    --Eric
     
  48. dilbertian

    dilbertian

    Joined:
    Aug 13, 2010
    Posts:
    74
    Eric,

    Thanks for your help, that got rid of the error and the line looks a bit softer. I need to work with the width I think to get it to show up better now.

    -Tim
     
  49. mohydineName

    mohydineName

    Joined:
    Aug 30, 2009
    Posts:
    301
    Hi Eric,

    How can I display a GUIText on top of a line?

    Thanks

    Stephane
     
  50. Eric5h5

    Eric5h5

    Volunteer Moderator Moderator

    Joined:
    Jul 19, 2006
    Posts:
    32,401
    You would want to use a separate camera that only displays GUITextures, and have it be a higher depth than the vector camera.

    --Eric
     
Thread Status:
Not open for further replies.