|
@@ -67,88 +67,105 @@ export class Material extends EventDispatcher {
|
|
|
|
|
|
/**
|
|
|
* Sets the alpha value to be used when running an alpha test. Default is 0.
|
|
|
+ * @default 0
|
|
|
*/
|
|
|
alphaTest: number;
|
|
|
|
|
|
/**
|
|
|
* Blending destination. It's one of the blending mode constants defined in Three.js. Default is {@link OneMinusSrcAlphaFactor}.
|
|
|
+ * @default THREE.OneMinusSrcAlphaFactor
|
|
|
*/
|
|
|
blendDst: BlendingDstFactor;
|
|
|
|
|
|
/**
|
|
|
* The tranparency of the .blendDst. Default is null.
|
|
|
+ * @default null
|
|
|
*/
|
|
|
blendDstAlpha: number | null;
|
|
|
|
|
|
/**
|
|
|
* Blending equation to use when applying blending. It's one of the constants defined in Three.js. Default is {@link AddEquation}.
|
|
|
+ * @default THREE.AddEquation
|
|
|
*/
|
|
|
blendEquation: BlendingEquation;
|
|
|
|
|
|
/**
|
|
|
* The tranparency of the .blendEquation. Default is null.
|
|
|
+ * @default null
|
|
|
*/
|
|
|
blendEquationAlpha: number | null;
|
|
|
|
|
|
/**
|
|
|
* Which blending to use when displaying objects with this material. Default is {@link NormalBlending}.
|
|
|
+ * @default THREE.NormalBlending
|
|
|
*/
|
|
|
blending: Blending;
|
|
|
|
|
|
/**
|
|
|
* Blending source. It's one of the blending mode constants defined in Three.js. Default is {@link SrcAlphaFactor}.
|
|
|
+ * @default THREE.SrcAlphaFactor
|
|
|
*/
|
|
|
blendSrc: BlendingSrcFactor | BlendingDstFactor;
|
|
|
|
|
|
/**
|
|
|
* The tranparency of the .blendSrc. Default is null.
|
|
|
+ * @default null
|
|
|
*/
|
|
|
blendSrcAlpha: number | null;
|
|
|
|
|
|
/**
|
|
|
* Changes the behavior of clipping planes so that only their intersection is clipped, rather than their union. Default is false.
|
|
|
+ * @default false
|
|
|
*/
|
|
|
clipIntersection: boolean;
|
|
|
|
|
|
/**
|
|
|
* 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 signed distance to the plane is negative are clipped (not rendered). See the WebGL / clipping /intersection example. Default is null.
|
|
|
+ * @default null
|
|
|
*/
|
|
|
clippingPlanes: any;
|
|
|
|
|
|
/**
|
|
|
* Defines whether to clip shadows according to the clipping planes specified on this material. Default is false.
|
|
|
+ * @default false
|
|
|
*/
|
|
|
clipShadows: boolean;
|
|
|
|
|
|
/**
|
|
|
* Whether to render the material's color. This can be used in conjunction with a mesh's .renderOrder property to create invisible objects that occlude other objects. Default is true.
|
|
|
+ * @default true
|
|
|
*/
|
|
|
colorWrite: boolean;
|
|
|
|
|
|
/**
|
|
|
* 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.
|
|
|
+ * @default undefined
|
|
|
*/
|
|
|
- defines: any;
|
|
|
+ defines: { [key: string]: any };
|
|
|
|
|
|
/**
|
|
|
* Which depth function to use. Default is {@link LessEqualDepth}. See the depth mode constants for all possible values.
|
|
|
+ * @default THREE.LessEqualDepth
|
|
|
*/
|
|
|
depthFunc: DepthModes;
|
|
|
|
|
|
/**
|
|
|
* Whether to have depth test enabled when rendering this material. Default is true.
|
|
|
+ * @default true
|
|
|
*/
|
|
|
depthTest: boolean;
|
|
|
|
|
|
/**
|
|
|
* Whether rendering this material has any effect on the depth buffer. Default is true.
|
|
|
* 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.
|
|
|
+ * @default true
|
|
|
*/
|
|
|
depthWrite: boolean;
|
|
|
|
|
|
/**
|
|
|
* Whether the material is affected by fog. Default is true.
|
|
|
+ * @default fog
|
|
|
*/
|
|
|
fog: boolean;
|
|
|
|
|
@@ -159,36 +176,43 @@ export class Material extends EventDispatcher {
|
|
|
|
|
|
/**
|
|
|
* Whether rendering this material has any effect on the stencil buffer. Default is *false*.
|
|
|
+ * @default false
|
|
|
*/
|
|
|
stencilWrite: boolean;
|
|
|
|
|
|
/**
|
|
|
* The stencil comparison function to use. Default is {@link AlwaysStencilFunc}. See stencil operation constants for all possible values.
|
|
|
+ * @default THREE.AlwaysStencilFunc
|
|
|
*/
|
|
|
stencilFunc: StencilFunc;
|
|
|
|
|
|
/**
|
|
|
* The value to use when performing stencil comparisons or stencil operations. Default is *0*.
|
|
|
+ * @default 0
|
|
|
*/
|
|
|
stencilRef: number;
|
|
|
|
|
|
/**
|
|
|
* The bit mask to use when comparing against or writing to the stencil buffer. Default is *0xFF*.
|
|
|
+ * @default 0xff
|
|
|
*/
|
|
|
stencilMask: number;
|
|
|
|
|
|
/**
|
|
|
* Which stencil operation to perform when the comparison function returns false. Default is {@link KeepStencilOp}. See the stencil operation constants for all possible values.
|
|
|
+ * @default THREE.KeepStencilOp
|
|
|
*/
|
|
|
stencilFail: StencilOp;
|
|
|
|
|
|
/**
|
|
|
* Which stencil operation to perform when the comparison function returns true but the depth test fails. Default is {@link KeepStencilOp}. See the stencil operation constants for all possible values.
|
|
|
+ * @default THREE.KeepStencilOp
|
|
|
*/
|
|
|
stencilZFail: StencilOp;
|
|
|
|
|
|
/**
|
|
|
* Which stencil operation to perform when the comparison function returns true and the depth test passes. Default is {@link KeepStencilOp}. See the stencil operation constants for all possible values.
|
|
|
+ * @default THREE.KeepStencilOp
|
|
|
*/
|
|
|
stencilZPass: StencilOp;
|
|
|
|
|
@@ -200,70 +224,83 @@ export class Material extends EventDispatcher {
|
|
|
|
|
|
/**
|
|
|
* Material name. Default is an empty string.
|
|
|
+ * @default ''
|
|
|
*/
|
|
|
name: string;
|
|
|
|
|
|
/**
|
|
|
* Specifies that the material needs to be updated, WebGL wise. 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.
|
|
|
+ * @default false
|
|
|
*/
|
|
|
needsUpdate: boolean;
|
|
|
|
|
|
/**
|
|
|
* Opacity. Default is 1.
|
|
|
+ * @default 1
|
|
|
*/
|
|
|
opacity: number;
|
|
|
|
|
|
/**
|
|
|
* Whether to use polygon offset. Default is false. This corresponds to the POLYGON_OFFSET_FILL WebGL feature.
|
|
|
+ * @default false
|
|
|
*/
|
|
|
polygonOffset: boolean;
|
|
|
|
|
|
/**
|
|
|
* Sets the polygon offset factor. Default is 0.
|
|
|
+ * @default 0
|
|
|
*/
|
|
|
polygonOffsetFactor: number;
|
|
|
|
|
|
/**
|
|
|
* Sets the polygon offset units. Default is 0.
|
|
|
+ * @default 0
|
|
|
*/
|
|
|
polygonOffsetUnits: number;
|
|
|
|
|
|
/**
|
|
|
* Override the renderer's default precision for this material. Can be "highp", "mediump" or "lowp". Defaults is null.
|
|
|
+ * @default null
|
|
|
*/
|
|
|
precision: 'highp' | 'mediump' | 'lowp' | null;
|
|
|
|
|
|
/**
|
|
|
* Whether to premultiply the alpha (transparency) value. See WebGL / Materials / Transparency for an example of the difference. Default is false.
|
|
|
+ * @default false
|
|
|
*/
|
|
|
premultipliedAlpha: boolean;
|
|
|
|
|
|
/**
|
|
|
* Whether to apply dithering to the color to remove the appearance of banding. Default is false.
|
|
|
+ * @default false
|
|
|
*/
|
|
|
dithering: boolean;
|
|
|
|
|
|
/**
|
|
|
* Define whether the material is rendered with flat shading. Default is false.
|
|
|
+ * @default false
|
|
|
*/
|
|
|
flatShading: boolean;
|
|
|
|
|
|
/**
|
|
|
* Defines which of the face sides will be rendered - front, back or both.
|
|
|
* Default is THREE.FrontSide. Other options are THREE.BackSide and THREE.DoubleSide.
|
|
|
+ * @default THREE.FrontSide
|
|
|
*/
|
|
|
side: Side;
|
|
|
|
|
|
/**
|
|
|
* Defines which of the face sides will cast shadows. Default is *null*.
|
|
|
* If *null*, the value is opposite that of side, above.
|
|
|
+ * @default null
|
|
|
*/
|
|
|
shadowSide: Side;
|
|
|
|
|
|
/**
|
|
|
* Defines whether this material is tone mapped according to the renderer's toneMapping setting.
|
|
|
* Default is true.
|
|
|
+ * @default true
|
|
|
*/
|
|
|
toneMapped: boolean;
|
|
|
|
|
@@ -271,11 +308,13 @@ export class Material extends EventDispatcher {
|
|
|
* 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.
|
|
|
* When set to true, the extent to which the material is transparent is controlled by setting it's .opacity property.
|
|
|
* Default is false.
|
|
|
+ * @default false
|
|
|
*/
|
|
|
transparent: boolean;
|
|
|
|
|
|
/**
|
|
|
* Value is the string 'Material'. This shouldn't be changed, and can be used to find all objects of this type in a scene.
|
|
|
+ * @default 'Material'
|
|
|
*/
|
|
|
type: string;
|
|
|
|
|
@@ -286,21 +325,25 @@ export class Material extends EventDispatcher {
|
|
|
|
|
|
/**
|
|
|
* Defines whether vertex coloring is used. Default is false.
|
|
|
+ * @default false
|
|
|
*/
|
|
|
vertexColors: boolean;
|
|
|
|
|
|
/**
|
|
|
* Defines whether this material is visible. Default is true.
|
|
|
+ * @default true
|
|
|
*/
|
|
|
visible: boolean;
|
|
|
|
|
|
/**
|
|
|
* 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.
|
|
|
+ * @default {}
|
|
|
*/
|
|
|
userData: any;
|
|
|
|
|
|
/**
|
|
|
* This starts at 0 and counts how many times .needsUpdate is set to true.
|
|
|
+ * @default 0
|
|
|
*/
|
|
|
version: number;
|
|
|
|