PBRMetallicRoughnessBlock

Block used to implement the PBR metallic/roughness model

Hierarchy

Index

Constructors

constructor

Find examples in Playground

Properties

alphaTestCutoff

Find examples in Playground
alphaTestCutoff: number

Defines the alpha limits in alpha test mode.

comments

Find examples in Playground
comments: string

Gets or sets the comments associated with this block

debugFactor

Find examples in Playground
debugFactor: number

As the default viewing range might not be enough (if the ambient is really small for instance) You can use the factor to better multiply the final value.

debugLimit

Find examples in Playground
debugLimit: number

Specify from where on screen the debug mode should start. The value goes from -1 (full screen) to 1 (not visible) It helps with side by side comparison against the final render This defaults to 0

debugMode

Find examples in Playground
debugMode: number

Defines the material debug mode. It helps seeing only some components of the material while troubleshooting.

directIntensity

Find examples in Playground
directIntensity: number

Intensity of the direct lights e.g. the four lights available in your scene. This impacts both the direct diffuse and specular highlights.

enableSpecularAntiAliasing

Find examples in Playground
enableSpecularAntiAliasing: boolean

Enables specular anti aliasing in the PBR shader. It will both interacts on the Geometry for analytical and IBL lighting. It also prefilter the roughness map based on the bump values.

environmentIntensity

Find examples in Playground
environmentIntensity: number

Intensity of the environment e.g. how much the environment will light the object either through harmonics for rough material or through the refelction for shiny ones.

forceNormalForward

Find examples in Playground
forceNormalForward: boolean

Force normal to face away from face.

inputsAreExclusive

Find examples in Playground
inputsAreExclusive: boolean

Gets or sets a boolean indicating that only one input can be connected at a time

light

Find examples in Playground
light: Nullable<Light>

Gets or sets the light associated with this block

lightFalloff

Find examples in Playground
lightFalloff: number

Defines the falloff type used in this material. It by default is Physical.

name

Find examples in Playground
name: string

Gets or sets the name of the block

opacityRGB

Find examples in Playground
opacityRGB: boolean

Defines if the alpha value should be determined via the rgb values. If true the luminance of the pixel might be used to find the corresponding alpha value.

realTimeFiltering

Find examples in Playground
realTimeFiltering: boolean

Enables realtime filtering on the texture.

realTimeFilteringQuality

Find examples in Playground
realTimeFilteringQuality: number

Quality switch for realtime filtering

specularIntensity

Find examples in Playground
specularIntensity: number

This is a special control allowing the reduction of the specular highlights coming from the four lights of the scene. Those highlights may not be needed in full environment lighting.

uniqueId

Find examples in Playground
uniqueId: number

Gets or sets the unique id of the node

unlit

Find examples in Playground
unlit: boolean

If set to true, no lighting calculations will be applied.

useAlphaBlending

Find examples in Playground
useAlphaBlending: boolean

Specifies that alpha blending should be used

useAlphaFromAlbedoTexture

Find examples in Playground
useAlphaFromAlbedoTexture: boolean

Specifies that the alpha is coming form the albedo channel alpha channel for alpha blending.

useAlphaTest

Find examples in Playground
useAlphaTest: boolean

Specifies that alpha test should be used

useEnergyConservation

Find examples in Playground
useEnergyConservation: boolean

Defines if the material uses energy conservation.

useHorizonOcclusion

Find examples in Playground
useHorizonOcclusion: boolean

This parameters will enable/disable Horizon occlusion to prevent normal maps to look shiny when the normal makes the reflect vector face the model (under horizon).

useRadianceOcclusion

Find examples in Playground
useRadianceOcclusion: boolean

This parameters will enable/disable radiance occlusion by preventing the radiance to lit too much the area relying on ambient texture to define their ambient occlusion.

useRadianceOverAlpha

Find examples in Playground
useRadianceOverAlpha: boolean

Specifies that the material will keeps the reflection highlights over a transparent surface (only the most luminous ones). A car glass is a good exemple of that. When the street lights reflects on it you can not see what is behind.

useSpecularOverAlpha

Find examples in Playground
useSpecularOverAlpha: boolean

Specifies that the material will keeps the specular highlights over a transparent surface (only the most luminous ones). A car glass is a good exemple of that. When sun reflects on it you can not see what is behind.

Accessors

alpha

Find examples in Playground

ambient

Find examples in Playground

ambientColor

Find examples in Playground

ambientOcclusion

Find examples in Playground

anisotropy

Find examples in Playground

baseColor

Find examples in Playground

buildId

Find examples in Playground
  • get buildId(): number
  • set buildId(value: number): any
  • Gets or sets the build Id

    Returns number

  • Gets or sets the build Id

    Parameters

    • value: number

    Returns any

cameraPosition

Find examples in Playground

clearcoat

Find examples in Playground

clearcoatDir

Find examples in Playground

clearcoatIndirect

Find examples in Playground

diffuse

Find examples in Playground

diffuseIndirect

Find examples in Playground

inputs

Find examples in Playground

isFinalMerger

Find examples in Playground
  • get isFinalMerger(): boolean
  • Gets a boolean indicating that this block is an end block (e.g. it is generating a system value)

    Returns boolean

isInput

Find examples in Playground
  • get isInput(): boolean
  • Gets a boolean indicating that this block is an input (e.g. it sends data to the shader)

    Returns boolean

isUnique

Find examples in Playground
  • get isUnique(): boolean
  • Gets a boolean indicating that this block can only be used once per NodeMaterial

    Returns boolean

lighting

Find examples in Playground

opacityTexture

Find examples in Playground

outputs

Find examples in Playground

perturbedNormal

Find examples in Playground

reflection

Find examples in Playground

reflectivity

Find examples in Playground

refraction

Find examples in Playground

shadow

Find examples in Playground

sheen

Find examples in Playground

sheenDir

Find examples in Playground

sheenIndirect

Find examples in Playground

specular

Find examples in Playground

specularIndirect

Find examples in Playground

subsurface

Find examples in Playground

target

Find examples in Playground

worldNormal

Find examples in Playground

worldPosition

Find examples in Playground

Methods

_deserialize

Find examples in Playground
  • _deserialize(serializationObject: any, scene: Scene, rootUrl: string): void
  • Parameters

    • serializationObject: any
    • scene: Scene
    • rootUrl: string

    Returns void

autoConfigure

Find examples in Playground

bind

Find examples in Playground

build

Find examples in Playground
  • Compile the current node and generate the shader code

    Parameters

    • state: NodeMaterialBuildState

      defines the current compilation state (uniforms, samplers, current string)

    • activeBlocks: NodeMaterialBlock[]

      defines the list of active blocks (i.e. blocks to compile)

    Returns boolean

    true if already built

clone

Find examples in Playground
  • Clone the current block to a new identical block

    Parameters

    • scene: Scene

      defines the hosting scene

    • Optional rootUrl: string

      defines the root URL to use to load textures and relative dependencies

    Returns Nullable<NodeMaterialBlock>

    a copy of the current block

connectTo

Find examples in Playground
  • Connect current block with another block

    Parameters

    • other: NodeMaterialBlock

      defines the block to connect with

    • Optional options: object

      define the various options to help pick the right connections

      • Optional input?: string
      • Optional output?: string
      • Optional outputSwizzle?: string

    Returns this | undefined

    the current block

dispose

Find examples in Playground
  • dispose(): void

getAlbedoOpacityCode

Find examples in Playground
  • getAlbedoOpacityCode(): string
  • Gets the code corresponding to the albedo/opacity module

    Returns string

    the shader code

getClassName

Find examples in Playground
  • getClassName(): string

getFirstAvailableInput

Find examples in Playground

getFirstAvailableOutput

Find examples in Playground

getInputByName

Find examples in Playground

getOutputByName

Find examples in Playground

getSiblingOutput

Find examples in Playground

initialize

Find examples in Playground

initializeDefines

Find examples in Playground
  • initializeDefines(mesh: AbstractMesh, nodeMaterial: NodeMaterial, defines: NodeMaterialDefines, useInstances?: boolean): void
  • Initialize defines for shader compilation

    Parameters

    • mesh: AbstractMesh

      defines the mesh to be rendered

    • nodeMaterial: NodeMaterial

      defines the node material requesting the update

    • defines: NodeMaterialDefines

      defines the material defines to update

    • Optional useInstances: boolean

      specifies that instances should be used

    Returns void

isReady

Find examples in Playground
  • isReady(mesh: AbstractMesh, nodeMaterial: NodeMaterial, defines: NodeMaterialDefines, useInstances?: boolean): boolean
  • Checks if the block is ready

    Parameters

    • mesh: AbstractMesh

      defines the mesh to be rendered

    • nodeMaterial: NodeMaterial

      defines the node material requesting the update

    • defines: NodeMaterialDefines

      defines the material defines to update

    • Optional useInstances: boolean

      specifies that instances should be used

    Returns boolean

    true if the block is ready

prepareDefines

Find examples in Playground

provideFallbacks

Find examples in Playground

registerInput

Find examples in Playground
  • Register a new input. Must be called inside a block constructor

    Parameters

    • name: string

      defines the connection point name

    • type: NodeMaterialBlockConnectionPointTypes

      defines the connection point type

    • Optional isOptional: boolean

      defines a boolean indicating that this input can be omitted

    • Optional target: NodeMaterialBlockTargets

      defines the target to use to limit the connection point (will be VertexAndFragment by default)

    • Optional point: NodeMaterialConnectionPoint

      an already created connection point. If not provided, create a new one

    Returns this

    the current block

registerOutput

Find examples in Playground

replaceRepeatableContent

Find examples in Playground
  • Function called when a block is declared as repeatable content generator

    Parameters

    • vertexShaderState: NodeMaterialBuildState

      defines the current compilation state for the vertex shader

    • fragmentShaderState: NodeMaterialBuildState

      defines the current compilation state for the fragment shader

    • mesh: AbstractMesh

      defines the mesh to be rendered

    • defines: NodeMaterialDefines

      defines the material defines to update

    Returns void

serialize

Find examples in Playground
  • serialize(): any

updateUniformsAndSamples

Find examples in Playground

Generated using TypeDoc