Unity Community


Page 50 of 121 FirstFirst ... 40484950515260100 ... LastLast
Results 981 to 1,000 of 2411

  1. Posts
    586
    Hey Eric, you support is great, I have what is probably a simple question.

    I'm drawing a line, at each point on the line a rigid body is instantiated that samples its position and draws a new line behind it. So my draw calls end up growing very large very fast.

    Any ideas on how to batch these draw calls? Seems to be one per vector object?

  2. Volunteer Moderator
    Posts
    23,719
    Quote Originally Posted by redmacmanz View Post
    I'm drawing a line, at each point on the line a rigid body is instantiated that samples its position and draws a new line behind it. So my draw calls end up growing very large very fast.

    Any ideas on how to batch these draw calls? Seems to be one per vector object?
    Maybe one big line, and have each rigidbody draw into the line with a different index? So points 0-499 would belong to rigidbody 1, rigidbody 2 would have points 500-999, etc.

    --Eric
    SpriteTile: new tile system that works seamlessly with Unity 4.3 sprites
    FlyingText3D: dynamic 3D text with TTF fonts | Vectrosity: fast & easy line drawing
    Nifty utilities! Stitch terrains together - runtime model importing - file browser - fractal landscapes


  3. Posts
    53
    Hi,

    I`m not a coder, so even though your tool looks interesting to me, I can`t use it. The only way I can use your tool is if vectrosity would be integrated with Playmaker. After I`ve seen your examples I had the feeling that Vectrosity openes so many possibilities, but not for me.
    Having Vectrosity-Playmaker actions, things will be a bit different. I think this will give me the possibility to draw lines at runtime, change the collors and thicknes according to the gameplay, changing them from dotted lines to continuos lines, etc.
    Do you think is possible to develop/integrate Vectrosity and Playmaker for users like me?
    Thank in advance for your answer.

  4. Volunteer Moderator
    Posts
    23,719
    I don't own Playmaker, so I doubt it will happen. I'd strongly suggest learning to code. By nature, "no-coding" tools are quite limited (this being a prime example--you can't use third party utilities without someone doing extra development). I'm not against them...I think they have their place, and are useful in some circumstances, but in the end they're no substitute for code. I started using Unity after 9 years in graphic design, so no point playing the "but I'm an artist" card.

    (By the way, this isn't an invitation for a general debate on no-coding tools...that's been done to death elsewhere. Vectrosity-only posts here, thanks. )

    --Eric
    SpriteTile: new tile system that works seamlessly with Unity 4.3 sprites
    FlyingText3D: dynamic 3D text with TTF fonts | Vectrosity: fast & easy line drawing
    Nifty utilities! Stitch terrains together - runtime model importing - file browser - fractal landscapes


  5. Posts
    53
    Well, it`s your product, and you have all the rights to decide who are your target clients.
    Anyway, thanks for the strong suggestion.


  6. Posts
    12
    Hey

    I bought vectrosity via the asset store. It's really useful, but I can't work out how to get mesh rendering working.

    Here's what I have: a script attached to an object with a mesh imported from a 3D package. I've dragged the mesh reference and the material onto the appropriate field in the script using the editor.

    Code:  
    1. public var lineMaterial : Material; //reference set in visual editor
    2. public var mesh : Mesh; //reference set in visual editor
    3. private var wireframe:VectorLine;
    4.  
    5. function Start () {
    6.     var tempArray:Vector3[] = new Vector3[mesh.vertexCount];
    7.     wireframe = new VectorLine("wireframe", tempArray, lineMaterial, 32.0, LineType.Discrete, Joins.Weld);
    8.     Vector.MakeWireframeInLine(wireframe, mesh);
    9. }
    10.  
    11. function Update () {
    12.     Vector.MakeWireframeInLine(wireframe, mesh);
    13.     Vector.DrawLine(wireframe);
    14. }

    Basically this yields no errors but it also doesn't seem to draw anything. What am I doing wrong?

  7. Volunteer Moderator
    Posts
    23,719
    MakeWireframeInLine should be done once, not every frame in Update.

    Code:  
    1. var mesh : Mesh;
    2.  
    3. function Start () {
    4.     var line = new VectorLine ("Wireframe", new Vector3[2], null, 2.0);
    5.     Vector.MakeWireframeInLine (line, mesh);
    6.     Vector.DrawLine (line);
    7. }

    Other than that, make sure the camera would be able to see mesh, since Vector3 points are in world space.

    --Eric
    SpriteTile: new tile system that works seamlessly with Unity 4.3 sprites
    FlyingText3D: dynamic 3D text with TTF fonts | Vectrosity: fast & easy line drawing
    Nifty utilities! Stitch terrains together - runtime model importing - file browser - fractal landscapes


  8. Posts
    12
    Ok, that almost works. But this is how it looks when I'm rendering a simple cube. (Cube looks fine using the inbuilt mesh renderer)



    and here's how it looks using Drawline3D (I'd rather use 2D if possible, I'm shooting for a retro graphics look)

    Last edited by bfod; 03-27-2012 at 07:38 AM.

  9. Volunteer Moderator
    Posts
    23,719
    Use a thinner line width, and/or use Joins.None instead of Joins.Weld.

    --Eric
    SpriteTile: new tile system that works seamlessly with Unity 4.3 sprites
    FlyingText3D: dynamic 3D text with TTF fonts | Vectrosity: fast & easy line drawing
    Nifty utilities! Stitch terrains together - runtime model importing - file browser - fractal landscapes


  10. Posts
    5,283
    Yep, weld still doesn't weld in a convincing way.
    I can't use these two things together.


  11. Posts
    2
    I have a problem with my line not being transparent at times.

    It seems to occur at random.

    How it should look:


    How it (sometimes look):


    Here is how I am drawing my lines:
    Code:  
    1. Vector.DestroyLine(ref trajectory);
    2.        
    3. trajectory = new VectorLine("Trajectory", segments, material, 12f, LineType.Continuous);
    4.        
    5. Vector.SetTextureScale(trajectory, 1.0f);
    6. Vector.DrawLine3D(trajectory);

    Trajectory is a VectorLine, segments is a array of Vector3 positions while material is a UnitAlpha shader from the demo with the texture dot2 (The same material as DotLine2 used in the Path scene)
    Last edited by Dumpen; 03-27-2012 at 02:43 PM.

  12. Volunteer Moderator
    Posts
    23,719
    I would guess that's the result of not using the right shader/material. I can't think of anything that would cause that in Vectrosity. One thing though, if you're doing that DestroyLine/making a new VectorLine a lot, I would recommend not doing that, and just making the line once.

    --Eric
    SpriteTile: new tile system that works seamlessly with Unity 4.3 sprites
    FlyingText3D: dynamic 3D text with TTF fonts | Vectrosity: fast & easy line drawing
    Nifty utilities! Stitch terrains together - runtime model importing - file browser - fractal landscapes


  13. Posts
    2
    Alright, ill take a look at my material instead. Thought I would give it a shot and ask here first, thinking you might had experienced it before

    I am only drawing the line once, then when the user changes position the segments change and I draw it again.

  14. Volunteer Moderator
    Posts
    23,719
    Quote Originally Posted by Dumpen View Post
    Thought I would give it a shot and ask here first, thinking you might had experienced it before
    Sorry, that's a new one.

    --Eric
    SpriteTile: new tile system that works seamlessly with Unity 4.3 sprites
    FlyingText3D: dynamic 3D text with TTF fonts | Vectrosity: fast & easy line drawing
    Nifty utilities! Stitch terrains together - runtime model importing - file browser - fractal landscapes

  15. Hi all....

    I'm relatively new to using Vectrosity (nice work, Eric, it seems very robust and easy to use). I have the basics up and running nicely, but now I'm trying to apply it to a more complicated situation.

    In the scene I'm working on, the main camera has an ambient animation on it (it sways around a bit as a character walks), but I have a problem with the texture on the line "swimming" around a bit as the camera moves. Basically, I'm using SetTextureScale to force a 1.0 aspect, but as the camera moves, the texture slides around a bit on the 3D line which is drawn.

    The script I wrote is this:

    Code:  
    1. #pragma strict
    2.  
    3. var myMat:Material;
    4. var line : VectorLine;
    5. var textureSize : int;
    6. var anchors : Vector3[];
    7. // var camObject : Transform;
    8.  
    9. function Start() {
    10.    
    11.     for (var n=0; n < anchors.Length; ++n) {
    12.         anchors[n] = GameObject.Find("Chainlink"+(n+1)).transform.position;
    13.         }
    14.    
    15.     line = new VectorLine("Line", anchors, myMat, textureSize, LineType.Continuous);
    16.  
    17.     Vector.SetTextureScale (line, 1.0);
    18.     Vector.DrawLine3D(line);
    19.  
    20. }
    21.  
    22. function LateUpdate() {
    23.     for (var n=0; n < anchors.Length; ++n) {
    24.         anchors[n] = GameObject.Find("Chainlink"+(n+1)).transform.position;
    25.     }
    26.    
    27.     Vector.SetTextureScale (line, 1.0);
    28.     Vector.DrawLine3D(line);
    29. }

    Probably there are some inefficiencies in there, as I'm still trying to learn the syntax (there are some redundancies, but I don't think that affects the problem).

    My only thought is that I could use the transform of the camera to somehow to compensate for its movement (or something). I can't quite wrap my head around what I should attempt to solve this. Hopefully this all makes sense.

    The reason that I'm updating the line in LateUpdate() is that I will eventually be moving some of the anchor points around dynamically, and need the line to update accordingly.

    Cheers in advance for any help you could offer.
    Last edited by Clockworkservant; 03-28-2012 at 05:13 AM.

  16. Volunteer Moderator
    Posts
    23,719
    I would guess the sliding is because the line is changing length, and SetTextureScale makes sure the texture always stays proportional regardless of the line's length. Maybe you should just do SetTextureScale once in Start, and not in LateUpdate? I'm not sure what effect you're going for.

    --Eric
    SpriteTile: new tile system that works seamlessly with Unity 4.3 sprites
    FlyingText3D: dynamic 3D text with TTF fonts | Vectrosity: fast & easy line drawing
    Nifty utilities! Stitch terrains together - runtime model importing - file browser - fractal landscapes

  17. I guess I could explained things a little better. Using the above script, I've set up 4 points, between which I'm drawing the continuous line. The line uses a chain-link texture.

    In the final game, the plan is to have the middle two points move around to create the illusion that something heavy is hanging from the chain. But currently... even when no points are being moved, the texture slides around. To be more precise, the mapping appears locked at the beginning of the line, but looks to scale slightly in and out across the length of the line as the camera animates.

    If I remove the animation from the camera, everything works perfectly, so it's at least related to that in some way.
    Last edited by Clockworkservant; 03-28-2012 at 12:51 PM.

  18. Volunteer Moderator
    Posts
    23,719
    Quote Originally Posted by Clockworkservant View Post
    If I remove the animation from the camera, everything works perfectly, so it's at least related to that in some way.
    Is the camera animation making the length of the line vary a little? What happens if you just set the texture scale once?

    --Eric
    SpriteTile: new tile system that works seamlessly with Unity 4.3 sprites
    FlyingText3D: dynamic 3D text with TTF fonts | Vectrosity: fast & easy line drawing
    Nifty utilities! Stitch terrains together - runtime model importing - file browser - fractal landscapes

  19. The camera isn't affecting the line, in any way that I can see. The points of the line aren't moving.

    Strangely, when I remove the SetTextureScale from LateUpdate, the texture behaves properly -- no swimming around. The only problem is, without that line in there, when I move a point, it will stretch incorrectly (ie. it won't hold it's 1.0 texture aspect).

    Edit: it's the same issue if I use Vector.DrawLine3DAuto(); to update the line, instead of using Vector.DrawLine3D in LateUpdate()

    For example, this code produces the same effect. No swimming around, but the line texture stretches when I'm pulling around points in the line:


    Code:  
    1. function Start() {
    2.    
    3.     for (var n=0; n < anchors.Length; ++n) {
    4.         anchors[n] = GameObject.Find("Chainlink"+(n+1)).transform.position;
    5.         }
    6.    
    7.     line = new VectorLine("Line", anchors, myMat, textureSize, LineType.Continuous);
    8.  
    9.     Vector.SetTextureScale (line, 1.0);
    10.     Vector.DrawLine3DAuto(line);
    11.  
    12. }
    13.  
    14. function LateUpdate() {
    15.     for (var n=0; n < anchors.Length; ++n)
    16.         anchors[n] = GameObject.Find("Chainlink"+(n+1)).transform.position;
    17. }

    If I then add Vector.SetTextureScale (line, 1.0); into the LateUpdate(), I get the swimming around again.
    Last edited by Clockworkservant; 03-28-2012 at 01:34 PM.

  20. Volunteer Moderator
    Posts
    23,719
    I didn't see this before:

    To be more precise, the mapping appears locked at the beginning of the line, but looks to scale slightly in and out across the length of the line as the camera animates.
    That is indeed how it works; the mapping is locked at the beginning, and scales the UVs so that the texture is always the desired aspect. If the texture is changing, that means the length of the line is changing. Maybe only slightly, but enough that the scaling would be visible. It seems to me that you shouldn't set the texture scale in Update, only once when the line is created and again when the points are moved.

    --Eric
    SpriteTile: new tile system that works seamlessly with Unity 4.3 sprites
    FlyingText3D: dynamic 3D text with TTF fonts | Vectrosity: fast & easy line drawing
    Nifty utilities! Stitch terrains together - runtime model importing - file browser - fractal landscapes

Page 50 of 121 FirstFirst ... 40484950515260100 ... LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •