Search Unity

  1. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice
  2. Unity is excited to announce that we will be collaborating with TheXPlace for a summer game jam from June 13 - June 19. Learn more.
    Dismiss Notice
  3. Dismiss Notice

SpriteRenderer in ECS

Discussion in 'Graphics for ECS' started by JooleanLogic, Feb 8, 2019.

  1. JooleanLogic

    JooleanLogic

    Joined:
    Mar 1, 2018
    Posts:
    447
    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?
     
    defic and foxnne like this.
  2. Antypodish

    Antypodish

    Joined:
    Apr 29, 2014
    Posts:
    10,819
    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:
    447
    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,556
    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:
    447
    No roadmap (tiko), just this.
     
    5argon and Antypodish like this.
  6. davenirline

    davenirline

    Joined:
    Jul 7, 2010
    Posts:
    1,001
    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:
    447
    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.
     
  8. leppryt

    leppryt

    Joined:
    Jul 28, 2017
    Posts:
    3
    On your sprite material, change your shader to Legacy Shaders/Transparent/Diffuse. Then enable GPU instancing.
     
  9. FabrizioSpadaro

    FabrizioSpadaro

    Joined:
    Jul 10, 2012
    Posts:
    287
    Eristen, li1028568, MaxPirat and 4 others like this.