CopperLicht API Documentation
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 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_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> |
CL3D.Material.EMT_TRANSPARENT_ADD_COLOR
Transparent additive material, constant for using in Material.Type, specifying the type of the material.
|
<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.
|
<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.
|
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 Attributes | Method Name and Description |
---|---|
clone()
|
|
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_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_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_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()
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