Material

Uses XML Tag mm:material and contains…

Tag Type Description
[class] string Class extension. This is required if no source prototype was supplied
name string A name is required.
textures mm:texture[?] List of textures.
brushes mm:brush[1+] List of brushes. Must have at least one.
technique mm:technique[1+] List of techniques. Must have at least one.

Example:

<mm:material>
   <class>MyMaterial</class>
   <name>MyMaterial</name>
   <textures>
      <mm:texture uri=“*/Textures:grid.tga”/>
      <mm:texture uri=“*/Textures:flat.tga”/>
   </textures>
   <brushes>
      <mm:brush>[...]</mm:brush>
   </brushes>
   <techniques>
      <mm:technique>[...]</mm:technique>
      <mm:technique>[...]</mm:technique>
   </techniques>
</mm:material>

Brush uses XML Tag mm:brush and contains…

Tag Type Description
[name] string A name is required only when the brush is not parented.
[specular] float Specular highlight value. If not supplied, the default is 0.5.
[shininess] float Shininess value. If not supplied, the default is 10.0.
[stages] mm:texturestage[?] List of texture stages (described below). Must match the number of textures in brush’s parent material.
[shader] mm:shader Companion shader for this brush. Defaults to simple shader or fixed function pipeline.

Example:

<mm:brush>
   <specular>0.75</specular>
   <shininess>15.0</shininess>
   <stages>
      <mm:texturestage>[...]</mm:texturestage>
      <mm:texturestage>[...]</mm:texturestage>
   </stages>
   <mm:shader>
      <name>MyShader</name>
      <nshadows>2</nshadows>
      <vshaders>
         <mm:vertexshader uri=“*/Shaders:MyVS.vert”/>
      </vshaders>
      <fshaders>
         <mm:fragmentshader uri=“*/Shaders:Common.frag”/>
         <mm:fragmentshader uri=“*/Shaders:MyFS.frag”/>
      </fshaders>
   </mm:shader>
</mm:brush>

TextureStage uses XML Tag mm:texturestage and contains…

Tag Type Description
texid integer Id that matches this stage to a texture in the parent material.
[flags] integer Flags describing the texture application.
[coords] integer Mapping coordinate set to use in this stage.
[blend] integer Blend value determines how this texture blends with the previous layer (if any).
[wrapu] integer Horizontal wrapping method (in U).
[wrapv] integer Vertical wrapping method (in V).
[matrixfn] integer Matrix function index. Used for animation, lighting, etc.

Example:

<mm:texturestage>
   <texid>0</texid>
   <flags>9</flags>
   <coords>0</coords>
   <blend>2</blend>
   <wrapu>0</wrapu>
   <wrapv>0</wrapv>
   <matrixfn>0</matrixfn>
</mm:texturestage>

Technique uses XML Tag mm:technique and contains…

Tag Type Description
[name] integer A name is optional.
[brushes] integer[?] Brush index used in each pass.
[blends] integer[?] Blend function used in each pass.
[options] integer[?] Additional options used in each pass.

Example:

<mm:technique>
   <name>Opaque</name>
   <brushes>0</brushes>
   <blends>0</blends>
   <options>0</options>
</mm:technique>