Search Unity

Enable keyword for changing material's shader texture?

Discussion in 'Shaders' started by WilkinsMicawber, Feb 10, 2016.

  1. WilkinsMicawber

    WilkinsMicawber

    Joined:
    Jan 22, 2016
    Posts:
    27
    I'm trying to display a texture on a material using the standard shader. As far as I know, I need to use an enable keyword in my script to do so. What is the enable keyword for this feature? Is there a list of such keywords?
     
  2. thefranke

    thefranke

    Unity Technologies

    Joined:
    Jun 20, 2015
    Posts:
    153
    Hey WilkinsMicawber,

    do you specifically want to set the texture via a script? Or do you just want to have a textured material?

    Cheers
     
  3. WilkinsMicawber

    WilkinsMicawber

    Joined:
    Jan 22, 2016
    Posts:
    27
    I want to set a texture via script. I am able to do so with the deprecated unlit texture shader but can't with the standard shader.
     
  4. Zuntatos

    Zuntatos

    Joined:
    Nov 18, 2012
    Posts:
    612
    Are you talking about using Material.SetTexture("_MainTex", texture)? Or are you talking about Shader.EnableKeyword ("Some keyword")? Or are you maybe talking about a decal like structure, like displaying blood splatters on the ground?