Search Unity

  1. Unity Asset Manager is now available in public beta. Try it out now and join the conversation here in the forums.
    Dismiss Notice
  2. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  3. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Access Shader Properties from ShaderGraph by script.

Discussion in 'Graphics Experimental Previews' started by Spy-Shifty, Apr 17, 2018.

  1. Spy-Shifty

    Spy-Shifty

    Joined:
    May 5, 2011
    Posts:
    546
    Hi,

    do you plan some mecanism to create shader that we can manipulat by script?

    Well, with ShaderGraph you can define properties, but the internal name is some generic stuff.

    E.g. Name: DiffuseMap -> internal Name: Texture_CD6DDEE1 or something like that.

    Will you provide a way or handle this case, so that we can access the DiffuseMap by script?
    Code (CSharp):
    1. Material.SetTexture("_DiffuseMap", myTexture);
     
  2. eizenhorn

    eizenhorn

    Joined:
    Oct 17, 2016
    Posts:
    2,683
    +1, Are there any progress in this direction?
     
  3. Spy-Shifty

    Spy-Shifty

    Joined:
    May 5, 2011
    Posts:
    546
  4. eizenhorn

    eizenhorn

    Joined:
    Oct 17, 2016
    Posts:
    2,683