Options
All
  • Public
  • Public/Protected
  • All
Menu

Class P3dMaterial

Hierarchy

  • P3dValueCached
    • P3dMaterial

Index

Accessors

alphaClip

  • get alphaClip(): number
  • set alphaClip(value: number): void
  • Alpha clip / "cut off": Material parts with lower than this alpha value will not be rendered.

    Returns number

  • Alpha clip / "cut off": Material parts with lower than this alpha value will not be rendered.

    Parameters

    • value: number

    Returns void

baseColor

  • get baseColor(): string
  • set baseColor(value: P3dColor): void
  • Color / albedo value

    Color values are hexadecimal strings. Eg. fff or ffffff for white.

    You can however also assign an array of red, green and blue floating point values, i.e. [1.0, 1.0, 1.0]. This will be converted to hex color automatically.

    Returns string

  • Color / albedo value

    Color values are hexadecimal strings. Eg. fff or ffffff for white.

    You can however also assign an array of red, green and blue floating point values, i.e. [1.0, 1.0, 1.0]. This will be converted to hex color automatically.

    Parameters

    Returns void

baseColorAlpha

  • get baseColorAlpha(): number
  • set baseColorAlpha(value: number): void
  • Color alpha

    Returns number

  • Color alpha

    Parameters

    • value: number

    Returns void

baseColorFactor

  • get baseColorFactor(): number
  • set baseColorFactor(value: number): void
  • Color factor

    Returns number

  • Color factor

    Parameters

    • value: number

    Returns void

baseColorTexture

bumpFactor

  • get bumpFactor(): number
  • set bumpFactor(value: number): void
  • Bump map texture factor

    Returns number

  • Bump map texture factor

    Parameters

    • value: number

    Returns void

bumpTexture

clearCoat

  • get clearCoat(): number
  • set clearCoat(value: number): void
  • Clear coat amount. This is a reflective layer on top of the material

    Returns number

  • Clear coat amount. This is a reflective layer on top of the material

    Parameters

    • value: number

    Returns void

clearCoatRoughness

  • get clearCoatRoughness(): number
  • set clearCoatRoughness(value: number): void
  • Clear coat roughness

    Returns number

  • Clear coat roughness

    Parameters

    • value: number

    Returns void

doubleSided

  • get doubleSided(): boolean
  • set doubleSided(value: boolean): void
  • Whether material is rendered on both sides or just on the front side of mesh

    Returns boolean

  • Whether material is rendered on both sides or just on the front side of mesh

    Parameters

    • value: boolean

    Returns void

flatShading

  • get flatShading(): boolean
  • set flatShading(value: boolean): void
  • Shade each mesh face as flat

    Returns boolean

  • Shade each mesh face as flat

    Parameters

    • value: boolean

    Returns void

glowColor

  • get glowColor(): string
  • set glowColor(value: P3dColor): void
  • Glow / emissive color

    Returns string

  • Glow / emissive color

    Parameters

    Returns void

glowFactor

  • get glowFactor(): number
  • set glowFactor(value: number): void
  • Glow / emissive factor

    Returns number

  • Glow / emissive factor

    Parameters

    • value: number

    Returns void

glowTexture

  • Glow / emissive texture

    Returns P3dTexture

  • Glow / emissive texture

    Parameters

    Returns void

highlight

  • get highlight(): number
  • set highlight(value: number): void
  • Highlight factor

    This is value between -1.0 and 1.0 that can be used to highlight materials by making them darker (negative values) or brighter (positive values).

    Returns number

  • Highlight factor

    This is value between -1.0 and 1.0 that can be used to highlight materials by making them darker (negative values) or brighter (positive values).

    Parameters

    • value: number

    Returns void

id

  • get id(): string
  • Unique string identifier for the object

    Returns string

isVisible

  • get isVisible(): boolean
  • set isVisible(value: boolean): void
  • If false, then material will not be rendered

    Returns boolean

  • If false, then material will not be rendered

    Parameters

    • value: boolean

    Returns void

metalness

  • get metalness(): number
  • set metalness(value: number): void
  • PBR Metalness factor

    Returns number

  • PBR Metalness factor

    Parameters

    • value: number

    Returns void

metalnessTexture

  • PBR Metalness texture

    Returns P3dTexture

  • PBR Metalness texture

    Parameters

    Returns void

name

  • get name(): string
  • Material name

    Returns string

normalFactor

  • get normalFactor(): number
  • set normalFactor(value: number): void
  • Normal map texture factor

    Returns number

  • Normal map texture factor

    Parameters

    • value: number

    Returns void

normalTexture

  • Normal map texture

    Returns P3dTexture

  • Normal map texture

    Parameters

    Returns void

roughness

  • get roughness(): number
  • set roughness(value: number): void
  • PRB roughness factor

    Returns number

  • PRB roughness factor

    Parameters

    • value: number

    Returns void

roughnessTexture

  • PBR Roughness texture

    Returns P3dTexture

  • PBR Roughness texture

    Parameters

    Returns void

sheenFactor

  • get sheenFactor(): number
  • set sheenFactor(value: number): void
  • Sheen factor

    Returns number

  • Sheen factor

    Parameters

    • value: number

    Returns void

sheenTexture

Methods

hexColorToRGB

  • hexColorToRGB(hex: string): number[]
  • Helper function to convert hex string color to RGB value array so it is easier to manipulate

    const rgb = material.hexColorToRGB(material.baseColor);
    console.log(rgb[0], rgb[1], rgb[2]);
    

    Parameters

    • hex: string

    Returns number[]

Generated using TypeDoc