Search Unity

Feature Request Plans to allow shader properties to be set per-material?

Discussion in 'Shader Graph' started by dgoyette, Aug 11, 2019.

  1. dgoyette

    dgoyette

    Joined:
    Jul 1, 2016
    Posts:
    1,864
    When lokoing at the Lit shader, there are a number of options that can be adjusted, such as whether Alpha Clipping is supported. But this is property is a checkbox on the master node itself, and I don't see any way to toggle this on a per-material basis.

    Are there any plans to support basing some of these properties on inputs defined on the shader? Right now, if I need a shader to work both ways, I need to duplicate the shader just to toggle this checkbox.

    upload_2019-8-11_17-49-19.png
     
  2. zhuchun

    zhuchun

    Joined:
    Aug 11, 2012
    Posts:
    379
    They're doing it as you can see a few options have been exposed, alpha clipping and many others should not be far away as well. However, I suspect that they come with the cost of shader variants. After upgrading to Unity2019.2, my game's building time has been increased significantly(5->30min), especially shader stripping time. Exposing more options could lead to more variants, perhaps Unity should find a way to solve this before exposing them, otherwise, those types of games that need to be compiled very often during development, say multiplayer game, would not be feasible anymore on Unity.
     
  3. dgoyette

    dgoyette

    Joined:
    Jul 1, 2016
    Posts:
    1,864
    Encouraging and concerning at the same time. I'm planning to update to 2019.2 next week, so hopefully I don't experience the same pain... But it's good to see that some of the options are making it into per-material settings.
     
  4. zhuchun

    zhuchun

    Joined:
    Aug 11, 2012
    Posts:
    379
    Since you mentioned, there're 2 issues are kicking our asses so maybe you could test and evaluate if 2019.2.0 fits your project.
    1. Build time increased from 5 mins to 25mins
    2. We're using Transport package, aka Unity Multiplayer, which seems to refuse the second client to connect, that's weird and we're trying to figure it out, but the first issue makes this extremely hard.