[page:Material] →

[name]

A material for a use with a [page:Sprite].

Examples

[example:webgl_sprites WebGL / sprites]
[example:software_sandbox software / sandbox]
[example:svg_sandbox svg / sandbox]
[example:webgl_materials_cubemap_dynamic webgl / materials / cubemap / dynamic]
var spriteMap = new v3d.TextureLoader().load('textures/sprite.png'); var spriteMaterial = new v3d.SpriteMaterial({ map: spriteMap, color: 0xffffff }); var sprite = new v3d.Sprite(spriteMaterial); sprite.scale.set(200, 200, 1) scene.add(sprite);

[name]([param:Object parameters])

[page:Object parameters] - (optional) an object with one or more properties defining the material's appearance. Any property of the material (including any property inherited from [page:Material]) can be passed in here.

The exception is the property [page:Hexadecimal color], which can be passed in as a hexadecimal string and is *0xffffff* (white) by default. [page:Color.set](color) is called internally. SpriteMaterials are not clipped by using [page:Material.clippingPlanes].

Properties

See the base [page:Material] class for common properties.

[property:Color color]

[page:Color] of the material, by default set to white (0xffffff). The [page:.map] is mutiplied by the color.

[property:boolean fog]

Whether or not this material affected by the scene's fog. Default is false

[property:Boolean lights]

Whether the material is affected by lights. Default is *false*.

[property:Texture map]

The texture map. Default is null.

[property:Radians rotation]

The rotation of the sprite in radians. Default is 0.

[property:Boolean sizeAttenuation]

Whether the size of the sprite is attenuated by the camera depth. (Perspective camera only.) Default is *true*.

Methods

See the base [page:Material] class for common methods.

[sourceHint]