Search Unity

  1. Unity 2019.1 is now released.
    Dismiss Notice

SpriteRenderer in ECS

Discussion in 'Entity Component System and C# Job system' started by jooleanlogic, Feb 8, 2019.

  1. jooleanlogic

    jooleanlogic

    Joined:
    Mar 1, 2018
    Posts:
    244
    Is it possible to get any official word on how this is going to be implemented in future?
    Is it going to be it's own component or just a quad RenderMesh and will it be an IComponentData or a SharedComponent like RenderMesh?
     
    foxnne likes this.
  2. Antypodish

    Antypodish

    Joined:
    Apr 29, 2014
    Posts:
    4,084
    Sprite is just a mesh with a texture.
    So I wouldn't see any reason to be treated differently, than any other 3D object in ECS.
     
  3. jooleanlogic

    jooleanlogic

    Joined:
    Mar 1, 2018
    Posts:
    244
    Ok thanks Antypodish. I'm not well versed on the rendering side of Unity. RenderMesh is missing things like Sorting Layer and Order in Layer but I imagine they'll be addressed in the March render update. I can fudge it with z position for now anyway.
    Just glad to get rid of another hybrid component finally.
     
    Antypodish likes this.
  4. 5argon

    5argon

    Joined:
    Jun 10, 2013
    Posts:
    1,081
    Ooh where did they say this "The March render update"? Any roadmap plan about ECS appeared somewhere?
     
  5. jooleanlogic

    jooleanlogic

    Joined:
    Mar 1, 2018
    Posts:
    244
    No roadmap (tiko), just this.
     
    5argon and Antypodish like this.
  6. davenirline

    davenirline

    Joined:
    Jul 7, 2010
    Posts:
    399
    I made my own sprite renderer that can still use sorting layers and what not. What I did is I maintained my own mesh, then feed that mesh to GameObject that has MeshRenderer. This way, I can still make use of sorting layers and the like.

    I had that problem before and I just can't wait for Unity to provide a fix. This hack works for me, for now.
     
  7. jooleanlogic

    jooleanlogic

    Joined:
    Mar 1, 2018
    Posts:
    244
    I don't know enough about rendering to understand that but it sounds good. :)
    The point for me in using RenderMesh is to get rid of GameObject though.
    I switched to RenderMesh to test but perf took a nose dive because I lost all the batching I was getting with sprites and atlases.
    Maybe there's a work around for that but it's not pressing for me atm so I can wait and hope that Unity provides a solution before I need to.