Search Unity

where is the api for the HDRP materials?

Discussion in 'Scripting' started by SparrowGS, Jun 24, 2019.

  1. SparrowGS

    SparrowGS

    Joined:
    Apr 6, 2017
    Posts:
    2,536
    I'm trying to change material properties in script, all the old code I used doesn't throw any errors, but doesn't do anything.

    I'm trying to look it up for the past half hour, but I can't find anything, the docs are still about the normal renderer from what I see.

    how do you change the emission for example? this doesn't do it anymore, as I expected.
    Code (CSharp):
    1. material.SetColor ("_EmissionColor", color );
     
  2. dgoyette

    dgoyette

    Joined:
    Jul 1, 2016
    Posts:
    4,195
    It's _EmissiveColor.

    I don't know if there's up to date docs on this for HDRP yet, but you can easily inspect the properties available to the shader. Select the material, then in the Gear menu, choose Select Shader:

    upload_2019-6-24_0-21-9.png

    This will show something like this:

    upload_2019-6-24_0-21-56.png

    The list will show the different properties you can set.
     
    SparrowGS likes this.
  3. SparrowGS

    SparrowGS

    Joined:
    Apr 6, 2017
    Posts:
    2,536
    Derp, how didn't I thought about name changes, I got carried away by the new UI and led myself to believe it's like the particle system modules now.