How to write a Material File

From Iris2

Jump to: navigation, search
Line 1: Line 1:
Material Templates
Material Templates
 +
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.
-
// see http://www.ogre3d.org/docs/manual/manual_28.html#SEC145
+
Begin the file with the following file without the slashes. The slashes are normally for comments.
-
 
+
-
// can be used by
+
// import * from "material-templates.material"
// import * from "material-templates.material"
-
// --------------- THESE ARE THE ATLAS STANDARD MATERIALS ----------------------
+
This will import the templates and the artist does not have to type very much.
-
 
+
-
// MESH BASE MATERIAL TEMPLATE
+
-
 
+
-
material atlas_base
+
-
 
+
-
{
+
-
receive_shadows off
+
-
 
+
-
technique default
+
-
 
+
-
{
+
-
pass
+
-
 
+
-
{
+
-
lighting on
+
-
 
+
-
ambient vertexcolour
+
-
 
+
-
diffuse vertexcolour
+
-
+
-
texture_unit MainTexture
+
-
{
+
-
filtering anisotropic
+
-
 
+
-
max_anisotropy 8
+
-
 
+
-
texture checker.png
+
-
 
+
-
texture_alias MainTexture
+
-
 
+
-
tex_address_mode clamp
+
-
}
+
-
}
+
-
}
+
-
}
+
-
 
+
-
// MESH BASE ALPHA MATERIAL TEMPLATE
+
-
 
+
-
material atlas_base_alpha : atlas_base
+
-
 
+
-
{
+
-
technique default
+
-
 
+
-
{
+
-
pass Decal
+
-
 
+
-
{
+
-
lighting on
+
-
 
+
-
ambient vertexcolour
+
-
 
+
-
diffuse vertexcolour
+
-
 
+
-
alpha_rejection greater_equal 128
+
-
 
+
-
alpha_to_coverage on
+
-
 
+
-
}
+
-
 
+
-
}
+
-
 
+
-
}
+
-
 
+
-
// --------------- THESE ARE THE STANDARD NON-ATLAS MATERIALS ----------------------
+
-
 
+
-
material diffuse_template
+
-
 
+
-
{
+
-
 
+
-
receive_shadows off
+
-
 
+
-
technique default
+
-
 
+
-
{
+
-
 
+
-
pass Decal
+
-
 
+
-
{
+
-
lighting on
+
-
 
+
-
ambient vertexcolour
+
-
 
+
-
diffuse vertexcolour
+
-
+
-
texture_unit
+
-
 
+
-
{
+
-
filtering anisotropic
+
-
 
+
-
max_anisotropy 8
+
-
 
+
-
texture checker.png
+
-
 
+
-
texture_alias diffuse_tex
+
-
 
+
-
tex_address_mode clamp
+
-
 
+
-
}
+
-
 
+
-
}
+
-
 
+
-
}
+
-
 
+
-
}
+
-
 
+
-
// MESH BASE ALPHA MATERIAL TEMPLATE
+
-
 
+
-
material diffuse_template_alpha : diffuse_template
+
-
 
+
-
{
+
-
 
+
-
technique default
+
-
 
+
-
{
+
-
 
+
-
pass Decal
+
-
 
+
-
{
+
-
 
+
-
lighting on
+
-
 
+
-
ambient vertexcolour
+
-
 
+
-
diffuse vertexcolour
+
-
 
+
-
alpha_rejection greater_equal 128
+
-
 
+
-
alpha_to_coverage on
+
-
 
+
-
}
+
-
 
+
-
}
+
-
 
+
-
}
+
-
 
+
-
material diffuse_template_foliage : diffuse_template
+
-
 
+
-
{
+
-
 
+
-
technique default
+
-
 
+
-
{
+
-
pass Decal
+
-
{
+
-
lighting on
+
-
 
+
-
ambient vertexcolour
+
-
diffuse vertexcolour
+
-
 
+
-
cull_hardware none
+
-
cull_software none
+
-
+
-
alpha_rejection greater_equal 128
+
-
alpha_to_coverage on
+
-
 
+
-
texture_unit
+
-
{
+
-
filtering anisotropic
+
-
max_anisotropy 8
+
-
texture checker.png
+
-
texture_alias diffuse_tex
+
-
tex_address_mode wrap
+
-
}
+
-
}
+
-
}
+
-
}
+
-
 
+
-
material diffuse_template_sceneblend : diffuse_template
+
-
{
+
-
technique default
+
-
{
+
-
pass Decal
+
-
{
+
-
lighting on
+
-
 
+
-
ambient vertexcolour
+
-
diffuse vertexcolour
+
-
 
+
-
cull_hardware none
+
-
cull_software none
+
-
 
+
-
scene_blend alpha_blend
+
-
depth_write off
+
-
depth_check on
+
-
}
+
-
}
+
-
}
+

Revision as of 09:17, 3 December 2011

Personal tools