Options
All
  • Public
  • Public/Protected
  • All
Menu

Class NgxAbstractMaterialComponent

NgxAbstractMaterialComponent

See the ngx3js docs page for details. See the ngx material page for a live demo.

Common Three Type Common Type Key Acceptable Input
Boolean alphaToCoverage true, false
THREE.Blending blending NoBlending, NormalBlending, AdditiveBlending, SubtractiveBlending, MultiplyBlending, CustomBlending
THREE.BlendingDstFactor blendDst ZeroFactor, OneFactor, SrcColorFactor, OneMinusSrcColorFactor, SrcAlphaFactor, OneMinusSrcAlphaFactor, DstAlphaFactor, OneMinusDstAlphaFactor, DstColorFactor, OneMinusDstColorFactor
Number blendDstAlpha 0.0~1.0
THREE.BlendingEquation blendEquation AddEquation, SubtractEquation, ReverseSubtractEquation, MinEquation, MaxEquation
Number blendEquationAlpha 0.0~1.0
THREE.BlendingSrcFactor blendSrc SrcAlphaSaturateFactor
Number blendSrcAlpha 0.0~1.0
Boolean clipIntersection true, false
THREE.Plane[] clippingPlanes Array
Boolean clipShadows true, false
Boolean colorWrite true, false
Any defines any
THREE.DepthModes depthFunc NeverDepth, AlwaysDepth, LessDepth, LessEqualDepth, EqualDepth, GreaterEqualDepth, NotEqualDepth
Boolean depthTest true, false
Boolean depthWrite true, false
Boolean fog true, false
Number opacity 0.0~1.0
Boolean polygonOffset true, false
Number polygonOffsetFactor any
Number polygonOffsetUnits any
String precision highp, mediump, lowp
Number premultipliedAlpha any
Boolean dithering true, false
THREE.Side shadowSide FrontSide, BackSide, DoubleSide
Boolean toneMapped true, false
Boolean transparent true, false
Boolean stencilWrite true, false
THREE.StencilFunc stencilFunc NeverStencilFunc, LessStencilFunc, EqualStencilFunc, LessEqualStencilFunc, GreaterStencilFunc, NotEqualStencilFunc, GreaterEqualStencilFunc, AlwaysStencilFunc
Number stencilRef any
Number stencilWriteMask any
Number stencilFuncMask any
THREE.StencilOp stencilFail ZeroStencilOp, KeepStencilOp, ReplaceStencilOp, IncrementStencilOp, DecrementStencilOp, IncrementWrapStencilOp, DecrementWrapStencilOp, InvertStencilOp
THREE.StencilOp stencilZFail ZeroStencilOp, KeepStencilOp, ReplaceStencilOp, IncrementStencilOp, DecrementStencilOp, IncrementWrapStencilOp, DecrementWrapStencilOp, InvertStencilOp
THREE.StencilOp stencilZPass ZeroStencilOp, KeepStencilOp, ReplaceStencilOp, IncrementStencilOp, DecrementStencilOp, IncrementWrapStencilOp, DecrementWrapStencilOp, InvertStencilOp
Boolean alphaTest true, false
THREE.Side side FrontSide, BackSide, DoubleSide
Boolean vertexColors true, false
Boolean visible true, false
_@Component({
providers: [
{
provide: NgxAbstractMaterialComponent,
useExisting: forwardRef(() => NgxXxxComponent),
},
{
provide: NgxAbstractSubscribeComponent,
useExisting: forwardRef(() => NgxXxxComponent),
}
],
})
export class NgxXxxComponent extends NgxAbstractMaterialComponent implements OnInit {
constructor() {
super();
}
}

Hierarchy

Implements

  • OnInit
  • OnChanges
  • AfterContentInit
  • OnDestroy

Index

Constructors

constructor

Properties

Protected MATERIAL_ATTR

MATERIAL_ATTR: string[] = ...

The base attribute can be fine without re-make Material

Protected OBJECT_ATTR

OBJECT_ATTR: string[] = ...

Object attr of abstract subscribe component

Protected _changeList

_changeList: string[] = null

Change list of abstract subscribe component

Protected _needUpdate

_needUpdate: boolean = true

Need update of abstract subscribe component

alphaTest

alphaTest: number = null

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. Default is 0.

alphaToCoverage

alphaToCoverage: boolean = null

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.

blendDst

blendDst: string = null

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.

Three Type Value String(case insensitive)
THREE.ZeroFactor ZeroFactor , Zero
THREE.OneFactor OneFactor , One
THREE.SrcColorFactor SrcColorFactor , SrcColor
THREE.OneMinusSrcColorFactor OneMinusSrcColorFactor , OneMinusSrcColor
THREE.SrcAlphaFactor SrcAlphaFactor , SrcAlpha
THREE.OneMinusSrcAlphaFactor OneMinusSrcAlphaFactor , OneMinusSrcAlpha
THREE.DstAlphaFactor DstAlphaFactor , DstAlpha
THREE.OneMinusDstAlphaFactor OneMinusDstAlphaFactor , OneMinusDstAlpha
THREE.DstColorFactor DstColorFactor , DstColor
THREE.OneMinusDstColorFactor OneMinusDstColorFactor , OneMinusDstColor

blendDstAlpha

blendDstAlpha: number = null

The transparency of the Material.blendDst. Uses Material.blendDst value if null. Default is null.

blendEquation

blendEquation: string = null

Blending equation to use when applying blending. Default is AddEquation. See the blending equation constants for all possible values. The material's blending must be set to CustomBlending for this to have any effect.

Three Type Value String(case insensitive)
THREE.AddEquation AddEquation , Add
THREE.SubtractEquation SubtractEquation , Subtract
THREE.ReverseSubtractEquation ReverseSubtractEquation , ReverseSubtract
THREE.MinEquation MinEquation , Min
THREE.MaxEquation MaxEquation , Max

blendEquationAlpha

blendEquationAlpha: number = null

The transparency of the Material.blendEquation. Uses Material.blendEquation value if null. Default is null.

blendSrc

blendSrc: string = null

Blending source. Default is SrcAlphaFactor. See the source factors constants for all possible values. The material's blending must be set to CustomBlending for this to have any effect.

Three Type Value String(case insensitive)
THREE.NoBlending NoBlending , No
THREE.NormalBlending NormalBlending , Normal
THREE.AdditiveBlending AdditiveBlending , Additive
THREE.SubtractiveBlending SubtractiveBlending , Subtractive
THREE.MultiplyBlending MultiplyBlending , Multiply
THREE.CustomBlending CustomBlending , Custom

blendSrcAlpha

blendSrcAlpha: number = null

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

blending

blending: string = null

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.

Three Type Value String(case insensitive)
THREE.NoBlending NoBlending, No
THREE.NormalBlending NormalBlending, Normal
THREE.AdditiveBlending AdditiveBlending, Additive
THREE.SubtractiveBlending SubtractiveBlending, Subtractive
THREE.MultiplyBlending MultiplyBlending, Multiply
THREE.CustomBlending CustomBlending, Custom

clipIntersection

clipIntersection: boolean = null

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

clipShadows

clipShadows: boolean = null

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

clippingPlanes

clippingPlanes: I3JS.Plane[] | NgxPlaneComponent[] = null

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). This requires WebGLRenderer.localClippingEnabled to be true. See the [example:webgl_clipping_intersection WebGL / clipping /intersection] example. Default is null.

Protected clippingPlanesList

clippingPlanesList: QueryList<NgxPlaneComponent>

Content children of abstract material component

colorWrite

colorWrite: boolean = null

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.

control

control: any = null

The control of abstract material component

debug

debug: boolean = false

Debug this Object

defines

defines: any = null

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.

depthFunc

depthFunc: string = null

Which depth function to use. Default is LessEqualDepth. See the depth mode constants for all possible values.

Three Type Value String(case insensitive)
THREE.NeverDepth NeverDepth , Never
THREE.AlwaysDepth AlwaysDepth , Always
THREE.LessDepth LessDepth , Less
THREE.LessEqualDepth LessEqualDepth , LessEqual
THREE.EqualDepth EqualDepth , Equal
THREE.GreaterEqualDepth GreaterEqualDepth , GreaterEqual
THREE.GreaterDepth GreaterDepth , Greater
THREE.NotEqualDepth NotEqualDepth , NotEqual

depthTest

depthTest: boolean = null

Whether to have depth test enabled when rendering this material. Default is true.

depthWrite

depthWrite: boolean = null

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.

dithering

dithering: boolean = null

Whether to apply dithering to the color to remove the appearance of banding. Default is false.

enabled

enabled: boolean = true

Enabled or Not

fog

fog: boolean = null

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

Protected id

id: string = ''

The Id of abstract subscribe component

Protected material

material: I3JS.Material = null

The Material of abstract material component

materialType

materialType: string = 'material'

The Material type. can be material, background etc.

name

name: string = null

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

onBeforeCompile

onBeforeCompile: (shader: Shader, renderer?: I3JS.WebGLRenderer) => void = null

Type declaration

    • An 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.

      Parameters

      Returns void

onDestory

onDestory: EventEmitter<NgxAbstractMaterialComponent> = ...

Will be called when before destory. The argument will be the loaded self

onLoad

onLoad: EventEmitter<NgxAbstractMaterialComponent> = ...

Will be called when load completes. The argument will be the loaded self

opacity

opacity: number = null

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. Default is 1.0.

overrideParams

overrideParams: {} = null

The override params

Type declaration

  • [key: string]: any

Protected parent

parent: any = null

The Parent of abstract subscribe component

polygonOffset

polygonOffset: boolean = null

Whether to use polygon offset. Default is false. This corresponds to the GL_POLYGON_OFFSET_FILL WebGL feature.

polygonOffsetFactor

polygonOffsetFactor: number = null

Sets the polygon offset factor. Default is 0.

polygonOffsetUnits

polygonOffsetUnits: number = null

Sets the polygon offset units. Default is 0.

precision

precision: string = null

Override the renderer's default precision for this material. Can be "highp", "mediump" or "lowp". Default is null.

Notice - case insensitive.

premultipliedAlpha

premultipliedAlpha: boolean = null

Whether to premultiply the alpha (transparency) value. See [Example:webgl_materials_physical_transmission WebGL / Materials / Physical / Transmission] for an example of the difference. Default is false.

highp, mediump, lowp

refIndex

refIndex: number = -1

The refIndex of material component

if the material of mesh is array use this index

refName

refName: string | string[] = null

The refName of material component

refer

refer: any = null

The refer Material. When this value is not null will override the material with clone.

Protected selfAny

selfAny: any = ...

shadowSide

shadowSide: string = null

Defines which side of faces cast shadows. When set, can be THREE.FrontSide, THREE.BackSide, or THREE.DoubleSide. Default is null. If null, the side casting shadows is determined as follows:

Three Type Value String(case insensitive)
THREE.FrontSide FrontSide , Front
THREE.BackSide BackSide , Back
THREE.DoubleSide DoubleSide , Double

side

side: string = null

Defines which side of faces will be rendered - front, back or both. Default is THREE.FrontSide. Other options are THREE.BackSide and THREE.DoubleSide.

Three Type Value String(case insensitive)
THREE.FrontSide FrontSide , Front
THREE.BackSide BackSide , Back
THREE.DoubleSide DoubleSide , Double

stencilFail

stencilFail: string = null

Which stencil operation to perform when the comparison function returns false. Default is KeepStencilOp. See the stencil operations constants for all possible values.

Three Type Value String(case insensitive)
THREE.ZeroStencilOp ZeroStencilOp , ZeroStencil
THREE.KeepStencilOp KeepStencilOp , KeepStencil
THREE.ReplaceStencilOp ReplaceStencilOp , ReplaceStencil
THREE.IncrementStencilOp IncrementStencilOp , IncrementStencil
THREE.DecrementStencilOp DecrementStencilOp , DecrementStencil
THREE.IncrementWrapStencilOp IncrementWrapStencilOp , IncrementWrapStencil
THREE.DecrementWrapStencilOp DecrementWrapStencilOp , DecrementWrapStencil
THREE.InvertStencilOp InvertStencilOp , InvertStencil

stencilFunc

stencilFunc: string = null

The stencil comparison function to use. Default is AlwaysStencilFunc. See stencil function constants for all possible values.

Notice - case insensitive.

stencilFuncMask

stencilFuncMask: number = null

The bit mask to use when comparing against the stencil buffer. Default is 0xFF.

stencilRef

stencilRef: number = null

The value to use when performing stencil comparisons or stencil operations. Default is 0.

Three Type Value String(case insensitive)
THREE.NeverStencilFunc NeverStencilFunc , NeverStencil
THREE.LessStencilFunc LessStencilFunc , LessStencil
THREE.EqualStencilFunc EqualStencilFunc , EqualStencil
THREE.LessEqualStencilFunc LessEqualStencilFunc , LessEqualStencil
THREE.GreaterStencilFunc GreaterStencilFunc , GreaterStencil
THREE.NotEqualStencilFunc NotEqualStencilFunc , NotEqualStencil
THREE.GreaterEqualStencilFunc GreaterEqualStencilFunc , GreaterEqualStencil
THREE.AlwaysStencilFunc AlwaysStencilFunc , AlwaysStencil

stencilWrite

stencilWrite: boolean = null

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. Default is false.

stencilWriteMask

stencilWriteMask: number = null

The bit mask to use when writing to the stencil buffer. Default is 0xFF.

stencilZFail

stencilZFail: string = null

Which stencil operation to perform when the comparison function returns true but the depth test fails. Default is KeepStencilOp. See the stencil operations constants for all possible values.

Three Type Value String(case insensitive)
THREE.ZeroStencilOp ZeroStencilOp , ZeroStencil
THREE.KeepStencilOp KeepStencilOp , KeepStencil
THREE.ReplaceStencilOp ReplaceStencilOp , ReplaceStencil
THREE.IncrementStencilOp IncrementStencilOp , IncrementStencil
THREE.DecrementStencilOp DecrementStencilOp , DecrementStencil
THREE.IncrementWrapStencilOp IncrementWrapStencilOp , IncrementWrapStencil
THREE.DecrementWrapStencilOp DecrementWrapStencilOp , DecrementWrapStencil
THREE.InvertStencilOp InvertStencilOp , InvertStencil

stencilZPass

stencilZPass: string = null

Which stencil operation to perform when the comparison function returns true and the depth test passes. Default is KeepStencilOp. See the stencil operations constants for all possible values.

Three Type Value String(case insensitive)
THREE.ZeroStencilOp ZeroStencilOp , ZeroStencil
THREE.KeepStencilOp KeepStencilOp , KeepStencil
THREE.ReplaceStencilOp ReplaceStencilOp , ReplaceStencil
THREE.IncrementStencilOp IncrementStencilOp , IncrementStencil
THREE.DecrementStencilOp DecrementStencilOp , DecrementStencil
THREE.IncrementWrapStencilOp IncrementWrapStencilOp , IncrementWrapStencil
THREE.DecrementWrapStencilOp DecrementWrapStencilOp , DecrementWrapStencil
THREE.InvertStencilOp InvertStencilOp , InvertStencil

Protected subscribeType

subscribeType: string = null

Subscribe type of abstract subscribe component

toneMapped

toneMapped: boolean = null

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

transparent

transparent: boolean = null

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. Default is false.

tween

tween: {} = null

Tween animation params

Type declaration

  • [key: string]: any

userData

userData: any = null

An object that can be used to store custom data about the Object3D. It should not hold references to functions as these will not be cloned.

vertexColors

vertexColors: boolean = null

Defines whether vertex coloring is used. Default is false.

visible

visible: boolean = null

Defines whether this material is visible. Default is true.

windowExport

windowExport: string = null

Export this Object to window global variables

Accessors

needUpdate

  • set needUpdate(value: boolean): void
  • Sets need update

    Parameters

    • value: boolean

    Returns void

Methods

addChanges

  • addChanges(key: string | string[] | SimpleChanges): void

Protected applyChanges

  • applyChanges(changes: string[]): void

Protected callOnLoad

  • callOnLoad(): void

Protected checkChanges

  • checkChanges(changes: SimpleChanges): SimpleChanges

Protected clearChanges

  • clearChanges(): void

Protected consoleLog

  • consoleLog(key: string, object: any, level?: string): void

Protected consoleLogTime

  • consoleLogTime(key: string, object: any, repeat?: number): void

Protected destroyLocalComponent

  • destroyLocalComponent(key: string): void

dispose

  • dispose(): void

Protected getChanges

  • getChanges(): string[]

Protected getClippingPlanes

getId

  • getId(): string

getMaterial

  • getMaterial<T>(): T

Protected getMaterialParameters

getObject

  • getObject<T>(): T

getSubscribe

  • getSubscribe(): Observable<string[]>

Protected getTextureOption

Protected getTimeout

  • getTimeout(timeDelay?: number): Promise<void>

getUserData

  • getUserData(): {}

Protected getVertexColors

  • getVertexColors(def?: boolean): boolean

Protected initLocalComponent

  • initLocalComponent<T>(key: string, component: T): T

Protected isIdEuals

  • isIdEuals(id: string): boolean

isMaterialType

  • isMaterialType(materialType: string): boolean
  • Determines whether material type is

    Parameters

    • materialType: string

    Returns boolean

    true if material type

ngAfterContentInit

  • ngAfterContentInit(): void

ngOnChanges

  • ngOnChanges(changes: SimpleChanges): void
  • A callback method that is invoked immediately after the default change detector has checked the directive's data-bound properties for the first time, and before any of the view or content children have been checked. It is invoked only once when the directive is instantiated. default change detector has checked data-bound properties if at least one has changed, and before the view and content children are checked.

    Parameters

    • changes: SimpleChanges

      The changed properties.

    Returns void

ngOnDestroy

  • ngOnDestroy(): void

ngOnInit

  • ngOnInit(subscribeType?: string): void
  • A callback method that is invoked immediately after the default change detector has checked the directive's data-bound properties for the first time, and before any of the view or content children have been checked. It is invoked only once when the directive is instantiated.

    Parameters

    • Optional subscribeType: string

    Returns void

resetTween

  • resetTween(): void

runSubscribeNext

  • runSubscribeNext(key: string | string[]): void

Protected setMaterial

Protected setObject

  • setObject(obj: any): void

setObject3d

setParent

  • setParent(parent: any): boolean

setSubscribeNext

  • setSubscribeNext(key: string | string[]): void

setSubscribeType

  • setSubscribeType(subscribeType: string): void

setTween

  • setTween(tweenData: {}): void

setTweenTarget

  • setTweenTarget(tweenTarget: any): void

setUserData

  • setUserData(key: string, value: any): void

Protected subscribeListQuery

  • subscribeListQuery(queryList: QueryList<any>, subscribeKey: string, changeKey: string): void

Protected subscribeListQueryChange

  • subscribeListQueryChange(queryList: QueryList<any>, subscribeKey: string, changeKey: string): void

Protected subscribeRefer

  • subscribeRefer(key: string, subscription: Subscription): void

Protected subscribeReferList

  • subscribeReferList(key: string, subscription: Subscription): void

synkObject3d

Protected unSubscribeRefer

  • unSubscribeRefer(key: string): void

Protected unSubscribeReferList

  • unSubscribeReferList(key: string): void

Protected unSubscription

  • unSubscription(subscriptions: Subscription[]): Subscription[]

unsetObject3d

updateInputParams

  • updateInputParams(params: {}, firstChange?: boolean, changes?: SimpleChanges, type?: string): void

Generated using TypeDoc