Search Unity

  1. Unity 2019.2 is now released.
    Dismiss Notice

[Request] Layer field in MeshInstanceRenderer

Discussion in 'Data Oriented Technology Stack' started by KillHour, Sep 21, 2018.

  1. KillHour

    KillHour

    Joined:
    Oct 25, 2015
    Posts:
    22
    Is there a particular reason that the default MeshInstanceRenderer is hardcoded to use layer 0 instead of having a field for it? I have to render to different layers, which means I need to keep a special version of the component and system with minor changes up to date with the built-in code. It would be trivial to support (just an additional field in the component and change the call to DrawMeshedInstanced to reference the field). If it's about the overhead of having another int in the component, it could always be put into a separate optional component for the system.
     
    tbg10101_ likes this.
  2. tbg10101_

    tbg10101_

    Joined:
    Mar 13, 2011
    Posts:
    143
    +1 for this request. I have to make this 2-line change every time I update. (add the layer to the component then read the value in the system)
     
    Last edited: Oct 28, 2018
  3. tbg10101_

    tbg10101_

    Joined:
    Mar 13, 2011
    Posts:
    143
    Any response from Unity on this?

    This issue is even worse when using the latest version of the Package Manager because my changes to the package that adds support for layers are reverted whenever I restart Unity.
     
  4. tertle

    tertle

    Joined:
    Jan 25, 2011
    Posts:
    1,854
    MeshInstanceRendererSystem is really just a placeholder at the moment while Unity rewrites everything. It's missing a lot of features that'll be added back in eventually.

    For now though, I suggest using your own version of the system rather than modifying the package. It'll take under 5 minutes and save you a lot of pain in the long run.

    Just copy source, edit it as you need then in the startup set the existing system Enabled to false.