Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Question Extremely frustrating: Material "Surface options" not changing when shader changes

Discussion in 'Shader Graph' started by dgoyette, Jun 9, 2020.

  1. dgoyette

    dgoyette

    Joined:
    Jul 1, 2016
    Posts:
    4,120
    I don't know if this is due to Shader Graph, or HDRP. But as of 2019.3 (possible 2019.2, I didn't use it), the way these material Surface Options work is very frustrating:

    upload_2020-6-9_11-27-41.png

    Basically, these values are set when the material is created, and the material "remembers" these values forever. If I later change the shader (for example, I change the shader from Opaque to Transarent), this material will not change to transparent. It will remain Opaque. This is annoying for a number of reasons:
    • If I'm fiddling with a shader, it means I need to go manually update all of the materials that use it before I see the result of the shader change.
    • It's not obvious. Create a shader, create a material, edit shader: Sorry, your material didn't change as you expected it to.
    • It doesn't work like other Unity override conventions, like prefabs. I wouldn't mind this feature if I could explicitly override these surface options the way prefab properties are overridden on variants. But these sticky defaults are something new, and not in a good way.
    Anyway, maybe I'm missing something really great about the fact that these exist. But I just wasted a lot of time trying to understand why one of my materials was set to transparent (in the shader), but it wasn't rendering with transparency. Couldn't you make these things overrides, like how prefabs work?
     

    Attached Files:

  2. slims

    slims

    Joined:
    Dec 31, 2013
    Posts:
    86
    Bump because this is hugely frustrating. I just updated a shader's surface options, and this shader is used by hundreds of my prefabs. Updating all of them will be a nightmare.

    Unity 2022.2.14f1
     
    Last edited: Apr 8, 2023
  3. Ruchir

    Ruchir

    Joined:
    May 26, 2015
    Posts:
    927
    Not a solution, but a workaround could be using material variants in the new unity versions; you could lock the material properties you want in the parent material and not worry about changing them for all the inherited materials.