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. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice

Resolved MaterialPropertyAttribute / Hybrid Instancing stopped working in 2022.2.2f1

Discussion in 'Graphics for ECS' started by Thygrrr, Jan 13, 2023.

  1. Thygrrr

    Thygrrr

    Joined:
    Sep 23, 2013
    Posts:
    673
    Just upgraded to 2022.2.2f1, the following attributes, among others, don't work anymore.
    I think all hybrid instancing has gone kaput or now requires some unknown extra step / compiler switch / dark ritual.

    Any ideas? :eek: It works well in 2022.2.1f1. (just confirmed, all of these do)

    Code (CSharp):
    1.     [MaterialProperty("_Highlight")]
    2.     public struct Highlight : IComponentData
    3.     {
    4.         public float value;
    5.     }
    6.  
    7.     [MaterialProperty("_Hover")]
    8.     public struct Hover : IComponentData
    9.     {
    10.         public float value;
    11.     }
    12.  
    13.     [MaterialProperty("_FillColor")]
    14.     public struct InstanceColor : IComponentData
    15.     {
    16.         public Color value;
    17.     }
    18.  
    19.     [MaterialProperty("_TextureIndex")]
    20.     public struct TextureIndex : IComponentData
    21.     {
    22.         public float value;
    23.     }
    24.  
    25.     [MaterialProperty("_maxScale")]
    26.     public struct ScaleBoost : IComponentData
    27.     {
    28.         public float value;
    29.     }
    30.  
     
  2. JussiKnuuttila

    JussiKnuuttila

    Unity Technologies

    Joined:
    Jun 7, 2019
    Posts:
    335
    Are you using Shader Graphs by any chance? There is a known regression bug with material property overrides with Shader Graphs which we are trying to get fixed ASAP.
     
    Chmyke and Thygrrr like this.
  3. Thygrrr

    Thygrrr

    Joined:
    Sep 23, 2013
    Posts:
    673
    Thanks for the reply - yes, these are all used by Shader Graphs and Material Variants. (but it's the same URP version?)

    Either way if you could get that into the Known Issues section of the 2022.2.2 changelog, that would be amazing. :) https://unity.com/releases/editor/whats-new/2022.2.2

    And... you're implying there's a way to use these without ShaderGraph? That would be massively useful to know how... still not a lot of documentation on how to write URP and even less on writing Hybrid Renderer / SRP Batchable shaders by hand to be found. :( Do you have a pointer where I can look?
     
  4. JussiKnuuttila

    JussiKnuuttila

    Unity Technologies

    Joined:
    Jun 7, 2019
    Posts:
    335
    Thygrrr likes this.
  5. Thygrrr

    Thygrrr

    Joined:
    Sep 23, 2013
    Posts:
    673
    Much appreciated, thank you! :)
     
  6. Occuros

    Occuros

    Joined:
    Sep 4, 2018
    Posts:
    288
    Has this been fixed in the latest release (2022.3.6f1)?
     
  7. JussiKnuuttila

    JussiKnuuttila

    Unity Technologies

    Joined:
    Jun 7, 2019
    Posts:
    335
    Yes, this should be fixed in current versions.
     
    Occuros likes this.