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

Render some lines based on entity data?

Discussion in 'Graphics for ECS' started by jwvanderbeck, Jan 6, 2020.

  1. jwvanderbeck

    jwvanderbeck

    Joined:
    Dec 4, 2014
    Posts:
    825
    So I have some entities that contain a list of clockwise wound points which define a series of edges, or lines. Is there an ECS way I can render these?
     
  2. jwvanderbeck

    jwvanderbeck

    Joined:
    Dec 4, 2014
    Posts:
    825
    Looks like best I can tell the Hybrid Renderer only works with mesh objects. Guess I need to pop out of the ECS ecosystem for this.
     
  3. RoughSpaghetti3211

    RoughSpaghetti3211

    Joined:
    Aug 11, 2015
    Posts:
    1,697
    I will need tackle the same problem soon, currently I’m just using a gizmo as a temp solution
     
  4. jwvanderbeck

    jwvanderbeck

    Joined:
    Dec 4, 2014
    Posts:
    825
    I think what I'm going to do for now at least is have a System that converts certain entities into GameObjects with the LineRenderer component and then just use that. Honestly right now its more about visualization than anything. I need a visual way to verify that my complex dance of systems and entities has produced the expected result :)
     
  5. 5argon

    5argon

    Joined:
    Jun 10, 2013
    Posts:
    1,555
    florianhanke likes this.
  6. florianhanke

    florianhanke

    Joined:
    Jun 8, 2018
    Posts:
    426
    That was me! :D I'm using it with entities 0.4, but since I copied it in 0.2, I am not sure how it deviated since then. Let me know if I can help with a 0.4 migration.

    Also, I am considering using it for tracers, not just debugging, since so far it works well.
     
    5argon likes this.
  7. 5argon

    5argon

    Joined:
    Jun 10, 2013
    Posts:
    1,555
    Wow, I thought I came across the name somewhere!

    I add just SubScene conv. support for 0.4 and some ECB.eq overload optimization + put systems in groups and it appears to work so far.. the billboard rotation is still not looking right however.
     
    florianhanke likes this.
  8. florianhanke

    florianhanke

    Joined:
    Jun 8, 2018
    Posts:
    426
    Fame, at last! :D

    If I don't move the camera it correctly is rotated towards that camera (and the camera is not moved in my tests).

    I'll update with the latest code asap and will report back if there are issues (update: there are no issues).

    Thank you for this useful library! :)
     
    Last edited: Jan 6, 2020