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

Question Material Block Property in rendermesh

Discussion in 'Graphics for ECS' started by Stroustrup, Jun 8, 2020.

  1. Stroustrup

    Stroustrup

    Joined:
    May 18, 2020
    Posts:
    142
    anyone got any idea how you would access the material block property?

    like dots equivalent of meshRenderer.GetPropertyBlock(...) or something
     
  2. wg-siggig

    wg-siggig

    Joined:
    Mar 17, 2020
    Posts:
    36
  3. Stroustrup

    Stroustrup

    Joined:
    May 18, 2020
    Posts:
    142
    how would you do something like this though?

    Code (CSharp):
    1. MaterialPropertyBlock materialPropertyBlock = new MaterialPropertyBlock();
    2. materialPropertyBlock.CopyProbeOcclusionArrayFrom(...);
    3. materialPropertyBlock.CopySHCoefficientArraysFrom(...);

    guessing something like this?

    Code (CSharp):
    1. [Serializable]
    2. [MaterialProperty("_OclusionProbes", MaterialPropertyFormat.Float4)]
    3. public struct : IBufferElementData
    4. {
    5.     public float4 Value;
    6. }
    doesn't seem like it would be stored as a property
     
  4. wg-siggig

    wg-siggig

    Joined:
    Mar 17, 2020
    Posts:
    36
    I don't know about those features, I thought you only meant how to pass params to the shader. Sorry :)