How to write a Material File

From Iris2

Jump to: navigation, search
(Editing the File)
(Import the materia-templates.material)
 
Line 1: Line 1:
=Editing the File=
=Editing the File=
-
Open a file and rename it to the name of the material in your mesh file. For example basefloortile.material for the respective basefloortile.mesh.
+
==Import the materia-templates.material==
 +
 
 +
Open a file and rename it to the name of the material in your mesh file. For example "basefloortile.material" for the "respective basefloortile.mesh".
Begin the file with the following file without the slashes. The slashes are normally for comments.
Begin the file with the following file without the slashes. The slashes are normally for comments.
-
<code>import * from "material-templates.material"</code>
+
<pre>import * from "material-templates.material"</pre>
This will import the templates and the artist does not have to type very much.
This will import the templates and the artist does not have to type very much.
 +
==Defining the Template and Texture==
-
----
+
Then type this and replace the "diffuse_template" with your chosen template and "tex_basefloortile.png" with the texture which you want to use.
 +
<pre>
 +
material basefloortile : diffuse_template
 +
{
 +
  set_texture_alias ambient_tex tex_basefloortile.png
 +
  set_texture_alias diffuse_tex tex_basefloortile.png
 +
}
 +
</pre>
-
Then type this and replace the "diffuse_template" with your chosen template and "tex_basefloortile.png" with the texture which you want to use.
+
Diffuse is the texture for normal light and ambient is what happens if there is no light.
 +
=Templates=
-
<code>
+
==diffuse_template==
-
material basefloortile : diffuse_template
+
-
{
+
For normal Tiles without transparency but still having their own shadow.
-
set_texture_alias ambient_tex tex_basefloortile.png
+
==diffuse_template_alpha==
-
set_texture_alias diffuse_tex tex_basefloortile.png
+
This is good for tiles with transparent textures but still having shadows.
-
}
+
:Advantage: Does not need a lot of performance
 +
:Disadvantage Not so nice frames and is good for everything with transparency
-
</code>
+
==diffuse_template_sceneblend==
-
=Templates=
+
You can take that if the object should not have shadows but still is alpha transparent.
 +
 
 +
: Advantage: It has very nice frames. Good for grasses.
 +
: Disadvantage: No real "Tiefensortierung". It is only apparent if you look at it and another mesh also having sceneblend.
 +
 
 +
==diffuse_template_foliage==
 +
 
 +
For objects having models and is alpha transparent.
 +
 
 +
: Advantage: Object has shadows
 +
: Disadvantage: Object unfortunately does not have nice frames. Good for flowers and trees.Objekt hat nicht so schöne Ränder (geeignet für Blumen oder Bäume)
 +
 
 +
=Beware=
 +
 
 +
To test the meshes, material and texture by taking a look on it with the help of [http://www.ogre3d.org/tikiwiki/Ogre+Meshy Ogre Meshy]. You have to copy the "material-templates.material" in the same folder.
 +
 
 +
=Links=
 +
 
 +
[http://www.ogre3d.org/tikiwiki/Materials Tutorials]

Current revision as of 16:01, 19 December 2011

Personal tools