Search Unity

Feedback HDRP materials & shader property setting in code

Discussion in 'High Definition Render Pipeline' started by andyz, Feb 22, 2022.

  1. andyz

    andyz

    Joined:
    Jan 5, 2010
    Posts:
    2,269
    I find the property handling quite poor in HDRP - unless I am missing something...

    1. First is the provided materials do not expose the property names in an easy way (do they?).
    You can edit the shader on a material to get the list of reference names!

    2. Property name versus reference name is a little confused - even Unity seem unsure if they should just be the same - look at the inconsistency in the default Lit Shader - _Metallic("_Metallic" where name has underscore, then _Smoothness("Smoothness" etc where no underscore on name! But the actual name is same as reference name, just inconsistency on underscore use

    3. Create a new lit shader graph and you are not given a full Lit graph to start with, including properties named the same as the default material - this would be super helpful to have and avoid a bunch of initial setup - when is it coming?

    It is almost as if Unity do not expect us to set property values in code or have any consistency in naming between graphs/materials, which is not good.
     
    Qleenie likes this.
  2. Qleenie

    Qleenie

    Joined:
    Jan 27, 2019
    Posts:
    867
    All very good points and things I also had difficulties in the past. I guess offering lit shader as a template with same names would solve most of these issues. There’s some project on GitHub from a Unity dev who tried a near 1:1 shader graph version of lit shader, but it has never been updated, and has a few differences to the original.
     
    andyz likes this.
  3. Qleenie

    Qleenie

    Joined:
    Jan 27, 2019
    Posts:
    867
    I think this is the one:
    https://github.com/RemyUnity/SG-HDRP-Lit