Documentation

Classes

Class Material

Material description, usually for a MeshBuffer.

Class Overview
Material()
Structure describing a material with a couple of textures and several settings. Simply create an instance of the material class and set the Type value to one of the known material types or an own material type, created for example with CopperLicht.createMaterialType.

Field Summary
Field Attributes Field Name and Description
 
Specifies if the texture wrapping is enabled or not for Texture 1.
<static>  
Material.EMT_LIGHTMAP
Lightmapped material, constant for using in Material.Type, specifying the type of the material.
<static>  
Material.EMT_SOLID
Solid material, constant for using in Material.Type, specifying the type of the material.
<static>  
Transparent additive material, constant for using in Material.Type, specifying the type of the material.
<static>  
Transparent material based on the texture alpha channel, constant for using in Material.Type, specifying the type of the material.
 
Texture 1 of this material of type Texture.
 
Texture 2 of this material of type Texture.
 
Type of the material.
 
Specifies if the material is allowed to read from the ZBuffer (DepthTest)
 
Specifies if the material is allowed to write into the ZBuffer
Method Summary
Method Attributes Method Name and Description
 
 
Returns true if the described material is transparent, used by SceneNodes to check if they need to register for rendering in transparent or solid mode.
 
setFrom(mat)
Field Detail
{Boolean} ClampTexture1
Specifies if the texture wrapping is enabled or not for Texture 1. In OpenGL terms, this simply sets TEXTURE_WRAP to REPEAT or CLAMP_TO_EDGE

<static> Material.EMT_LIGHTMAP
Lightmapped material, constant for using in Material.Type, specifying the type of the material. There should be 2 textures: The first texture layer is a diffuse map, the second is a light map. This is the standard lightmap technique: The lightmap is multiplied onto the first texture.

<static> Material.EMT_SOLID
Solid material, constant for using in Material.Type, specifying the type of the material. Simply a single texture shown as diffuse material.

<static> Material.EMT_TRANSPARENT_ADD_COLOR
Transparent additive material, constant for using in Material.Type, specifying the type of the material. Only the first texture is used. The new color is calculated by simply adding the source color and the destination color. This means if for example a billboard using a texture with black background and a red circle on it is drawn with this material, the result is that only the red circle will be drawn a little bit transparent, and everything which was black is 100% transparent and not visible.

<static> Material.EMT_TRANSPARENT_ALPHA_CHANNEL
Transparent material based on the texture alpha channel, constant for using in Material.Type, specifying the type of the material. The final color is blended together from the destination color and the texture color, using the alpha channel value as blend factor. Only first texture is used

{.} Tex1
Texture 1 of this material of type Texture.

{.} Tex2
Texture 2 of this material of type Texture.

{Number} Type
Type of the material. Default value is Material.EMT_SOLID. You can set any value of the predefined materials to this type, or even create your own material types using Renderer.createMaterialType.

{Boolean} ZReadEnabled
Specifies if the material is allowed to read from the ZBuffer (DepthTest)

{Boolean} ZWriteEnabled
Specifies if the material is allowed to write into the ZBuffer
Method Detail
clone()

isTransparent()
Returns true if the described material is transparent, used by SceneNodes to check if they need to register for rendering in transparent or solid mode.

setFrom(mat)
Parameters:
mat

© 2010 N.Gebhardt, Ambiera
Documentation generated by JsDoc Toolkit