Unity Community


Results 1 to 3 of 3

  1. Posts
    217

    All of the named properties of a Material

    Hello,

    I'm trying to account for all possible textures, properties, etc. of a material for a save/load function.

    So far, from the scripting doc I've found that there are:
    • Textures
      • _MainTex
      • _BumpMap
      • _Cube
    • Colors
      • _Color
      • _SpecColor
      • _Emission
      • _ReflectColor
    • Floats
      • _Shininess


    Is that it?
    Last edited by scone; 02-07-2011 at 07:02 PM. Reason: _MainTex not _MainTexture =\

  2. Unity tech writer

    Location
    Blackpool, United Kingdom
    Posts
    8,696
    You can define any number of properties in a shader but these are just some common names that Unity provides shortcuts for. However, you can get/set properties with any names using the GetXXX/SetXXX functions of the Material class (for example, GetFloat gets any given float property by name).
    I'm wired to the world... that's how I... know... everything...


  3. Posts
    217
    Quote Originally Posted by andeeee View Post
    You can define any number of properties in a shader but these are just some common names that Unity provides shortcuts for. However, you can get/set properties with any names using the GetXXX/SetXXX functions of the Material class (for example, GetFloat gets any given float property by name).
    Thanks for the info. Specifically, I was wondering if people could help me fill out that list. For example what is the name for the texture channel of self-illuminating shaders? Is the source for the standard Unity shaders available, so that I can see what these properties are called?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •