This wiki is archived and useful information is being migrated to the main bzflag.org website

Difference between revisions of "Material"

From BZFlagWiki
Jump to: navigation, search
m (Fixed meshbox link)
m (formatting)
Line 7: Line 7:
 
  material
 
  material
 
   name example_material
 
   name example_material
   texture filename # set the texture (don't use PNG extension)
+
   texture filename
   addtexture filename # add a texture (again, no PNG extension)
+
   addtexture filename
   notextures # don't use textures.
+
   notextures
   notexcolor # don't apply the color to the texture
+
   notexcolor
   notexalpha # don't use the texture's alpha channel
+
   notexalpha
   texmat -1 # specify a texture matrix. -1 for no texture matrix.
+
   texmat -1
   dyncol -1 # specify a dynamic color. -1 for no dynamic color.
+
   dyncol -1
   ambient 0.0 0.0 0.0 1.0 # ambient color
+
   ambient 0.0 0.0 0.0 1.0
   diffuse 1.0 1.0 1.0 1.0 # diffuse (main) color
+
   diffuse 1.0 1.0 1.0 1.0
   color 1.0 1.0 1.0 1.0 # synonym for diffuse
+
   color 1.0 1.0 1.0 1.0
   specular 0.0 0.0 0.0 1.0 # specular color
+
   specular 0.0 0.0 0.0 1.0
   emission 0.0 0.0 0.0 1.0 # emission color
+
   emission 0.0 0.0 0.0 1.0
   shininess 0.0 # shiny!
+
   shininess 0.0
   resetmat # restore default values
+
   resetmat
 
  end
 
  end
 
|}
 
|}
 +
Valid parameters for a Material are:
 +
*'''name''': name for reference
 +
*'''texture''': set the texture (don't use PNG extension)
 +
*'''addtexture''': add a texture (again, no PNG extension)
 +
*'''notextures''': don't use textures.
 +
*'''notexcolor''': don't apply the color to the texture
 +
*'''notexalpha''': don't use the texture's alpha channel
 +
*'''texmat''': specify a texture matrix. -1 for no texture matrix.
 +
*'''dyncol''': specify a dynamic color. -1 for no dynamic color.
 +
*'''ambient''': ambient color
 +
*'''diffuse''': diffuse (main) color
 +
*'''color''': synonym for diffuse
 +
*'''specular''': specular color
 +
*'''emission''': emission color
 +
*'''shininess''': shiny!
 +
*'''resetmat''': restore default values
  
 
To actually apply a texture, you must use some sort of reference in an object, like so:
 
To actually apply a texture, you must use some sort of reference in an object, like so:

Revision as of 01:23, 24 March 2007

A material is used in a BZFlag world to define a new look for otherwise regular objects, such as meshboxes.

Code

To put a material in your map, first it must be defined:

material
 name example_material
 texture filename
 addtexture filename
 notextures
 notexcolor
 notexalpha
 texmat -1
 dyncol -1
 ambient 0.0 0.0 0.0 1.0
 diffuse 1.0 1.0 1.0 1.0
 color 1.0 1.0 1.0 1.0
 specular 0.0 0.0 0.0 1.0
 emission 0.0 0.0 0.0 1.0
 shininess 0.0
 resetmat
end

Valid parameters for a Material are:

  • name: name for reference
  • texture: set the texture (don't use PNG extension)
  • addtexture: add a texture (again, no PNG extension)
  • notextures: don't use textures.
  • notexcolor: don't apply the color to the texture
  • notexalpha: don't use the texture's alpha channel
  • texmat: specify a texture matrix. -1 for no texture matrix.
  • dyncol: specify a dynamic color. -1 for no dynamic color.
  • ambient: ambient color
  • diffuse: diffuse (main) color
  • color: synonym for diffuse
  • specular: specular color
  • emission: emission color
  • shininess: shiny!
  • resetmat: restore default values

To actually apply a texture, you must use some sort of reference in an object, like so:

meshbox
 position 0 0 10
 rotation 0
 size 10 10 5
 matref example_material
end

History

Materials were added in BZFlag 2.0.0.

Editor Support

Materials are supported in Blender with BZWTools, pyBZEdit, and Wings3D with the BZW Exporter for Wings3D. Materials are NOT supported in BZEdit or BZFed.