SpriteMaterial

Core.SpriteMaterial exported from @manycore/aholo-viewer.

Core Class

Hierarchy

Constructors

Properties

isDynamicShape: boolean

Mark this shape of this material is largely affect by shader. Hint the engine that pick, culling is disabled

isVolumeRendering: boolean

Mark this material uses volume like rendering technology. Hint the engine that some effect is disabled

MAX_TEXTURES: 6

max texture count, just in case some platform will take use of some channels by default, so set to 6 instead of 8

name: string

Optional name of the object (doesn't need to be unique). Default is an empty string.

id: number

Unique number for this material instance.

transparent: boolean

If use transparent effect, this value must be set to true to enable blending.

visible: boolean

Defines whether this material is visible.

programId: number

The id of shader program which this material shader belongs to.

side: Side

Set which side of the object will be seen on screen.

blending: Blending

Which blending to use when displaying objects with this material. This must be set to CustomBlending to use custom blendSrc , blendDst or blendEquation . See the blending mode constants for all possible values. Default is NormalBlending.

blendSrc: BlendingFactor

Blending source. Default is SrcAlphaFactor. See the source factors constants for all possible values.

blendDst: BlendingFactor

Blending destination. Default is OneMinusSrcAlphaFactor. See the destination factors constants for all possible values.

blendEquation: BlendingEquation

Blending equation to use when applying blending. Default is AddEquation. See the blending equation constants for all possible values.

blendSrcAlpha: Nullable<BlendingFactor>

The transparency of the blendSrc .

blendDstAlpha: Nullable<BlendingFactor>

The transparency of the blendDst .

blendEquationAlpha: Nullable<BlendingEquation>

The transparency of the blendEquation .

stencilWrite: boolean

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

stencilWriteMask: number

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

stencilFuncMask: number

The bit mask to use when comparing against the stencil buffer.

stencilFunc: StencilFunc

The stencil comparison function to use.

stencilRef: number

The value to use when performing stencil comparisons or stencil operations.

stencilFail: StencilOp

Which stencil operation to perform when the comparison function returns false.

stencilZFail: StencilOp

Which stencil operation to perform when the comparison function returns true but the depth test fails.

stencilZPass: StencilOp

Which stencil operation to perform when the comparison function returns true and the depth test passes.

depthFunc: DepthModes

Which depth function to use.

depthTest: boolean

Whether to have depth test enabled when rendering this material. If this is set to false, this object's occluding relationship will depend on Object3D.renderOrder| renderOrder.

depthWrite: boolean

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

colorWrite: boolean

Whether to render the material's color. This can be used in conjunction with a Object3D.renderOrder| renderOrder property to create invisible objects that occlude other objects.

colorWriteMasks: [boolean, boolean, boolean, boolean]
polygonOffset: boolean

Whether to use polygon offset.

polygonOffsetFactor: number

Sets the polygon offset factor.

polygonOffsetUnits: number

Sets the polygon offset units.

premultipliedAlpha: boolean

Whether to premultiply the alpha (transparency) value.

An optionally overriding method for extents to get data from renderer before update uniforms.

    • (renderer: Renderer): void
    • Parameters

      • renderer: Renderer

        instance of renderer for engine.

      Returns void

colorWriteMask: [boolean, boolean, boolean, boolean]
sizeAttenuation: boolean

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

rotation: number

The rotation of the sprite in radians.

color: Readonly<
Pick<
ReadonlyMarked,
| "_readonly_mark"
| "cloneReadonly"
| "clone"
| "g"
| "r"
| "b"
| "isColor"
| "equals"
| "getHex"
| "getSerializeData",
>,
>

Color of the material, by default set to white (0xffffff). The value of color multiply with the color of texture| texture.

texture: Nullable<SourceTexture>

A picture for sprite.

opacity: number

The Transparency of object.

userData: Record<keyof any, any>
_uuid: any
uuid: string
_listeners: Map<Symbol, Listener<never>[]>

Accessors

  • get businessTag(): string

    Returns string

  • set businessTag(v: string): void

    Parameters

    • v: string

    Returns void

Methods

  • Returns readonly ShaderComponent[]

  • Parameters

    • index: number

    Returns void

  • Parameters

    • c: ShaderComponent
    • index: number

    Returns void

  • Parameters

    • enable: boolean

    Returns void

  • Parameters

    • r: boolean
    • g: boolean
    • b: boolean
    • a: boolean

    Returns void

  • When user change the material property manually, this method need to use to refresh data.

    Returns void

  • UUID of this material instance. This gets automatically assigned, so this shouldn't be edited.

    Returns string

  • Reset the key of shader and force engine to compile shader again.

    Returns void

  • Copy basic properties from other material.

    Parameters

    • other: Material

      the source of copied data

    Returns void

  • Make engine clear the current material's data in Ubo.

    Returns void

  • Returns void

  • Returns void

  • The name of instance's class.

    Returns string

  • Change the corresponding attribute according to the values of given SpriteMaterialParameters| parameters.

    Parameters

    • p: SpriteMaterialParameters<SourceTexture>

      a object of specified type contains parameters.

    Returns void

  • Store the attributes of this class into string as serializing format.

    Parameters

    • ctx: Serializer

      an instance used to store the data of scene objects.

    Returns void

  • Parse the data for this class from string according to serializing format.

    Parameters

    • ctx: Deserializer

      an instance give the method to take the data for attribute.

    Returns void

  • Copy the data to this instance from other instance.

    Parameters

    Returns this

  • Return a cloned instance of this class.

    Returns SpriteMaterial<SourceTexture>

  • Parameters

    • v: string

    Returns this

  • Returns boolean

  • Returns void

  • Returns void

  • Adds a listener to an event type.

    Type Parameters

    • T

    Parameters

    • _type: EventType<T>
    • _listener: Listener<T>

    Returns void

  • Only active the listener one times and then off it| it.

    Type Parameters

    • T

    Parameters

    • _type: EventType<T>
    • _listener: Listener<T>

    Returns void

  • Checks if listener is added to an event type.

    Type Parameters

    • T

    Parameters

    • _type: EventType<T>
    • _listener: Listener<T>

    Returns boolean

  • Removes a listener from listening list.

    Type Parameters

    • T

    Parameters

    • _type: EventType<T>
    • _listener: Listener<T>

    Returns void

  • Active the event and call the registered listener.

    Parameters

    • type: EventType<never>

    Returns void

  • Type Parameters

    • T

    Parameters

    • type: EventType<T>
    • payload: T

    Returns void

  • Removes all listeners from listening list.

    Returns void