Material
A Material defines surface appearance through a combination of diffuse, specular, normal, emission, and alpha components. These values are specified using a JSON schema called Fabric which gets parsed and assembled into glsl shader code behind-the-scenes. Check out the wiki page for more details on Fabric.
Base material types and their uniforms:
// Create a color material with fromType:
polygon.material = Material.fromType('Color');
polygon.material.uniforms.color = new Color(1.0, 1.0, 0.0, 1.0);
// Create the default material:
polygon.material = new Material();
// Create a color material with full Fabric notation:
polygon.material = new Material({
fabric: {
type: 'Color',
uniforms: {
color: new Color(1.0, 1.0, 0.0, 1.0)
}
}
});Content copied to clipboard
See also
Types
Properties
Link copied to clipboard
The TextureMagnificationFilter to apply to this material's textures.
Link copied to clipboard
The TextureMinificationFilter to apply to this material's textures.
Link copied to clipboard
The glsl shader source for this material.
Link copied to clipboard
When true or a function that returns true, the geometry is expected to appear translucent.