Material Instances

From HEWIKI
(Difference between revisions)
Jump to: navigation, search
(Serialization Format)
Line 1: Line 1:
{{tocright}}
+
{{tocright}}  
  
== Overview ==
+
== Overview ==
An [[asset]] is a template from which things in the game world are made. An asset instance is an object with a unique ID number, created from an asset. Areas are mainly populated with asset instances instantiated from the [[Asset Library]]. Assets own meshes.
+
  
A mesh is a single set of geometry, and a reference to the material which it uses. There may be multiple meshes in a model -- for example, a barrel of apples may consist of a mesh for the wooden barrel and a mesh for the pile of apples.
+
An [[Asset]] is a template from which things in the game world are made. An asset instance is an object with a unique ID number, created from an asset. Areas are mainly populated with asset instances instantiated from the [[Asset Library]]. Assets own meshes.  
  
A [[material]] is a set of textures with defined roles (such as diffuse, normal/specular and macro) and associated properties. A material instance a unique combination of material properties which can be applied to one or more asset meshes. Material Instance Properties can be customized using the [[Material Instance Properties]] dialogue.
+
A mesh is a single set of geometry, and a reference to the material which it uses. There may be multiple meshes in a model -- for example, a barrel of apples may consist of a mesh for the wooden barrel and a mesh for the pile of apples.  
  
== Serialization Format ==
+
A [[Material]] is a set of textures with defined roles (such as diffuse, normal/specular and macro) and associated properties. A material instance a unique combination of material properties which can be applied to one or more asset meshes. Material Instance Properties can be customized using the [[Material Instance Properties]] dialogue.  
Changes made through the Material Instance Properties dialogue are represented in a serialized override string. Values which differ from the base material appear in the string within the _MaterialOverrides property field in the [[Properties Panel]].
+
  
The serialization format is as follows.
+
== Serialization Format  ==
  
<code>
+
Changes made through the Material Instance Properties dialogue are represented in a serialized override string. Values which differ from the base material appear in the string within the _MaterialOverrides property field in the [[Properties Panel]].
<serialization format version number> % <instance name> # <hash string for this material instance> [ <diffuse map path>,<diffuse map alpha type>,<normal map path>,<normal map contains specular channel>,<macro map path>,<macro map UV multiplier>,<shader map path>,<shader translucency>,<shader reflectivity>,<texture address mode U>,<texture address mode V>,<polygon attributes>,<animated UVs U1>,<animated UVs V1>,<animated UVs U2>,<animated UVs V2>]
+
</code>
+
  
Here is an example of a material override string after changing the diffuse map path. Note that some values are empty and others contain default enumerations which are set by the system.
+
The serialization format is as follows.  
  
<code>0%mushroom_demo6#82b311bfb05255ae1e9822a0c49b3aab[/techart/hill/grannyexport/textures/orange_utility.dds,1,,,,1,,0,0,1,1,1,0,0,0,0]</code>
+
<code>&lt;serialization format version number&gt;&nbsp;% &lt;instance name&gt; # &lt;hash string for this material instance&gt; [ &lt;diffuse map path&gt;,&lt;diffuse map alpha type&gt;,&lt;normal map path&gt;,&lt;normal map contains specular channel&gt;,&lt;macro map path&gt;,&lt;macro map UV multiplier&gt;,&lt;shader map path&gt;,&lt;shader translucency&gt;,&lt;shader reflectivity&gt;,&lt;texture address mode U&gt;,&lt;texture address mode V&gt;,&lt;polygon attributes&gt;,&lt;animated UVs U1&gt;,&lt;animated UVs V1&gt;,&lt;animated UVs U2&gt;,&lt;animated UVs V2&gt;] </code>
 +
 
 +
Here is an example of a material override string after changing the diffuse map path. Note that some values are empty and others contain default enumerations which are set by the system.
 +
 
 +
<code>0%mushroom_demo6#82b311bfb05255ae1e9822a0c49b3aab[/techart/hill/grannyexport/textures/orange_utility.dds,1,,,,1,,0,0,1,1,1,0,0,0,0][[Image:MaterialInstancePropertiesDialogueExample.png|right]]</code>  
  
 
== An Example ==
 
== An Example ==

Revision as of 20:04, 2 November 2012

Contents

Overview

An Asset is a template from which things in the game world are made. An asset instance is an object with a unique ID number, created from an asset. Areas are mainly populated with asset instances instantiated from the Asset Library. Assets own meshes.

A mesh is a single set of geometry, and a reference to the material which it uses. There may be multiple meshes in a model -- for example, a barrel of apples may consist of a mesh for the wooden barrel and a mesh for the pile of apples.

A Material is a set of textures with defined roles (such as diffuse, normal/specular and macro) and associated properties. A material instance a unique combination of material properties which can be applied to one or more asset meshes. Material Instance Properties can be customized using the Material Instance Properties dialogue.

Serialization Format

Changes made through the Material Instance Properties dialogue are represented in a serialized override string. Values which differ from the base material appear in the string within the _MaterialOverrides property field in the Properties Panel.

The serialization format is as follows.

<serialization format version number> % <instance name> # <hash string for this material instance> [ <diffuse map path>,<diffuse map alpha type>,<normal map path>,<normal map contains specular channel>,<macro map path>,<macro map UV multiplier>,<shader map path>,<shader translucency>,<shader reflectivity>,<texture address mode U>,<texture address mode V>,<polygon attributes>,<animated UVs U1>,<animated UVs V1>,<animated UVs U2>,<animated UVs V2>]

Here is an example of a material override string after changing the diffuse map path. Note that some values are empty and others contain default enumerations which are set by the system.

0%mushroom_demo6#82b311bfb05255ae1e9822a0c49b3aab[/techart/hill/grannyexport/textures/orange_utility.dds,1,,,,1,,0,0,1,1,1,0,0,0,0]
MaterialInstancePropertiesDialogueExample.png

An Example

Personal tools
Namespaces
Variants
Actions
Navigation
Toolbox