## Documentation

- Overview
- Website
- Tutorials
- Class Index

## Classes

- _global_
- CL3D
- CL3D.AnimatedMeshSceneNode
- CL3D.Animator
- CL3D.AnimatorAnimateTexture
- CL3D.AnimatorCameraFPS
- CL3D.AnimatorCameraModelViewer
- CL3D.AnimatorCollisionResponse
- CL3D.AnimatorFlyCircle
- CL3D.AnimatorFlyStraight
- CL3D.AnimatorFollowPath
- CL3D.AnimatorOnClick
- CL3D.AnimatorOnProximity
- CL3D.AnimatorRotation
- CL3D.BillboardSceneNode
- CL3D.BoundingBoxTriangleSelector
- CL3D.Box3d
- CL3D.CameraSceneNode
- CL3D.ColorF
- CL3D.CopperCubeVariable
- CL3D.CopperLicht
- CL3D.CubeSceneNode
- CL3D.HotspotSceneNode
- CL3D.Light
- CL3D.LightSceneNode
- CL3D.Line3d
- CL3D.Material
- CL3D.Matrix4
- CL3D.Mesh
- CL3D.MeshBuffer
- CL3D.MeshSceneNode
- CL3D.MeshTriangleSelector
- CL3D.MetaTriangleSelector
- CL3D.Mobile2DInputSceneNode
- CL3D.OctTreeTriangleSelector
- CL3D.Overlay2DSceneNode
- CL3D.ParticleSystemSceneNode
- CL3D.PathSceneNode
- CL3D.Plane3d
- CL3D.Quaternion
- CL3D.Renderer
- CL3D.Scene
- CL3D.SceneNode
- CL3D.SkyBoxSceneNode
- CL3D.SoundSceneNode
- CL3D.TerrainSceneNode
- CL3D.Texture
- CL3D.TextureManager
- CL3D.Triangle3d
- CL3D.TriangleSelector
- CL3D.Vect2d
- CL3D.Vect3d
- CL3D.Vertex3D
- CL3D.WaterSurfaceSceneNode

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 Summary
Field Attributes | Field Name and Description
--- | ---
| BackfaceCulling Specifies if backface culling is enabled for the material.
| ClampTexture1 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> | CL3D.Material.EMT_SOLID_VERTEX_ALPHA_TWO_TEXTURE_BLEND Solid material, blends based on vertex alpha between the two set textures.
<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_ALPHA_CHANNEL_REF 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_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.
| Lighting Specifies if lighting is enabled for the material.
| Tex1 Texture 1 of this material of type Texture.
| Tex2 Texture 2 of this material of type Texture.
| Type Type of the material.
| ZReadEnabled Specifies if the material is allowed to read from the ZBuffer (DepthTest)
| ZWriteEnabled Specifies if the material is allowed to write into the ZBuffer

Method Summary
Method Attributes | Method Name and Description
--- | ---
| 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)

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