diff --git a/docs/api/materials/Material.html b/docs/api/materials/Material.html index fca3fc3f868cb026a46e932ab7f167c1350f7f11..5ca1d3e4c39dae10305c43e7ad69583b35efb578 100644 --- a/docs/api/materials/Material.html +++ b/docs/api/materials/Material.html @@ -10,8 +10,15 @@

[name]

-
Materials describe the appearance of [page:Object objects]. They are defined in a (mostly) renderer-independent way, so you don't have to rewrite materials if you decide to use a different renderer.
- +
+

+ Materials describe the appearance of [page:Object objects]. + They are defined in a (mostly) renderer-independent way, so you don't have to rewrite materials if you decide to use a different renderer. +

+

+ With the exception of [page:MultiMaterial MultiMaterial], the following properties and methods are inherited by all other material types (although they may have different defaults). +

+

Constructor

@@ -34,55 +41,96 @@ Material name. Default is an empty string. +

[property:String type]

+
+ Value is the string 'Material'. This shouldn't be changed, and can be used to find all objects of this type in a scene. +
+ +

[property:Boolean fog]

+
+ Whether the material is affected by fog. Default is *true*. +
+ +

[property:Boolean lights]

+
+ Whether the material is affected by lights. Default is *true*. +
+ +

[property:Integer side]

+
+ Defines which side of faces will be rendered - front, back or both. + Default is [page:Materials THREE.FrontSide]. + Other options are [page:Materials THREE.BackSide] and [page:Materials THREE.DoubleSide]. +
+ +

[property:Integer shading]

+
+ Defines how the material is shaded. + This can be either [page:Materials THREE.SmoothShading] (default) or [page:Materials THREE.FlatShading]. +
+ +

[property:Integer vertexColors]

+
+ Defines whether vertex coloring is used. + Default is [page:Materials THREE.NoColors]. + Other options are [page:Materials THREE.VertexColors] and [page:Materials THREE.FaceColors]. +
+

[property:Float opacity]

- Float in the range of 0.0 - 1.0 indicating how transparent the material is. - A value of 0.0 indicates fully transparent, 1.0 is fully opaque. If - *transparent* is not set to true for the material, the material will remain - fully opaque and this value will only affect its color. + Float in the range of *0.0* - *1.0* indicating how transparent the material is. + A value of *0.0* indicates fully transparent, *1.0* is fully opaque.
+ If the material's [property:Boolean transparent] property is not set to *true*, the material will remain + fully opaque and this value will only affect its color.
+ Default is *1.0*.
-
Default is *1.0*.

[property:Boolean transparent]

Defines whether this material is transparent. This has an effect on rendering - as transparent objects need special treatment and are rendered after - non-transparent objects. For a working example of this behaviour, check the - [page:WebGLRenderer WebGLRenderer] code.
+ as transparent objects need special treatment and are rendered after + non-transparent objects.
When set to true, the extent to which the material is transparent is - controlled by setting *opacity*. + controlled by setting it's [property:Float opacity] property.
+ Default is *false*.
-
Default is *false*.

[property:Blending blending]

- Which blending to use when displaying objects with this material. Default is [page:Materials NormalBlending]. See the blending mode [page:Materials constants] for all possible values. - + Which blending to use when displaying objects with this material.
+ This must be set to [page:Materials CustomBlending] to use custom [property:Constant blendSrc], [property:Constant blendDst] or [property:Constant blendEquation].
+ See the blending mode [page:Materials constants] for all possible values. Default is [page:Materials NormalBlending].

[property:Integer blendSrc]

- Blending source. It's one of the blending mode constants defined in Three.js. Default is [page:CustomBlendingEquation SrcAlphaFactor]. See the destination factors [page:CustomBlendingEquation constants] for all possible values. + Blending source. Default is [page:CustomBlendingEquation SrcAlphaFactor]. + See the source factors [page:CustomBlendingEquation constants] for all possible values.
+ The material's [property:Constant blending] must be set to [page:Materials CustomBlending] for this to have any effect.

[property:Integer blendDst]

- Blending destination. It's one of the blending mode constants defined in [page:Three Three.js]. Default is [page:CustomBlendingEquation OneMinusSrcAlphaFactor]. + Blending destination. Default is [page:CustomBlendingEquation OneMinusSrcAlphaFactor]. + See the destination factors [page:CustomBlendingEquation constants] for all possible values.
+ The material's [property:Constant blending] must be set to [page:Materials CustomBlending] for this to have any effect.

[property:Integer blendEquation]

- Blending equation to use when applying blending. It's one of the constants defined in [page:Three Three.js]. Default is [page:CustomBlendingEquation AddEquation.] + Blending equation to use when applying blending. Default is [page:CustomBlendingEquation AddEquation]. + See the blending equation [page:CustomBlendingEquation constants] for all possible values.
+ The material's [property:Constant blending] must be set to [page:Materials CustomBlending] for this to have any effect.
-

[property:Boolean depthTest]

+

[property:Integer depthFunc]

- Whether to have depth test enabled when rendering this material. Default is *true*. + Which depth function to use. Default is [page:Materials LessEqualDepth]. See the depth mode [page:Materials constants] for all possible values.
-

[property:Integer depthFunc]

+

[property:Boolean depthTest]

- What depth function to use. Default is [page:Materials THREE.LessEqualDepth]. + Whether to have depth test enabled when rendering this material. Default is *true*.

[property:Boolean depthWrite]

@@ -93,91 +141,118 @@ When drawing 2D overlays it can be useful to disable the depth writing in order to layer several things together without creating z-index artifacts. -

[property:Boolean polygonOffset]

+

[property:Array clippingPlanes]

- Whether to use polygon offset. Default is *false*. This corresponds to the *POLYGON_OFFSET_FILL* WebGL feature. + User-defined clipping planes specified as THREE.Plane objects in world space. + These planes apply to the objects this material is attached to. + Points in space whose dot product with the plane is negative are cut away. + See the [example:webgl_clipping_intersection WebGL / clipping /intersection] example. + Default is *null*.
-

[property:Integer polygonOffsetFactor]

+

[property:Boolean clipIntersection]

- Sets the polygon offset factor. Default is *0*. + Changes the behavior of clipping planes so that only their intersection is clipped, rather than their union. + Default is *false*.
-

[property:Integer polygonOffsetUnits]

+

[property:Boolean clipShadows]

- Sets the polygon offset units. Default is *0*. + Defines whether to clip shadows according to the clipping planes specified on this material. Default is *false*.
-

[property:Number alphaTest]

+

[property:Boolean colorWrite]

- Sets the alpha value to be used when running an alpha test. Default is *0*. + Whether to render the material's color. + This can be used in conjunction with a mesh's [property:Integer renderOrder] property to create invisible objects that occlude other objects. Default is *true*.
-

[property:Array clippingPlanes]

- +

[property:String precision]

- User-defined clipping planes specified as THREE.Plane objects in world space. These planes apply to the objects this material is attached to. Points in space whose dot product with the plane is negative are cut away. Default is null. + Override the renderer's default precision for this material. Can be "*highp*", "*mediump*" or "*lowp*". + Defaults for the WebGLRenderer is "*highp*" if supported by the device.
-

[property:Boolean clipIntersection]

- -
Changes the behavior of clipping planes so that only their intersection is clipped, rather than their union. Default is false. See example
+

[property:Boolean polygonOffset]

+
+ Whether to use polygon offset. Default is *false*. This corresponds to the *GL_POLYGON_OFFSET_FILL* WebGL feature. +
-

[property:Boolean clipShadows]

+

[property:Integer polygonOffsetFactor]

- Defines whether to clip shadows according to the clipping planes specified on this material. Default is false. + Sets the polygon offset factor. Default is *0*.
-

[property:Float overdraw]

+

[property:Integer polygonOffsetUnits]

- Amount of triangle expansion at draw time. This is a workaround for cases when gaps appear between triangles when using [page:CanvasRenderer]. *0.5* tends to give good results across browsers. Default is *0*. + Sets the polygon offset units. Default is *0*.
-

[property:Boolean visible]

+

[property:Float alphaTest]

- Defines whether this material is visible. Default is *true*. + Sets the alpha value to be used when running an alpha test. + The material will not be renderered if the opacity is lower than this value. + Default is *0*.
-

[property:Enum side]

+

[property:Boolean premultipliedAlpha]

- Defines which of the face sides will be rendered - front, back or both. + Whether to premultiply the alpha (transparency) value. + See [Example:webgl_materials_transparency WebGL / Materials / Transparency] for an example of the difference. + Default is *false*.
+ +

[property:Float overdraw]

- Default is [page:Materials THREE.FrontSide]. Other options are [page:Materials THREE.BackSide] and [page:Materials THREE.DoubleSide]. + Amount of triangle expansion at draw time. + This is a workaround for cases when gaps appear between triangles when using [page:CanvasRenderer]. + *0.5* tends to give good results across browsers. Default is *0*.
-

[property:Boolean needsUpdate]

+

[property:Boolean visible]

- Specifies that the material needs to be updated at the WebGL level. Set it to true if you made changes that need to be reflected in WebGL. + Defines whether this material is visible. Default is *true*.
+ +

[property:Boolean needsUpdate]

+ Specifies that the material needs to be updated at the WebGL level. + Set it to true if you made changes that need to be reflected in WebGL.
This property is automatically set to *true* when instancing a new material.
- +

Methods

- +

[page:EventDispatcher EventDispatcher] methods are available on this class.

- -

[method:Material clone]( [page:material material] )

+ +

[method:null setValues]( [page:object values] )

- material -- this material gets the cloned information (optional). + values -- a container with parameters.
+ Sets the properties based on the *values*.
+ +

[method:null toJSON]( [page:object meta] )

- This clones the material in the optional parameter and returns it. + meta -- object containing metadata such as textures or images for the material.
+ Convert the material to Three JSON format.
-

[method:null dispose]()

+

[method:Material clone]( [page:material material] )

- This disposes the material. Textures of a material don't get disposed. These needs to be disposed by [page:Texture Texture]. + material -- this material gets the cloned information (optional).
+ This clones the material in the optional parameter and returns it.
-

[method:null setValues]( [page:object values] )

+

[method:null update]()

- values -- a container with parameters. + Call [method:null dispatchEvent]( { type: '[page:object update]' }) on the material.
+ +

[method:null dispose]()

- Sets the properties based on the *values*. + This disposes the material. Textures of a material don't get disposed. + These needs to be disposed by [page:Texture Texture].

Source