|
@@ -10,7 +10,7 @@
|
|
<body>
|
|
<body>
|
|
<h1>[name]</h1>
|
|
<h1>[name]</h1>
|
|
|
|
|
|
- <div class="desc">
|
|
|
|
|
|
+ <p class="desc">
|
|
Abstract base class for materials.<br /><br />
|
|
Abstract base class for materials.<br /><br />
|
|
|
|
|
|
Materials describe the appearance of [page:Object objects].
|
|
Materials describe the appearance of [page:Object objects].
|
|
@@ -19,202 +19,202 @@
|
|
|
|
|
|
The following properties and methods are inherited by all other material types
|
|
The following properties and methods are inherited by all other material types
|
|
(although they may have different defaults).
|
|
(although they may have different defaults).
|
|
- </div>
|
|
|
|
|
|
+ </p>
|
|
|
|
|
|
<h2>Constructor</h2>
|
|
<h2>Constructor</h2>
|
|
|
|
|
|
|
|
|
|
<h3>[name]()</h3>
|
|
<h3>[name]()</h3>
|
|
- <div>This creates a generic material.</div>
|
|
|
|
|
|
+ <p>This creates a generic material.</p>
|
|
|
|
|
|
|
|
|
|
<h2>Properties</h2>
|
|
<h2>Properties</h2>
|
|
|
|
|
|
<h3>[property:Float alphaTest]</h3>
|
|
<h3>[property:Float alphaTest]</h3>
|
|
- <div>
|
|
|
|
|
|
+ <p>
|
|
Sets the alpha value to be used when running an alpha test.
|
|
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.
|
|
The material will not be renderered if the opacity is lower than this value.
|
|
Default is *0*.
|
|
Default is *0*.
|
|
- </div>
|
|
|
|
|
|
+ </p>
|
|
|
|
|
|
<h3>[property:Integer blendDst]</h3>
|
|
<h3>[property:Integer blendDst]</h3>
|
|
- <div>
|
|
|
|
|
|
+ <p>
|
|
Blending destination. Default is [page:CustomBlendingEquation OneMinusSrcAlphaFactor].
|
|
Blending destination. Default is [page:CustomBlendingEquation OneMinusSrcAlphaFactor].
|
|
See the destination factors [page:CustomBlendingEquation constants] for all possible values.<br />
|
|
See the destination factors [page:CustomBlendingEquation constants] for all possible values.<br />
|
|
The material's [property:Constant blending] must be set to [page:Materials CustomBlending] for this to have any effect.
|
|
The material's [property:Constant blending] must be set to [page:Materials CustomBlending] for this to have any effect.
|
|
- </div>
|
|
|
|
|
|
+ </p>
|
|
|
|
|
|
<h3>[property:Integer blendDstAlpha]</h3>
|
|
<h3>[property:Integer blendDstAlpha]</h3>
|
|
- <div>The transparency of the [page:.blendDst]. Default is *null*.</div>
|
|
|
|
|
|
+ <p>The transparency of the [page:.blendDst]. Default is *null*.</p>
|
|
|
|
|
|
<h3>[property:Integer blendEquation]</h3>
|
|
<h3>[property:Integer blendEquation]</h3>
|
|
- <div>
|
|
|
|
|
|
+ <p>
|
|
Blending equation to use when applying blending. 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.<br />
|
|
See the blending equation [page:CustomBlendingEquation constants] for all possible values.<br />
|
|
The material's [property:Constant blending] must be set to [page:Materials CustomBlending] for this to have any effect.
|
|
The material's [property:Constant blending] must be set to [page:Materials CustomBlending] for this to have any effect.
|
|
- </div>
|
|
|
|
|
|
+ </p>
|
|
|
|
|
|
<h3>[property:Integer blendEquationAlpha]</h3>
|
|
<h3>[property:Integer blendEquationAlpha]</h3>
|
|
- <div>The tranparency of the [page:.blendEquation]. Default is *null*.</div>
|
|
|
|
|
|
+ <p>The tranparency of the [page:.blendEquation]. Default is *null*.</p>
|
|
|
|
|
|
<h3>[property:Blending blending]</h3>
|
|
<h3>[property:Blending blending]</h3>
|
|
- <div>
|
|
|
|
|
|
+ <p>
|
|
Which blending to use when displaying objects with this material. <br />
|
|
Which blending to use when displaying objects with this material. <br />
|
|
This must be set to [page:Materials CustomBlending] to use custom [property:Constant blendSrc], [property:Constant blendDst] or [property:Constant blendEquation].<br />
|
|
This must be set to [page:Materials CustomBlending] to use custom [property:Constant blendSrc], [property:Constant blendDst] or [property:Constant blendEquation].<br />
|
|
See the blending mode [page:Materials constants] for all possible values. Default is [page:Materials NormalBlending].
|
|
See the blending mode [page:Materials constants] for all possible values. Default is [page:Materials NormalBlending].
|
|
- </div>
|
|
|
|
|
|
+ </p>
|
|
|
|
|
|
<h3>[property:Integer blendSrc]</h3>
|
|
<h3>[property:Integer blendSrc]</h3>
|
|
- <div>
|
|
|
|
|
|
+ <p>
|
|
Blending source. Default is [page:CustomBlendingEquation SrcAlphaFactor].
|
|
Blending source. Default is [page:CustomBlendingEquation SrcAlphaFactor].
|
|
See the source factors [page:CustomBlendingEquation constants] for all possible values.<br />
|
|
See the source factors [page:CustomBlendingEquation constants] for all possible values.<br />
|
|
The material's [property:Constant blending] must be set to [page:Materials CustomBlending] for this to have any effect.
|
|
The material's [property:Constant blending] must be set to [page:Materials CustomBlending] for this to have any effect.
|
|
- </div>
|
|
|
|
|
|
+ </p>
|
|
|
|
|
|
<h3>[property:Integer blendSrcAlpha]</h3>
|
|
<h3>[property:Integer blendSrcAlpha]</h3>
|
|
- <div>The tranparency of the [page:.blendSrc]. Default is *null*.</div>
|
|
|
|
|
|
+ <p>The tranparency of the [page:.blendSrc]. Default is *null*.</p>
|
|
|
|
|
|
<h3>[property:Boolean clipIntersection]</h3>
|
|
<h3>[property:Boolean clipIntersection]</h3>
|
|
- <div>
|
|
|
|
|
|
+ <p>
|
|
Changes the behavior of clipping planes so that only their intersection is clipped, rather than their union.
|
|
Changes the behavior of clipping planes so that only their intersection is clipped, rather than their union.
|
|
Default is *false*.
|
|
Default is *false*.
|
|
- </div>
|
|
|
|
|
|
+ </p>
|
|
|
|
|
|
<h3>[property:Array clippingPlanes]</h3>
|
|
<h3>[property:Array clippingPlanes]</h3>
|
|
- <div>
|
|
|
|
|
|
+ <p>
|
|
User-defined clipping planes specified as THREE.Plane objects in world space.
|
|
User-defined clipping planes specified as THREE.Plane objects in world space.
|
|
These planes apply to the objects this material is attached to.
|
|
These planes apply to the objects this material is attached to.
|
|
Points in space whose signed distance to the plane is negative are clipped (not rendered).
|
|
Points in space whose signed distance to the plane is negative are clipped (not rendered).
|
|
This requires [page:WebGLRenderer.localClippingEnabled] to be *true*.
|
|
This requires [page:WebGLRenderer.localClippingEnabled] to be *true*.
|
|
See the [example:webgl_clipping_intersection WebGL / clipping /intersection] example.
|
|
See the [example:webgl_clipping_intersection WebGL / clipping /intersection] example.
|
|
Default is *null*.
|
|
Default is *null*.
|
|
- </div>
|
|
|
|
|
|
+ </p>
|
|
|
|
|
|
<h3>[property:Boolean clipShadows]</h3>
|
|
<h3>[property:Boolean clipShadows]</h3>
|
|
- <div>
|
|
|
|
|
|
+ <p>
|
|
Defines whether to clip shadows according to the clipping planes specified on this material. Default is *false*.
|
|
Defines whether to clip shadows according to the clipping planes specified on this material. Default is *false*.
|
|
- </div>
|
|
|
|
|
|
+ </p>
|
|
|
|
|
|
<h3>[property:Boolean colorWrite]</h3>
|
|
<h3>[property:Boolean colorWrite]</h3>
|
|
- <div>
|
|
|
|
|
|
+ <p>
|
|
Whether to render the material's color.
|
|
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*.
|
|
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*.
|
|
- </div>
|
|
|
|
|
|
+ </p>
|
|
|
|
|
|
<h3>[property:Material customDepthMaterial]</h3>
|
|
<h3>[property:Material customDepthMaterial]</h3>
|
|
- <div>
|
|
|
|
|
|
+ <p>
|
|
Custom depth material to be used by this material when rendering to the depth map.
|
|
Custom depth material to be used by this material when rendering to the depth map.
|
|
When shadow-casting with a [page:DirectionalLight] or [page:SpotLight], if you are (a) modifying vertex positions in the vertex shader,
|
|
When shadow-casting with a [page:DirectionalLight] or [page:SpotLight], if you are (a) modifying vertex positions in the vertex shader,
|
|
(b) using a displacement map, (c) using an alpha map with alphaTest, or (d) using a transparent texture with alphaTest,
|
|
(b) using a displacement map, (c) using an alpha map with alphaTest, or (d) using a transparent texture with alphaTest,
|
|
you must specify a customDepthMaterial for proper shadows. Default is *undefined*.
|
|
you must specify a customDepthMaterial for proper shadows. Default is *undefined*.
|
|
- </div>
|
|
|
|
|
|
+ </p>
|
|
|
|
|
|
<h3>[property:Material customDistanceMaterial]</h3>
|
|
<h3>[property:Material customDistanceMaterial]</h3>
|
|
- <div>
|
|
|
|
|
|
+ <p>
|
|
Same as customDepthMaterial, but used with [page:PointLight]. Default is *undefined*.
|
|
Same as customDepthMaterial, but used with [page:PointLight]. Default is *undefined*.
|
|
- </div>
|
|
|
|
|
|
+ </p>
|
|
|
|
|
|
<h3>[property:Object defines]</h3>
|
|
<h3>[property:Object defines]</h3>
|
|
- <div>
|
|
|
|
|
|
+ <p>
|
|
Custom defines to be injected into the shader. These are passed in form of an object literal, with key/value pairs. { MY_CUSTOM_DEFINE: '' , PI2: Math.PI * 2 }. The pairs are defined in both vertex and fragment shaders. Default is *undefined*.
|
|
Custom defines to be injected into the shader. These are passed in form of an object literal, with key/value pairs. { MY_CUSTOM_DEFINE: '' , PI2: Math.PI * 2 }. The pairs are defined in both vertex and fragment shaders. Default is *undefined*.
|
|
- </div>
|
|
|
|
|
|
+ </p>
|
|
|
|
|
|
<h3>[property:Integer depthFunc]</h3>
|
|
<h3>[property:Integer depthFunc]</h3>
|
|
- <div>
|
|
|
|
|
|
+ <p>
|
|
Which depth function to use. Default is [page:Materials LessEqualDepth]. See the depth mode [page:Materials constants] for all possible values.
|
|
Which depth function to use. Default is [page:Materials LessEqualDepth]. See the depth mode [page:Materials constants] for all possible values.
|
|
- </div>
|
|
|
|
|
|
+ </p>
|
|
|
|
|
|
<h3>[property:Boolean depthTest]</h3>
|
|
<h3>[property:Boolean depthTest]</h3>
|
|
- <div>
|
|
|
|
|
|
+ <p>
|
|
Whether to have depth test enabled when rendering this material. Default is *true*.
|
|
Whether to have depth test enabled when rendering this material. Default is *true*.
|
|
- </div>
|
|
|
|
|
|
+ </p>
|
|
|
|
|
|
<h3>[property:Boolean depthWrite]</h3>
|
|
<h3>[property:Boolean depthWrite]</h3>
|
|
- <div>
|
|
|
|
|
|
+ <p>
|
|
Whether rendering this material has any effect on the depth buffer. Default is *true*.<br /><br />
|
|
Whether rendering this material has any effect on the depth buffer. Default is *true*.<br /><br />
|
|
|
|
|
|
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.
|
|
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.
|
|
- </div>
|
|
|
|
|
|
+ </p>
|
|
|
|
|
|
<h3>[property:Boolean flatShading]</h3>
|
|
<h3>[property:Boolean flatShading]</h3>
|
|
- <div>
|
|
|
|
|
|
+ <p>
|
|
Define whether the material is rendered with flat shading. Default is false.
|
|
Define whether the material is rendered with flat shading. Default is false.
|
|
- </div>
|
|
|
|
|
|
+ </p>
|
|
|
|
|
|
<h3>[property:Boolean fog]</h3>
|
|
<h3>[property:Boolean fog]</h3>
|
|
- <div>Whether the material is affected by fog. Default is *true*.</div>
|
|
|
|
|
|
+ <p>Whether the material is affected by fog. Default is *true*.</p>
|
|
|
|
|
|
<h3>[property:Integer id]</h3>
|
|
<h3>[property:Integer id]</h3>
|
|
- <div>Unique number for this material instance.</div>
|
|
|
|
|
|
+ <p>Unique number for this material instance.</p>
|
|
|
|
|
|
<h3>[property:Boolean isMaterial]</h3>
|
|
<h3>[property:Boolean isMaterial]</h3>
|
|
- <div>
|
|
|
|
|
|
+ <p>
|
|
Used to check whether this or derived classes are materials. Default is *true*.<br /><br />
|
|
Used to check whether this or derived classes are materials. Default is *true*.<br /><br />
|
|
|
|
|
|
You should not change this, as it used internally for optimisation.
|
|
You should not change this, as it used internally for optimisation.
|
|
- </div>
|
|
|
|
|
|
+ </p>
|
|
|
|
|
|
<h3>[property:Boolean lights]</h3>
|
|
<h3>[property:Boolean lights]</h3>
|
|
- <div>Whether the material is affected by lights. Default is *true*.</div>
|
|
|
|
|
|
+ <p>Whether the material is affected by lights. Default is *true*.</p>
|
|
|
|
|
|
<h3>[property:String name]</h3>
|
|
<h3>[property:String name]</h3>
|
|
- <div>Optional name of the object (doesn't need to be unique). Default is an empty string.</div>
|
|
|
|
|
|
+ <p>Optional name of the object (doesn't need to be unique). Default is an empty string.</p>
|
|
|
|
|
|
<h3>[property:Boolean needsUpdate]</h3>
|
|
<h3>[property:Boolean needsUpdate]</h3>
|
|
- <div>
|
|
|
|
|
|
+ <p>
|
|
Specifies that the material needs to be updated at the WebGL level.
|
|
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.<br />
|
|
Set it to true if you made changes that need to be reflected in WebGL.<br />
|
|
This property is automatically set to *true* when instancing a new material.
|
|
This property is automatically set to *true* when instancing a new material.
|
|
- </div>
|
|
|
|
|
|
+ </p>
|
|
|
|
|
|
<h3>[property:Float opacity]</h3>
|
|
<h3>[property:Float opacity]</h3>
|
|
- <div>
|
|
|
|
|
|
+ <p>
|
|
Float in the range of *0.0* - *1.0* indicating how transparent the material is.
|
|
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.<br />
|
|
A value of *0.0* indicates fully transparent, *1.0* is fully opaque.<br />
|
|
If the material's [property:Boolean transparent] property is not set to *true*, the material will remain
|
|
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. <br />
|
|
fully opaque and this value will only affect its color. <br />
|
|
Default is *1.0*.
|
|
Default is *1.0*.
|
|
- </div>
|
|
|
|
|
|
+ </p>
|
|
|
|
|
|
<h3>[property:Float overdraw]</h3>
|
|
<h3>[property:Float overdraw]</h3>
|
|
- <div>
|
|
|
|
|
|
+ <p>
|
|
Amount of triangle expansion at draw time.
|
|
Amount of triangle expansion at draw time.
|
|
This is a workaround for cases when gaps appear between triangles when using [page:CanvasRenderer].
|
|
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*.
|
|
*0.5* tends to give good results across browsers. Default is *0*.
|
|
- </div>
|
|
|
|
|
|
+ </p>
|
|
|
|
|
|
<h3>[property:Boolean polygonOffset]</h3>
|
|
<h3>[property:Boolean polygonOffset]</h3>
|
|
- <div>
|
|
|
|
|
|
+ <p>
|
|
Whether to use polygon offset. Default is *false*. This corresponds to the *GL_POLYGON_OFFSET_FILL* WebGL feature.
|
|
Whether to use polygon offset. Default is *false*. This corresponds to the *GL_POLYGON_OFFSET_FILL* WebGL feature.
|
|
- </div>
|
|
|
|
|
|
+ </p>
|
|
|
|
|
|
<h3>[property:Integer polygonOffsetFactor]</h3>
|
|
<h3>[property:Integer polygonOffsetFactor]</h3>
|
|
- <div>Sets the polygon offset factor. Default is *0*.</div>
|
|
|
|
|
|
+ <p>Sets the polygon offset factor. Default is *0*.</p>
|
|
|
|
|
|
<h3>[property:Integer polygonOffsetUnits]</h3>
|
|
<h3>[property:Integer polygonOffsetUnits]</h3>
|
|
- <div>Sets the polygon offset units. Default is *0*.</div>
|
|
|
|
|
|
+ <p>Sets the polygon offset units. Default is *0*.</p>
|
|
|
|
|
|
<h3>[property:String precision]</h3>
|
|
<h3>[property:String precision]</h3>
|
|
- <div>
|
|
|
|
|
|
+ <p>
|
|
Override the renderer's default precision for this material. Can be "*highp*", "*mediump*" or "*lowp*".
|
|
Override the renderer's default precision for this material. Can be "*highp*", "*mediump*" or "*lowp*".
|
|
Default is *null*.
|
|
Default is *null*.
|
|
- </div>
|
|
|
|
|
|
+ </p>
|
|
|
|
|
|
<h3>[property:Boolean premultipliedAlpha]</h3>
|
|
<h3>[property:Boolean premultipliedAlpha]</h3>
|
|
- <div>
|
|
|
|
|
|
+ <p>
|
|
Whether to premultiply the alpha (transparency) value.
|
|
Whether to premultiply the alpha (transparency) value.
|
|
See [Example:webgl_materials_transparency WebGL / Materials / Transparency] for an example of the difference.
|
|
See [Example:webgl_materials_transparency WebGL / Materials / Transparency] for an example of the difference.
|
|
Default is *false*.
|
|
Default is *false*.
|
|
- </div>
|
|
|
|
|
|
+ </p>
|
|
|
|
|
|
<h3>[property:Boolean dithering]</h3>
|
|
<h3>[property:Boolean dithering]</h3>
|
|
- <div>
|
|
|
|
|
|
+ <p>
|
|
Whether to apply dithering to the color to remove the appearance of banding.
|
|
Whether to apply dithering to the color to remove the appearance of banding.
|
|
Default is *false*.
|
|
Default is *false*.
|
|
- </div>
|
|
|
|
|
|
+ </p>
|
|
|
|
|
|
<h3>[property:Integer shadowSide]</h3>
|
|
<h3>[property:Integer shadowSide]</h3>
|
|
- <div>
|
|
|
|
|
|
+ <p>
|
|
Defines which side of faces cast shadows.
|
|
Defines which side of faces cast shadows.
|
|
When set, can be [page:Materials THREE.FrontSide], [page:Materials THREE.BackSide], or [page:Materials THREE.DoubleSide]. Default is *null*. <br />
|
|
When set, can be [page:Materials THREE.FrontSide], [page:Materials THREE.BackSide], or [page:Materials THREE.DoubleSide]. Default is *null*. <br />
|
|
If *null*, the side casting shadows is determined as follows: <br />
|
|
If *null*, the side casting shadows is determined as follows: <br />
|
|
@@ -244,88 +244,88 @@
|
|
</table>
|
|
</table>
|
|
|
|
|
|
|
|
|
|
- </div>
|
|
|
|
|
|
+ </p>
|
|
|
|
|
|
<h3>[property:Integer side]</h3>
|
|
<h3>[property:Integer side]</h3>
|
|
- <div>
|
|
|
|
|
|
+ <p>
|
|
Defines which side of faces will be rendered - front, back or both.
|
|
Defines which side of faces will be rendered - front, back or both.
|
|
Default is [page:Materials THREE.FrontSide].
|
|
Default is [page:Materials THREE.FrontSide].
|
|
Other options are [page:Materials THREE.BackSide] and [page:Materials THREE.DoubleSide].
|
|
Other options are [page:Materials THREE.BackSide] and [page:Materials THREE.DoubleSide].
|
|
- </div>
|
|
|
|
|
|
+ </p>
|
|
|
|
|
|
<h3>[property:Boolean transparent]</h3>
|
|
<h3>[property:Boolean transparent]</h3>
|
|
- <div>
|
|
|
|
|
|
+ <p>
|
|
Defines whether this material is transparent. This has an effect on rendering
|
|
Defines whether this material is transparent. This has an effect on rendering
|
|
as transparent objects need special treatment and are rendered after
|
|
as transparent objects need special treatment and are rendered after
|
|
non-transparent objects. <br />
|
|
non-transparent objects. <br />
|
|
When set to true, the extent to which the material is transparent is
|
|
When set to true, the extent to which the material is transparent is
|
|
controlled by setting it's [property:Float opacity] property. <br />
|
|
controlled by setting it's [property:Float opacity] property. <br />
|
|
Default is *false*.
|
|
Default is *false*.
|
|
- </div>
|
|
|
|
|
|
+ </p>
|
|
|
|
|
|
<h3>[property:String type]</h3>
|
|
<h3>[property:String type]</h3>
|
|
- <div>
|
|
|
|
|
|
+ <p>
|
|
Value is the string 'Material'. This shouldn't be changed, and can be used to
|
|
Value is the string 'Material'. This shouldn't be changed, and can be used to
|
|
find all objects of this type in a scene.
|
|
find all objects of this type in a scene.
|
|
- </div>
|
|
|
|
|
|
+ </p>
|
|
|
|
|
|
<h3>[property:String uuid]</h3>
|
|
<h3>[property:String uuid]</h3>
|
|
- <div>
|
|
|
|
|
|
+ <p>
|
|
[link:http://en.wikipedia.org/wiki/Universally_unique_identifier UUID] of this material instance.
|
|
[link:http://en.wikipedia.org/wiki/Universally_unique_identifier UUID] of this material instance.
|
|
This gets automatically assigned, so this shouldn't be edited.
|
|
This gets automatically assigned, so this shouldn't be edited.
|
|
- </div>
|
|
|
|
|
|
+ </p>
|
|
|
|
|
|
<h3>[property:Integer vertexColors]</h3>
|
|
<h3>[property:Integer vertexColors]</h3>
|
|
- <div>
|
|
|
|
|
|
+ <p>
|
|
Defines whether vertex coloring is used.
|
|
Defines whether vertex coloring is used.
|
|
Default is [page:Materials THREE.NoColors].
|
|
Default is [page:Materials THREE.NoColors].
|
|
Other options are [page:Materials THREE.VertexColors] and [page:Materials THREE.FaceColors].
|
|
Other options are [page:Materials THREE.VertexColors] and [page:Materials THREE.FaceColors].
|
|
- </div>
|
|
|
|
|
|
+ </p>
|
|
|
|
|
|
<h3>[property:Boolean visible]</h3>
|
|
<h3>[property:Boolean visible]</h3>
|
|
- <div>
|
|
|
|
|
|
+ <p>
|
|
Defines whether this material is visible. Default is *true*.
|
|
Defines whether this material is visible. Default is *true*.
|
|
- </div>
|
|
|
|
|
|
+ </p>
|
|
|
|
|
|
<h3>[property:object userData]</h3>
|
|
<h3>[property:object userData]</h3>
|
|
- <div>
|
|
|
|
|
|
+ <p>
|
|
An object that can be used to store custom data about the Material. It should not hold
|
|
An object that can be used to store custom data about the Material. It should not hold
|
|
references to functions as these will not be cloned.
|
|
references to functions as these will not be cloned.
|
|
- </div>
|
|
|
|
|
|
+ </p>
|
|
|
|
|
|
<h2>Methods</h2>
|
|
<h2>Methods</h2>
|
|
|
|
|
|
<h3>[page:EventDispatcher EventDispatcher] methods are available on this class.</h3>
|
|
<h3>[page:EventDispatcher EventDispatcher] methods are available on this class.</h3>
|
|
|
|
|
|
<h3>[method:Material clone]( )</h3>
|
|
<h3>[method:Material clone]( )</h3>
|
|
- <div>Return a new material with the same parameters as this material.</div>
|
|
|
|
|
|
+ <p>Return a new material with the same parameters as this material.</p>
|
|
|
|
|
|
<h3>[method:Material copy]( [param:material material] )</h3>
|
|
<h3>[method:Material copy]( [param:material material] )</h3>
|
|
- <div>Copy the parameters from the passed material into this material.</div>
|
|
|
|
|
|
+ <p>Copy the parameters from the passed material into this material.</p>
|
|
|
|
|
|
<h3>[method:null dispose]()</h3>
|
|
<h3>[method:null dispose]()</h3>
|
|
- <div>
|
|
|
|
|
|
+ <p>
|
|
This disposes the material. Textures of a material don't get disposed.
|
|
This disposes the material. Textures of a material don't get disposed.
|
|
These needs to be disposed by [page:Texture Texture].
|
|
These needs to be disposed by [page:Texture Texture].
|
|
- </div>
|
|
|
|
|
|
+ </p>
|
|
|
|
|
|
<h3>[method:null onBeforeCompile]( [param:Object shader], [param:WebGLRenderer renderer] )</h3>
|
|
<h3>[method:null onBeforeCompile]( [param:Object shader], [param:WebGLRenderer renderer] )</h3>
|
|
- <div>
|
|
|
|
|
|
+ <p>
|
|
An optional callback that is executed immediately before the shader program is compiled.
|
|
An optional callback that is executed immediately before the shader program is compiled.
|
|
This function is called with the shader source code as a parameter. Useful for the modification of built-in materials.
|
|
This function is called with the shader source code as a parameter. Useful for the modification of built-in materials.
|
|
- </div>
|
|
|
|
|
|
+ </p>
|
|
|
|
|
|
<h3>[method:null setValues]( [param:object values] )</h3>
|
|
<h3>[method:null setValues]( [param:object values] )</h3>
|
|
- <div>
|
|
|
|
|
|
+ <p>
|
|
values -- a container with parameters.<br />
|
|
values -- a container with parameters.<br />
|
|
Sets the properties based on the *values*.
|
|
Sets the properties based on the *values*.
|
|
- </div>
|
|
|
|
|
|
+ </p>
|
|
|
|
|
|
<h3>[method:null toJSON]( [param:object meta] )</h3>
|
|
<h3>[method:null toJSON]( [param:object meta] )</h3>
|
|
- <div>
|
|
|
|
|
|
+ <p>
|
|
meta -- object containing metadata such as textures or images for the material.<br />
|
|
meta -- object containing metadata such as textures or images for the material.<br />
|
|
Convert the material to three.js JSON format.
|
|
Convert the material to three.js JSON format.
|
|
- </div>
|
|
|
|
|
|
+ </p>
|
|
|
|
|
|
<h2>Source</h2>
|
|
<h2>Source</h2>
|
|
|
|
|