A material for drawing point-style geometries.

Root element: THREE.PointsMaterial

material

three/Material/Points/PointsMaterial

three/Object3D/Points/**

Hierarchy

  • Material
    • PointsMaterial

Accessors

  • get disposed(): boolean
  • Gets the disposed status of the entity.

    Returns boolean

    The disposed status.

  • get elementsResolved(): any[]
  • An array of the elements that this component instance exposes. In the case that this component does not expose any elements of its own, this will be an array of the elements exposed by this component's children.

    Returns any[]

  • get lockedResolved(): boolean
  • Returns true if this component, or any of its parents, are marked as locked.

    Returns boolean

Constructors

Methods

  • Adds a behavior to the component.

    Parameters

    • b: Behavior<Component<any, ConstructorProps>>

      The behavior to add.

    Returns void

  • Adds the supplied component instance as a child of this component, removing it from any existing parent.

    Parameters

    • c: Component<any, ConstructorProps>

      The component instance to add

    Returns void

  • Constructs the children of this component.

    Parameters

    • children: ComponentChildren
    • OptionalcontextManager: ContextManager

    Returns void

  • Gets a behavior of a specific type from the component.

    Type Parameters

    • T extends (new (contextManager: ContextManager, instance: Component<any, ConstructorProps>, ...args: any[]) => Behavior<Component<any, ConstructorProps>>)

      The behavior type.

    Parameters

    • type: T

      The type of behavior to get.

    Returns undefined | InstanceType<T>

    The behavior of the specified type, or undefined if no such behavior exists.

  • Gets all behaviors of a specific type from the component.

    Type Parameters

    • T extends (new (contextManager: ContextManager, instance: Component<any, ConstructorProps>, ...args: any[]) => Behavior<Component<any, ConstructorProps>>)

      The behavior type.

    Parameters

    • type: T

      The type of behaviors to get.

    Returns InstanceType<T>[]

    An array of behaviors of the specified type.

  • Get the instance of the ZComponent that constructed this entity.

    If you pass the class of a ZComponent as the type parameter, this function will ensure that it returns an instance of that ZComponent. If this component or behavior was constructed by a different ZComponent class, or by a different entity altogether, the function with throw an error.

    Type Parameters

    • T extends ZComponent<any, T> = ZComponent<any>

    Parameters

    • Optionaltype: ConstructorForComponent<T>

      The ZComponent class that you are expecting to receive

    Returns T

    The instance of the ZComponent that constructed this component or behavior

  • Register a function to be called when an Event is fired, or an Observable's value changes. The function will only be bound to the underlying Event or Observable while this entity is enabled.

    Using this function, rather than attaching your handler directly to the Event or Observable, ensures your handler is automatically released when this entity is disposed.

    Type Parameters

    • Args extends any[]

    Parameters

    • evt: Event<Args>

      The Event or Observable to listen to

    • fn: ((...args: Args) => void)

      A function that will be called when the event fires, or the Observable value changes

        • (...args): void
        • Parameters

          Returns void

    • Optionalpriority: number

    Returns any

  • Type Parameters

    • Args extends any[]

    Parameters

    Returns any

  • Type Parameters

    • Type

    Parameters

    • observable: Observable<Type, never>
    • fn: ((v: Type) => void)
        • (v): void
        • Parameters

          Returns void

    • Optionalpriority: number

    Returns any

  • Type Parameters

    • Type

    Parameters

    Returns any

  • Removes this component from its parent component.

    Returns void

  • Removes a behavior from the component.

    Parameters

    • b: Behavior<Component<any, ConstructorProps>>

      The behavior to remove.

    Returns void

  • Removes the supplied component instance from the list of children.

    Parameters

    • c: Component<any, ConstructorProps>

      The component to remove

    Returns void

  • Unregisters a function that was previously registered to an Event or Observable.

    Type Parameters

    • Args extends any[]

    Parameters

    • evt: Event<Args>

      The Event or Observable

    • fn: ((...args: Args) => void)

      The function that was passed in the call to register

        • (...args): void
        • Parameters

          Returns void

    Returns any

  • Type Parameters

    • Type

    Parameters

    • observable: Observable<Type, never>
    • fn: ((v: Type) => void)
        • (v): void
        • Parameters

          Returns void

    Returns any

Other

tags: Observable<string[], never>

An array of string 'tags' assocated with this component.

The getComponentsByTag(mgr, tag) function can be used to get an array of components with the supplied tag.

By default, tags are scoped to the ZComponent instance that a component is constructed by. Tags that begin with global: are scoped to the experience as a whole.

0

Properties - Behavior

enabled: Observable<boolean, never>

If false, this entity and its children will no longer participate in the experience.

Note - to read this value, you may wish to use enabledResolved which will be false if this entity, or any of its parents, have enabled set to false.

The precise implications of enabled being false will vary between entities, but in general disabled entities:

  • should not emit any events,
  • should not take any action, e.g. navigate the user to a different page,
  • should not perform any network communication,
  • should not make changes to other behaviors or components in the experience,
  • should minimise any runtime performance cost (e.g. detach from any frame handlers).

true

10

Properties - Custom Blending

blendDst: Observable<BlendingDstFactor, never> = ...

Blending destination. The material's blending must be set to CustomBlending for this to have any effect.

4

OneMinusSrcAlphaFactor

blendDstAlpha: Observable<null | number, never> = ...

The transparency of the .blendDst. Uses .blendDst value if null.

4

null

blendEquation: Observable<BlendingEquation, never> = ...

Blending equation to use when applying blending. Default is AddEquation.

The material's blending must be set to CustomBlending for this to have any effect.

4

AddEquation

blendEquationAlpha: Observable<null | number, never> = ...

The transparency of the .blendEquation.

Uses .blendEquation value if null. Default is null.

4

null

blendSrc: Observable<BlendingSrcFactor, never> = ...

Blending Source. The material's blending must be set to CustomBlending for this to have any effect.

4

SrcAlphaFactor

blendSrcAlpha: Observable<null | number, never> = ...

The transparency of the .blendSrc. Uses .blendSrc value if null. Default is null.

4

null

Properties - Material

alphaTest: Observable<number, never> = ...

Sets the alpha value to be used when running an alpha test. The material will not be rendered if the opacity is lower than this value. Default is 0.

10

proportion

0

attachTo: Observable<undefined | string, never> = ...

The name of a material in the parent node for this node to attach to. Use this if you're overriding a named material in a GLTF component, for example.

10

parentmaterials

colorWrite: Observable<boolean, never> = ...

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.

10

true

depthFunc: Observable<DepthMode, never> = ...

Which depth function to use.

10

LessEqualDepth

depthTest: Observable<boolean, never> = ...

Whether to have depth test enabled when rendering this material.

When the depth test is disabled, the depth write will also be implicitly disabled.

10

true

depthWrite: Observable<boolean, never> = ...

Whether rendering this material has any effect on the depth buffer.

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.

10

true

opacity: Observable<number, never> = ...

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 transparent property is not set to true, the material will remain fully opaque and this value will only affect its color.

10

proportion

1

side: Observable<Side, never> = ...

Defines which side of faces will be rendered - front, back or both.

10

FrontSide

transparent: Observable<boolean, never> = ...

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 its opacity property.

10

false

visible: Observable<boolean, never> = ...

Defines whether this material is visible.

10

true

Properties - Material Advanced

alphaToCoverage: Observable<boolean, never> = ...

Enables alpha to coverage. Can only be used with MSAA-enabled contexts (meaning when the renderer was created with antialias parameter set to true). Default is false.

5

false

blending: Observable<Blending, never> = ...

Blending destination. The material's blending must be set to CustomBlending for this to have any effect.

5

NormalBlending

clipIntersection: Observable<boolean, never> = ...

Changes the behavior of clipping planes so that only their intersection is clipped, rather than their union.

5

false

clipShadows: Observable<boolean, never> = ...

Defines whether to clip shadows according to the clipping planes specified on this material.

5

false

dithering: Observable<boolean, never> = ...

Whether to apply dithering to the color to remove the appearance of banding.

5

false

polygonOffset: Observable<boolean, never> = ...

Whether to use polygon offset.

This corresponds to the GL_POLYGON_OFFSET_FILL WebGL feature.

5

false

polygonOffsetFactor: Observable<number, never> = ...

Sets the polygon offset factor.

5

0

polygonOffsetUnits: Observable<number, never> = ...

Sets the polygon offset units

5

0

premultipliedAlpha: Observable<boolean, never> = ...

Whether to premultiply the alpha (transparency) value.

5

false

shadowSide: Observable<null | Side, never> = ...

Defines which side of faces cast shadows.

5

null

stencilWrite: Observable<boolean, never> = ...

Whether stencil operations are performed against the stencil buffer.

In order to perform writes or comparisons against the stencil buffer this value must be true.

5

false

stencilWriteMask: Observable<number, never> = ...

The bit mask to use when writing to the stencil buffer.

5

0xFF

toneMapped: Observable<boolean, never> = ...

Defines whether this material is tone mapped according to the renderer's toneMapping setting.

5

true

vertexColors: Observable<boolean, never> = ...

Defines whether vertex coloring is used.

The engine supports RGB and RGBA vertex colors depending on whether a three (RGB) or four (RGBA) component color buffer attribute is used.

5

false

Properties - Other

behaviors: Behavior<Component<any, ConstructorProps>>[]

The behaviors attached to this component.

children: Component<any, ConstructorProps>[]

The children of this component.

contextManager: ContextManager
element: PointsMaterial
enabledResolved: Observable<boolean, never>

This will have value false if this entity, or any of its parents, have enabled set to false.

To change the enabled status of this entity, use the enabled property instead.

The precise implications of enabled being false will vary between entities, but in general disabled entities:

  • should not emit any events,
  • should not take any action, e.g. navigate the user to a different page,
  • should not perform any network communication,
  • should not make changes to other behaviors or components in the experience,
  • should minimise any runtime performance cost.

Disabled entities will typically remain visible (if they have a visible appearance).

locked?: boolean

If true, this component can't be selected at design time in the 3D preview.

onDispose: Event<[]>

An event that is fired as the last act of this entity being destroyed.

parent?: Component<any, ConstructorProps>

The parent of this component.

Properties - PointsMaterial

color: Observable<[number, number, number], never> = ...

The color of the material.

20

color-norm-rgb-linear

[1, 1, 1]

fog: Observable<boolean, never> = ...

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

20

true

size: Observable<number, never> = ...

The size of the points in pixels.

20

1

sizeAttenuation: Observable<boolean, never> = ...

If the points' size should be affected by the camera's distance.

20

true