Constructor
new BasicMaterial()
Properties:
Name | Type | Description |
---|---|---|
color |
pc.Color | The flat color of the material (RGBA, where each component is 0 to 1). |
colorMap |
pc.Texture | The color map of the material. If specified, the color map is modulated by the color property. |
- Source:
Example
// Create a new Basic material
var material = new pc.BasicMaterial();
// Set the material to have a texture map that is multiplied by a red color
material.color.set(1, 0, 0);
material.colorMap = diffuseMap;
// Notify the material that it has been modified
material.update();
Extends
Methods
clone() → {pc.BasicMaterial}
Duplicates a Basic material. All properties are duplicated except textures
where only the references are copied.
- Source:
Returns:
A cloned Basic material.
- Type
- pc.BasicMaterial
deleteParameter(name)
Deletes a shader parameter on a material.
Parameters:
Name | Type | Description |
---|---|---|
name |
String | The name of the parameter to delete. |
- Inherited From:
- Source:
destroy()
Removes this material from the scene and possibly frees up memory from its shaders (if there are no other materials using it).
- Inherited From:
- Source:
getParameter(name) → {Object}
Retrieves the specified shader parameter from a material.
Parameters:
Name | Type | Description |
---|---|---|
name |
String | The name of the parameter to query. |
- Inherited From:
- Source:
Returns:
The named parameter.
- Type
- Object
setParameter(name, data, passFlagsopt)
Sets a shader parameter on a material.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
name |
String | The name of the parameter to set. | |
data |
Number | Array | pc.Texture | The value for the specified parameter. | |
passFlags |
Number |
<optional> |
Mask describing which passes the material should be included in. |
- Inherited From:
- Source:
setParameters()
Pushes all material parameters into scope.
- Inherited From:
- Source:
update()
Applies any changes made to the material's properties.
- Inherited From:
- Source: