Options
All
  • Public
  • Public/Protected
  • All
Menu

Configures the normal rendered appearance of Meshes using the non-physically-correct Blinn-Phong shading model.

Hierarchy

Index

Constructors

Properties

id: string

ID of this Component, unique within the Scene.

Components are mapped by this ID in {@link Scene.components}.

property

id

meta: any

Arbitrary, user-defined metadata on this component.

property

metadata

scene: Scene

The parent Scene that contains this Component.

property

scene

final
viewer: Viewer

The viewer that contains this Scene.

property

viewer

Accessors

  • get alpha(): number
  • set alpha(arg: number): void
  • get alphaCutoff(): number
  • set alphaCutoff(arg: number): void
  • Gets the PhongMaterial's alpha cutoff value.

    This specifies the cutoff threshold when PhongMaterial.alphaMode equals "mask". If the alpha is greater than or equal to this value then it is rendered as fully opaque, otherwise, it is rendered as fully transparent. A value greater than 1.0 will render the entire material as fully transparent. This value is ignored for other modes.

    Alpha is the combined result of PhongMaterial.alpha and PhongMaterial.alphaMap.

    Default value is 0.5.

    Returns number

  • Sets the PhongMaterial's alpha cutoff value.

    This specifies the cutoff threshold when PhongMaterial.alphaMode equals "mask". If the alpha is greater than or equal to this value then it is rendered as fully opaque, otherwise, it is rendered as fully transparent. A value greater than 1.0 will render the entire material as fully transparent. This value is ignored for other modes.

    Alpha is the combined result of PhongMaterial.alpha and PhongMaterial.alphaMap.

    Default value is 0.5.

    Parameters

    • arg: number

    Returns void

  • get alphaFresnel(): Fresnel
  • get alphaMap(): Texture
  • get alphaMode(): "opaque" | "blend" | "mask"
  • set alphaMode(arg: "opaque" | "blend" | "mask"): void
  • Gets the PhongMaterial's alpha rendering mode.

    This governs how alpha is treated. Alpha is the combined result of PhongMaterial.alpha and PhongMaterial.alphaMap.

    Supported values are:

    • "opaque" - The alpha value is ignored and the rendered output is fully opaque (default).
    • "mask" - The rendered output is either fully opaque or fully transparent depending on the alpha value and the specified alpha cutoff value.
    • "blend" - The alpha value is used to composite the source and destination areas. The rendered output is combined with the background using the normal painting operation (i.e. the Porter and Duff over operator).

    Returns "opaque" | "blend" | "mask"

  • Sets the PhongMaterial's alpha rendering mode.

    This governs how alpha is treated. Alpha is the combined result of PhongMaterial.alpha and PhongMaterial.alphaMap.

    Supported values are:

    • "opaque" - The alpha value is ignored and the rendered output is fully opaque (default).
    • "mask" - The rendered output is either fully opaque or fully transparent depending on the alpha value and the specified alpha cutoff value.
    • "blend" - The alpha value is used to composite the source and destination areas. The rendered output is combined with the background using the normal painting operation (i.e. the Porter and Duff over operator).

    Parameters

    • arg: "opaque" | "blend" | "mask"

    Returns void

  • get ambient(): number[]
  • set ambient(arg: number[]): void
  • get ambientMap(): Texture
  • get backfaces(): boolean
  • set backfaces(arg: boolean): void
  • get diffuse(): number[]
  • set diffuse(arg: number[]): void
  • get diffuseFresnel(): Fresnel
  • get diffuseMap(): Texture
  • get emissive(): number[]
  • set emissive(arg: number[]): void
  • get emissiveFresnel(): Fresnel
  • get emissiveMap(): Texture
  • get frontface(): "cw" | "ccw"
  • set frontface(arg: "cw" | "ccw"): void
  • get lineWidth(): number
  • set lineWidth(arg: number): void
  • get normalMap(): Texture
  • get occlusionMap(): Texture
  • The Component that owns the lifecycle of this Component, if any.

    When that component is destroyed, this component will be automatically destroyed also.

    Will be null if this Component has no owner.

    property

    owner

    Returns Component

  • get pointSize(): number
  • set pointSize(arg: number): void
  • get reflectivity(): number
  • set reflectivity(arg: number): void
  • get reflectivityFresnel(): Fresnel
  • get reflectivityMap(): Texture
  • get shininess(): number
  • set shininess(arg: number): void
  • Gets the PhongMaterial shininess.

    This is a factor in range [0..128] that determines the size and sharpness of the specular highlights create by this PhongMaterial.

    Larger values produce smaller, sharper highlights. A value of 0.0 gives very large highlights that are almost never desirable. Try values close to 10 for a larger, fuzzier highlight and values of 100 or more for a small, sharp highlight.

    Default value is 80.0.

    Returns number

  • Sets the PhongMaterial shininess.

    This is a factor in range [0..128] that determines the size and sharpness of the specular highlights create by this PhongMaterial.

    Larger values produce smaller, sharper highlights. A value of 0.0 gives very large highlights that are almost never desirable. Try values close to 10 for a larger, fuzzier highlight and values of 100 or more for a small, sharp highlight.

    Default value is 80.0.

    Parameters

    • arg: number

    Returns void

  • get specular(): number[]
  • set specular(arg: number[]): void
  • get specularFresnel(): Fresnel
  • get specularMap(): Texture

Methods

  • clear(): void
  • destroy(): void
  • error(message: string): void
  • Logs an error for this component to the JavaScript console.

    The console message will have this format: [ERROR] [<component type> =<component id>: <message>

    Also fires the message as an "error" event on the parent Scene.

    Parameters

    • message: string

      The message to log

    Returns void

  • fire(event: string, value: any, forget?: boolean): void
  • Fires an event on this component.

    Notifies existing subscribers to the event, optionally retains the event to give to any subsequent notifications on the event as they are made.

    Parameters

    • event: string

      The event type name

    • value: any

      The event parameters

    • Optional forget: boolean

    Returns void

  • hasSubs(event: string): boolean
  • Returns true if there are any subscribers to the given event on this component.

    Parameters

    • event: string

      The event

    Returns boolean

    True if there are any subscribers to the given event on this component.

  • isType(type: any): boolean
  • log(message: string): void
  • Logs a console debugging message for this component.

    The console message will have this format: [LOG] [<component type> <component id>: <message>

    Also fires the message as a "log" event on the parent Scene.

    Parameters

    • message: string

      The message to log

    Returns void

  • off(subId: string): void
  • on(event: string, callback: Function, scope?: any): string
  • Subscribes to an event on this component.

    The callback is be called with this component as scope.

    Parameters

    • event: string

      The event

    • callback: Function

      Called fired on the event

    • Optional scope: any

    Returns string

    Handle to the subscription, which may be used to unsubscribe with .off.

  • once(event: string, callback: Function, scope?: any): void
  • Subscribes to the next occurrence of the given event, then un-subscribes as soon as the event is subIdd.

    This is equivalent to calling Component.on, and then calling Component.off inside the callback function.

    Parameters

    • event: string

      Data event to listen to

    • callback: Function

      Called when fresh data is available at the event

    • Optional scope: any

    Returns void

  • warn(message: string): void
  • Logs a warning for this component to the JavaScript console.

    The console message will have this format: [WARN] [<component type> =<component id>: <message>

    Also fires the message as a "warn" event on the parent Scene.

    Parameters

    • message: string

      The message to log

    Returns void

Generated using TypeDoc