Search Unity

Feedback "Reserved" parameter names are frustrating

Discussion in 'Shader Graph' started by dgoyette, Jul 31, 2020.

  1. dgoyette

    dgoyette

    Joined:
    Jul 1, 2016
    Posts:
    4,195
    I submitted case #1246356 a while back. The issue was that because I chose to name a ShaderGraph color property exactly "_EmissionColor", I was no longer able to edit that color. Changing it to _EmissionColorX" (or anything else) fixed the issue. I received this response on the bug:

    There are several problems with this.
    • There's nothing in the UI telling me that I've used a reserved work. The Shader Graph UI doesn't show me anything, and there's nothing in the Inspector when editing the material to tell me that the field has a problem. The only indication I get is that the color will always stay black, even as I pick a different color for it.
    • More importantly, it's very annoying that I'm not allowed to use the same property names on a shader that HDRP (or whatever RP) is using. Consider the following use case: A material is using one shader, when some event occurs causing the material to switch to a different shader. Or maybe I just switch from the Lit shader to my shader in the editor. If the property names are consistent between the two shaders, the new shader just works. There's no need to reassign any property values to the material. But if I'm not allowed to use some of the basic HDRP keywords in my own shaders, I have to do extra stuff. I really want to keep my shaders consistent.
     
    Last edited: Jul 31, 2020
    cultureulterior likes this.
  2. alexanderameye

    alexanderameye

    Joined:
    Nov 27, 2013
    Posts:
    1,383
    Yup, a clear list of them or an indicator would be nice
     
  3. Korindian

    Korindian

    Joined:
    Jun 25, 2013
    Posts:
    584
    Just ran into this same problem with _EmissionColor, when changes to that property wouldn't stay. The Shader Graph UI should indicate when using a reserved keyword, so we know that it will be a problem.