Options
All
  • Public
  • Public/Protected
  • All
Menu

Class PBRMetallicRoughnessBlock

Block used to implement the PBR metallic/roughness model

Hierarchy

Index

Constructors

constructor

Properties

alphaTestCutoffSearch playground for alphaTestCutoff

alphaTestCutoff: number

Defines the alpha limits in alpha test mode.

commentsSearch playground for comments

comments: string

Gets or sets the comments associated with this block

debugFactorSearch playground for debugFactor

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.

debugLimitSearch playground for debugLimit

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

debugModeSearch playground for debugMode

debugMode: number

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

directIntensitySearch playground for directIntensity

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.

enableSpecularAntiAliasingSearch playground for enableSpecularAntiAliasing

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.

environmentIntensitySearch playground for environmentIntensity

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 reflection for shiny ones.

forceNormalForwardSearch playground for forceNormalForward

forceNormalForward: boolean

Force normal to face away from face.

inputsAreExclusiveSearch playground for inputsAreExclusive

inputsAreExclusive: boolean

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

lightSearch playground for light

light: Nullable<Light>

Gets or sets the light associated with this block

lightFalloffSearch playground for lightFalloff

lightFalloff: number

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

realTimeFilteringSearch playground for realTimeFiltering

realTimeFiltering: boolean

Enables realtime filtering on the texture.

realTimeFilteringQualitySearch playground for realTimeFilteringQuality

realTimeFilteringQuality: number

Quality switch for realtime filtering

specularIntensitySearch playground for specularIntensity

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.

uniqueIdSearch playground for uniqueId

uniqueId: number

Gets or sets the unique id of the node

unlitSearch playground for unlit

unlit: boolean

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

useAlphaBlendingSearch playground for useAlphaBlending

useAlphaBlending: boolean

Specifies that alpha blending should be used

useAlphaTestSearch playground for useAlphaTest

useAlphaTest: boolean

Specifies that alpha test should be used

useEnergyConservationSearch playground for useEnergyConservation

useEnergyConservation: boolean

Defines if the material uses energy conservation.

useHorizonOcclusionSearch playground for useHorizonOcclusion

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).

useRadianceOcclusionSearch playground for useRadianceOcclusion

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.

useRadianceOverAlphaSearch playground for useRadianceOverAlpha

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 example of that. When the street lights reflects on it you can not see what is behind.

useSpecularOverAlphaSearch playground for useSpecularOverAlpha

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 example of that. When sun reflects on it you can not see what is behind.

visibleInInspectorSearch playground for visibleInInspector

visibleInInspector: boolean

Gets or sets a boolean indicating that this input can be edited in the Inspector (false by default)

visibleOnFrameSearch playground for visibleOnFrame

visibleOnFrame: boolean

Gets or sets a boolean indicating that this input can be edited from a collapsed frame

Accessors

alpha

ambientClr

ambientColor

ambientOcc

anisotropy

baseColor

buildId

  • 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

clearcoat

clearcoatDir

clearcoatInd

diffuseDir

diffuseInd

indexOfRefraction

inputs

iridescence

isFinalMerger

  • 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

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

    Returns boolean

isUnique

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

    Returns boolean

lighting

metallic

name

  • get name(): string
  • set name(newName: string): any
  • Gets the name of the block

    Returns string

  • Sets the name of the block. Will check if the name is valid.

    Parameters

    • newName: string

    Returns any

opacity

outputs

perturbedNormal

reflection

refraction

roughness

shadow

sheen

sheenDir

sheenInd

specularDir

specularInd

subsurface

target

view

willBeGeneratedIntoVertexShaderFromFragmentShader

  • get willBeGeneratedIntoVertexShaderFromFragmentShader(): boolean

worldNormal

worldPosition

Methods

_deserializeSearch playground for _deserialize

  • _deserialize(serializationObject: any, scene: Scene, rootUrl: string): void
  • Parameters

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

    Returns void

autoConfigureSearch playground for autoConfigure

bindSearch playground for bind

buildSearch playground for build

  • 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

cloneSearch playground for clone

  • 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 NodeMaterialBlock | null

    a copy of the current block

connectToSearch playground for connectTo

  • connectTo(other: NodeMaterialBlock, options?: { input?: string; output?: string; outputSwizzle?: string }): this | undefined
  • Connect current block with another block

    Parameters

    • other: NodeMaterialBlock

      defines the block to connect with

    • Optional options: { input?: string; output?: string; outputSwizzle?: string }

      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

disposeSearch playground for dispose

  • dispose(): void
  • Release resources

    Returns void

getClassNameSearch playground for getClassName

  • getClassName(): string
  • Gets the current class name

    Returns string

    the class name

getFirstAvailableInputSearch playground for getFirstAvailableInput

getFirstAvailableOutputSearch playground for getFirstAvailableOutput

getInputByNameSearch playground for getInputByName

  • Find an input by its name

    Parameters

    • name: string

      defines the name of the input to look for

    Returns NodeMaterialConnectionPoint | null

    the input or null if not found

getOutputByNameSearch playground for getOutputByName

  • Find an output by its name

    Parameters

    • name: string

      defines the name of the output to look for

    Returns NodeMaterialConnectionPoint | null

    the output or null if not found

getSiblingOutputSearch playground for getSiblingOutput

initializeSearch playground for initialize

  • Initialize the block and prepare the context for build

    Parameters

    Returns void

initializeDefinesSearch playground for initializeDefines

  • 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

isAnAncestorOfSearch playground for isAnAncestorOf

  • Checks if the current block is an ancestor of a given block

    Parameters

    Returns boolean

    true if block is a descendant

isReadySearch playground for isReady

prepareDefinesSearch playground for prepareDefines

provideFallbacksSearch playground for provideFallbacks

  • Add potential fallbacks if shader compilation fails

    Parameters

    Returns void

registerInputSearch playground for registerInput

  • 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

registerOutputSearch playground for registerOutput

  • Register a new output. Must be called inside a block constructor

    Parameters

    Returns this

    the current block

replaceRepeatableContentSearch playground for replaceRepeatableContent

  • 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

serializeSearch playground for serialize

  • serialize(): any
  • Returns any

updateUniformsAndSamplesSearch playground for updateUniformsAndSamples

validateBlockNameSearch playground for validateBlockName

  • validateBlockName(newName: string): boolean
  • Validates the new name for the block node.

    Parameters

    • newName: string

      the new name to be given to the node.

    Returns boolean

    false if the name is a reserve word, else true.

Legend

  • Constructor
  • Property
  • Method
  • Inherited property
  • Inherited method
  • Inherited accessor
  • Property
  • Method
  • Static property
  • Static method