Documentation

Classes

Class CL3D.Material

Material description, usually for a MeshBuffer.

Class Overview
CL3D.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 backface culling is enabled for the material.
 
Specifies if the texture wrapping is enabled or not for Texture 1.
<static>  
CL3D.Material.EMT_LIGHTMAP
Lightmapped material, constant for using in Material.Type, specifying the type of the material.
<static>  
CL3D.Material.EMT_NORMAL_MAP_SOLID
Normal mapped material.
<static>  
CL3D.Material.EMT_REFLECTION_2_LAYER
Reflective material for creating metallic looking survaces, constant for using in Material.Type, specifying the type of the material.
<static>  
CL3D.Material.EMT_SOLID
Solid material, constant for using in Material.Type, specifying the type of the material.
<static>  
Solid material, blends based on vertex alpha between the two set textures.
<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.
<static>  
Transparent material based on the texture alpha channel, constant for using in Material.Type, specifying the type of the material.
<static>  
Like EMT_TRANSPARENT_ALPHA_CHANNEL_REF but moves by the wind, like for moving grass or leaves.
<static>  
Transparent reflective material for creating metallic looking survaces, constant for using in Material.Type, specifying the type of the material.
 
Specifies if lighting is enabled for 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 does not use the depth map by default.
 
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} BackfaceCulling
Specifies if backface culling is enabled for the material. Default is true.

{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> CL3D.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> CL3D.Material.EMT_NORMAL_MAP_SOLID
Normal mapped material. Expects tangents and binormals to be existing in the mesh buffer, they are usually precalculated by the CopperCube editor. There should be 2 textures: The first texture layer is a diffuse map, the second is the normal map.

<static> CL3D.Material.EMT_REFLECTION_2_LAYER
Reflective material for creating metallic looking survaces, 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 the refleced surface.

<static> CL3D.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> CL3D.Material.EMT_SOLID_VERTEX_ALPHA_TWO_TEXTURE_BLEND
Solid material, blends based on vertex alpha between the two set textures. Used for terrain rendering.

<static> CL3D.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> CL3D.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

<static> CL3D.Material.EMT_TRANSPARENT_ALPHA_CHANNEL_REF
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. If the alpha value is < 0.5, the pixel is discarded.

<static> CL3D.Material.EMT_TRANSPARENT_ALPHA_CHANNEL_REF_MOVING_GRASS
Like EMT_TRANSPARENT_ALPHA_CHANNEL_REF but moves by the wind, like for moving grass or leaves.

<static> CL3D.Material.EMT_TRANSPARENT_REFLECTION_2_LAYER
Transparent reflective material for creating metallic looking survaces, 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 including an alpha channel for transparency, the second is the refleced surface.

{Boolean} Lighting
Specifies if lighting is enabled for the material. Default is false.

{.} 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()

doesNotUseDepthMap()
Returns true if the described material does not use the depth map by default.

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

© 2011-2018 N.Gebhardt, Ambiera
Documentation generated by JsDoc Toolkit