Editing Material

Jump to: navigation, search

Warning: The database has been locked for maintenance, so you will not be able to save your edits right now. You may wish to copy and paste your text into a text file and save it for later.

The administrator who locked it offered this explanation: Server migration

The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit.
Latest revision Your text
Line 6: Line 6:
 
|
 
|
 
  material
 
  material
   name <u>example_material</u>
+
   name example_material
 
   texture filename
 
   texture filename
 
   addtexture filename
 
   addtexture filename
Line 21: Line 21:
 
   shininess 0.0
 
   shininess 0.0
 
   resetmat
 
   resetmat
  spheremap
 
  noradar
 
  noshadow
 
  noculling
 
  nosorting
 
  nolighting
 
  alphathresh 0.0
 
  groupalpha
 
  occluder
 
 
  end
 
  end
 
|}
 
|}
 
Valid parameters for a Material are:
 
Valid parameters for a Material are:
{|{{Prettytable}}
+
<properties>
|-
+
name=name for reference
| {{Hl3}} |'''Parameter'''
+
texture=set the texture (must be .png but don't include the extension)
| {{Hl3}} |'''Description'''
+
addtexture=add a texture (again, no extension is needed)
|-
+
notextures=don't use textures.
| '''name''' || name for reference.
+
notexcolor=don't apply the [[Color(BZW)|color]] to the texture
|-
+
notexalpha=don't use the texture's alpha channel
| '''texture''' || set the texture (must be .png but don't include the extension unless on the Internet).
+
texmat=specify a [[TextureMatrix|texture matrix]]. -1 for no texture matrix. (addtexture must be used before texmat)
|-
+
dyncol=specify a [[DynamicColor|dynamic color]]. -1 for no dynamic color.
| '''addtexture''' || add a texture (again, no extension is needed).
+
ambient=ambient color
|-
+
diffuse=diffuse (main)[[Color(BZW)|color]]
| '''notextures''' || don't use textures.
+
[[Color(BZW)|color]]=synonym for diffuse
|-
+
specular=specular [[Color(BZW)|color]]
| '''notexcolor''' || don't apply the [[Color(BZW)|color]] to the texture.
+
emission=emission [[Color(BZW)|color]]
|-
+
shininess=shiny!
| '''notexalpha''' || don't use the texture's alpha channel.
+
resetmat=restore default values
|-
+
</properties>
| '''texmat''' || specify a [[TextureMatrix|texture matrix]]. -1 for no texture matrix. (addtexture must be used before texmat).
+
|-
+
| '''dyncol''' || specify a [[DynamicColor|dynamic color]]. -1 for no dynamic color.
+
|-
+
| '''ambient''' || ambient color.
+
|-
+
| '''diffuse''' || diffuse (main)[[Color(BZW)|color]].
+
|-
+
| '''[[Color(BZW)|color]]''' || synonym for diffuse.
+
|-
+
| '''specular''' || specular [[Color(BZW)|color]].
+
|-
+
| '''emission''' || emission [[Color(BZW)|color]].
+
|-
+
| '''shininess''' || shiny!.
+
|-
+
| '''resetmat''' || restore default values.
+
|-
+
| '''spheremap''' || use spherical texture coordinate mapping.
+
|-
+
| '''noradar''' || do not display on radar (except normal mode).
+
|-
+
| '''noshadow''' || do not render shadows.
+
|-
+
| '''noculling''' || do not cull by face winding (double-sided).
+
|-
+
| '''nosorting''' || do not do front-to-back alpha sorting.
+
|-
+
| '''nolighting''' || disable lighting.
+
|-
+
| '''alphathresh''' || alpha thresholding value.
+
|-
+
| '''groupalpha''' || sort translucent faces as a group.
+
|-
+
| '''occluder''' || faces with this material will occlude.
+
|}
+
 
+
 
To actually apply a material, you must use some sort of reference in an object, like so:
 
To actually apply a material, you must use some sort of reference in an object, like so:
 
{|
 
{|
Line 94: Line 48:
 
   rotation 0
 
   rotation 0
 
   size 10 10 5
 
   size 10 10 5
    
+
   matref example_material
  # refer to the previously defined material with its particular name we gave it before
+
  # compare underlined text in the code at the [[#Code|page top]]
+
  '''matref <u>example_material</u>'''
+
 
  end
 
  end
 
|}
 
|}
Please note the ''matref'' is the '''name''' of the defined material, not the name of the .png/url file!
 
 
==Translucency==
 
Material translucency is enabled by setting the alpha component of a material's [[Color(BZW)|color]] to a value less than one. Translucent objects should be sparingly, because everything behind them must always be rendered. In addition, very large translucent objects may be sorted and drawn in the wrong order. This is caused by the fact that the Z-buffer cannot be used because it would allow another translucent object to cover the translucent object, which would not look right. Thus, the translucent elements are instead sorted by determining the distance to a point in the center, which works well as long as there are not too many large translucent objects.
 
The same applies to textures that have translucent sections.
 
 
  
 +
==Transparency==
 +
The transparency effect is created by setting the alpha component of a material's [[Color(BZW)|color]] to a value less than one.
 +
Transparent objects should be sparingly, because everything behind them must always be rendered. In addition, very large transparent objects may be sorted and drawn in the wrong order. This is caused by the fact that the Z-buffer cannot be used because it would allow another transparent object to cover the transparent object, which would not look right. Thus, the transparent elements are instead sorted by determining the distance to a point in the center, which works well as long as there are not too many large transparent objects.
 +
The same applies to textures that have transparent sections.
  
 
==Magic Material Names==
 
==Magic Material Names==
 
===General===
 
===General===
* [[GroundMaterial]]
+
[[GroundMaterial]]<br>
* WaterMaterial
+
WaterMaterial<br>
* [[LinkMaterial]] For Teleporter Links
+
LinkMaterial  (for teleporters)
  
===[[Skybox]]===
+
===Skybox===
* LeftSkyboxMaterial
+
[[LeftSkyboxMaterial]]<br>
* RightSkyboxMaterial
+
[[RightSkyboxMaterial]]<br>
* FrontSkyboxMaterial
+
[[FrontSkyboxMaterial]]<br>
* BackSkyboxMaterial
+
[[BackSkyboxMaterial]]<br>
* TopSkyboxMaterial
+
[[TopSkyboxMaterial]]<br>
* BottomSkyboxMaterial
+
[[BottomSkyboxMaterial]]<br>
  
 
==History==
 
==History==
Line 126: Line 75:
  
 
==Editor Support==
 
==Editor Support==
Materials are supported in [[Blender]] with [[BZWTools]], [[pyBZEdit]], and [[Wings3D]]. Materials are NOT supported in [[BZEdit]], [[BZFed]] or IBZEdit.
+
Materials are supported in [[Blender]] with [[BZWTools]], [[pyBZEdit]], and [[Wings3D]] with the [[BZW Exporter for Wings3D]]. Materials are NOT supported in [[BZEdit]] or [[BZFed]].
  
 
==A note about textures==
 
==A note about textures==

Please note that all contributions to BZFlagWiki may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see BZFlagWiki:Copyrights for details). Do not submit copyrighted work without permission!

To edit this page, please answer the question that appears below (more info):

Cancel | Editing help (opens in new window)

Templates used on this page: