FatLineMaterial

This material is specifically used to draw line or dash-line which has width more than 1 pixel.

Core Class

This material is specifically used to draw line or dash-line which has width more than 1 pixel.

Extends

  • SceneClipMaterial

Constructors

Constructor

new FatLineMaterial(p?): FatLineMaterial

Parameters

p?

FatLineMaterialParameter

Returns

FatLineMaterial

Overrides

SceneClipMaterial.constructor

Properties

isDynamicShape

isDynamicShape: boolean

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

Deprecated

Inherited from

SceneClipMaterial.isDynamicShape


isVolumeRendering

isVolumeRendering: boolean

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

Deprecated

Inherited from

SceneClipMaterial.isVolumeRendering


MAX_TEXTURES

readonly static MAX_TEXTURES: 6 = 6

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

Inherited from

SceneClipMaterial.MAX_TEXTURES


name

name: string

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

Inherited from

SceneClipMaterial.name


id

id: number

Unique number for this material instance.

Inherited from

SceneClipMaterial.id


transparent

transparent: boolean

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

Default Value

false

Inherited from

SceneClipMaterial.transparent


visible

visible: boolean

Defines whether this material is visible.

Default Value

true

Inherited from

SceneClipMaterial.visible


programId

programId: number

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

Inherited from

SceneClipMaterial.programId


side

side: Side

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

Inherited from

SceneClipMaterial.side


blending

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.

Default Value

NormalBlending

Inherited from

SceneClipMaterial.blending


blendSrc

blendSrc: BlendingFactor

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

Default Value

SrcAlphaFactor

Inherited from

SceneClipMaterial.blendSrc


blendDst

blendDst: BlendingFactor

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

Default Value

OneMinusSrcAlpha

Inherited from

SceneClipMaterial.blendDst


blendEquation

blendEquation: BlendingEquation

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

Default Value

Add

Inherited from

SceneClipMaterial.blendEquation


blendSrcAlpha

blendSrcAlpha: Nullable<BlendingFactor>

The transparency of the blendSrc.

Inherited from

SceneClipMaterial.blendSrcAlpha


blendDstAlpha

blendDstAlpha: Nullable<BlendingFactor>

The transparency of the blendDst.

Inherited from

SceneClipMaterial.blendDstAlpha


blendEquationAlpha

blendEquationAlpha: Nullable<BlendingEquation>

The transparency of the blendEquation.

Inherited from

SceneClipMaterial.blendEquationAlpha


stencilWrite

stencilWrite: boolean

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

Default Value

false

Inherited from

SceneClipMaterial.stencilWrite


stencilWriteMask

stencilWriteMask: number

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

Default Value

0xFF

Inherited from

SceneClipMaterial.stencilWriteMask


stencilFuncMask

stencilFuncMask: number

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

Default Value

0xFF

Inherited from

SceneClipMaterial.stencilFuncMask


stencilFunc

stencilFunc: StencilFunc

The stencil comparison function to use.

Default Value

AlwaysStencilFunc

Inherited from

SceneClipMaterial.stencilFunc


stencilRef

stencilRef: number

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

Default Value

0

Inherited from

SceneClipMaterial.stencilRef


stencilFail

stencilFail: StencilOp

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

Default Value

KeepStencilOp

Inherited from

SceneClipMaterial.stencilFail


stencilZFail

stencilZFail: StencilOp

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

Default Value

KeepStencilOp

Inherited from

SceneClipMaterial.stencilZFail


stencilZPass

stencilZPass: StencilOp

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

Default Value

KeepStencilOp

Inherited from

SceneClipMaterial.stencilZPass


depthFunc

depthFunc: DepthModes

Which depth function to use.

Default Value

LessEqualDepth

Inherited from

SceneClipMaterial.depthFunc


depthTest

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.

Default Value

true

Inherited from

SceneClipMaterial.depthTest


depthWrite

depthWrite: boolean

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

Default Value

true

Inherited from

SceneClipMaterial.depthWrite


colorWrite

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.

Default Value

true

Inherited from

SceneClipMaterial.colorWrite


colorWriteMasks

colorWriteMasks: [boolean, boolean, boolean, boolean]

Inherited from

SceneClipMaterial.colorWriteMasks


polygonOffset

polygonOffset: boolean

Whether to use polygon offset.

Default Value

false

Inherited from

SceneClipMaterial.polygonOffset


polygonOffsetFactor

polygonOffsetFactor: number

Sets the polygon offset factor.

Default Value

0

Inherited from

SceneClipMaterial.polygonOffsetFactor


polygonOffsetUnits

polygonOffsetUnits: number

Sets the polygon offset units.

Default Value

0

Inherited from

SceneClipMaterial.polygonOffsetUnits


premultipliedAlpha

premultipliedAlpha: boolean

Whether to premultiply the alpha (transparency) value.

Default Value

false

Inherited from

SceneClipMaterial.premultipliedAlpha


colorWriteMask

colorWriteMask: [boolean, boolean, boolean, boolean]

Inherited from

SceneClipMaterial.colorWriteMask


enableSceneClipping

enableSceneClipping: boolean

Inherited from

SceneClipMaterial.enableSceneClipping


fallback

fallback: LineMaterial


color

color: ColorWithAlpha


enableDash

enableDash: boolean


dash

dash: LineDash


fatLineWidth

fatLineWidth: number


enableViewIndependentDashScale

enableViewIndependentDashScale: boolean


onBeforeRender

onBeforeRender: (renderer) => void

This method will be used automatically before

Parameters

renderer

Renderer

instance of renderer for engine.

Returns

void

Overrides

SceneClipMaterial.onBeforeRender


userData

readonly userData: Record<keyof any, any>

Inherited from

SceneClipMaterial.userData


_uuid

_uuid: any

Inherited from

SceneClipMaterial._uuid


uuid

uuid: string

Inherited from

SceneClipMaterial.uuid


_listeners

_listeners: Map<Symbol, Listener<never>[]>

Inherited from

SceneClipMaterial._listeners

Accessors

businessTag

Get Signature

get businessTag(): string

Returns

string

Set Signature

set businessTag(v): void

Parameters
v

string

Returns

void

Inherited from

SceneClipMaterial.businessTag

Methods

getComponents()

getComponents(): readonly ShaderComponent[]

Returns

readonly ShaderComponent[]

Inherited from

SceneClipMaterial.getComponents


deleteComponent()

deleteComponent(index): void

Parameters

index

number

Returns

void

Inherited from

SceneClipMaterial.deleteComponent


addComponent()

addComponent(c, index?): void

Parameters

c

ShaderComponent

index?

number

Returns

void

Inherited from

SceneClipMaterial.addComponent


refreshInstanceInBuilding()

refreshInstanceInBuilding(enable): void

Parameters

enable

boolean

Returns

void

Inherited from

SceneClipMaterial.refreshInstanceInBuilding


setColorWriteMasks()

setColorWriteMasks(r, g, b, a): void

Parameters

r

boolean

g

boolean

b

boolean

a

boolean

Returns

void

Inherited from

SceneClipMaterial.setColorWriteMasks


notifyMaterialPropertyChanged()

notifyMaterialPropertyChanged(): void

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

Returns

void

Inherited from

SceneClipMaterial.notifyMaterialPropertyChanged


getUUID()

getUUID(): string

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

Returns

string

Inherited from

SceneClipMaterial.getUUID


notifyRecompileShader()

notifyRecompileShader(): void

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

Returns

void

Inherited from

SceneClipMaterial.notifyRecompileShader


copyBase()

copyBase(other): void

Copy basic properties from other material.

Parameters

other

Material

the source of copied data

Returns

void

Inherited from

SceneClipMaterial.copyBase


destroyAllResourcesOwned()

destroyAllResourcesOwned(): void

Returns

void

Inherited from

SceneClipMaterial.destroyAllResourcesOwned


freeAllGpuResourceOwned()

freeAllGpuResourceOwned(): void

Returns

void

Inherited from

SceneClipMaterial.freeAllGpuResourceOwned


freeGPU()

freeGPU(): void

Make engine clear the current material’s data in Ubo.

Returns

void

Inherited from

SceneClipMaterial.freeGPU


className()

className(): string

The name of instance’s class.

Returns

string

Overrides

SceneClipMaterial.className


generateShaderKey()

generateShaderKey(r): string

Parameters

r

ShaderComponentRegistry

Returns

string

Overrides

SceneClipMaterial.generateShaderKey


setValues()

setValues(p?): void

Sets the properties with the given values. In extents class, this method need to override in extended material for corresponding parameters.

Parameters

p?

FatLineMaterialParameter

Returns

void

Overrides

SceneClipMaterial.setValues


updateShapeUniforms()

updateShapeUniforms(program, r): void

Parameters

program

WGLProgram

r

ShaderComponentRegistry

Returns

void

Overrides

SceneClipMaterial.updateShapeUniforms


computeShapeKey()

computeShapeKey(r): string

Parameters

r

ShaderComponentRegistry

Returns

string

Overrides

SceneClipMaterial.computeShapeKey


extendShaderShape()

extendShaderShape(builder, registry): void

Parameters

builder

ShaderBuilder

registry

ShaderComponentRegistry

Returns

void

Overrides

SceneClipMaterial.extendShaderShape


copy()

copy(other): this

abstract function to copy a same type material instance

Parameters

other

FatLineMaterial

Returns

this

Overrides

SceneClipMaterial.copy


serialize()

serialize(ctx): void

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

Parameters

ctx

Serializer

this parameter has not supported external Serializer yet. It may cause that this method can not be used directly.

Returns

void

Overrides

SceneClipMaterial.serialize


deserialize()

deserialize(ctx): void

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

Parameters

ctx

Deserializer

this parameter has not supported external Deserializer yet. It may cause that this method can not be used directly.

Returns

void

Overrides

SceneClipMaterial.deserialize


clone()

clone(): FatLineMaterial

abstract function to clone each instance of the class

Returns

FatLineMaterial

Overrides

SceneClipMaterial.clone


markBusinessTag()

markBusinessTag(v): this

Parameters

v

string

Returns

this

Inherited from

SceneClipMaterial.markBusinessTag


isDestroyed()

isDestroyed(): boolean

Returns

boolean

Inherited from

SceneClipMaterial.isDestroyed


destroy()

destroy(): void

Returns

void

Inherited from

SceneClipMaterial.destroy


validate()

validate(): void

Returns

void

Inherited from

SceneClipMaterial.validate


on()

on<T>(_type, _listener): void

Adds a listener to an event type.

Type Parameters

T

T

Parameters

_type

EventType<T>

_listener

Listener<T>

Returns

void

Inherited from

SceneClipMaterial.on


once()

once<T>(_type, _listener): void

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

Type Parameters

T

T

Parameters

_type

EventType<T>

_listener

Listener<T>

Returns

void

Inherited from

SceneClipMaterial.once


has()

has<T>(_type, _listener): boolean

Checks if listener is added to an event type.

Type Parameters

T

T

Parameters

_type

EventType<T>

_listener

Listener<T>

Returns

boolean

Inherited from

SceneClipMaterial.has


off()

off<T>(_type, _listener): void

Removes a listener from listening list.

Type Parameters

T

T

Parameters

_type

EventType<T>

_listener

Listener<T>

Returns

void

Inherited from

SceneClipMaterial.off


emit()

Call Signature

emit(type): void

Active the event and call the registered listener.

Parameters
type

EventType<never>

Returns

void

Inherited from

SceneClipMaterial.emit

Call Signature

emit<T>(type, payload): void

Type Parameters
T

T

Parameters
type

EventType<T>

payload

T

Returns

void

Inherited from

SceneClipMaterial.emit


clearAllListeners()

clearAllListeners(): void

Removes all listeners from listening list.

Returns

void

Inherited from

SceneClipMaterial.clearAllListeners