Table Of Contents

Previous topic

21.28. The LoadingScreen Object

Next topic

21.30. The MathDeviceConvert Object

This Page

21.29. The Material Object

The Material object defines the appearance of a rendered object. It has a TechniqueParameters property and a meta property for additional information used by the renderers.

Required scripts

The Material object requires:

/*{{ javascript("jslib/material.js") }}*/
/*{{ javascript("jslib/utilities.js") }}*/

21.29.1. Constructor

21.29.1.1. create

Summary

Creates and returns a Material object.

Syntax

var material = Material.create(graphicsDevice);
graphicsDevice
The GraphicsDevice object to be used.

21.29.2. Methods

21.29.2.1. clone

Summary

Create a clone of the material.

Syntax

var clonedMaterial = originalMaterial.clone(graphicsDevice);
clonedMaterial.techniqueParameters.materialColor = mathDevice.v4Build(1.0, 0.0, 0.0. 1.0);
graphicsDevice
The GraphicsDevice object to be used.

Returns a Material object.

21.29.2.2. getName

Summary

Gets the name of the material.

Syntax

var name = Material.getName();

21.29.3. Properties

21.29.3.1. techniqueParameters

Summary

The TechniqueParameters object.

Syntax

material.techniqueParameters.materialColor = color;

21.29.3.2. meta

Summary

The meta object. See the rendering documentation for valid values.

Syntax

material.meta.transparent = true;