API

Class ReflectionBlock

Block used to implement the reflection module of the PBR material

Hierarchy (View Summary)

Index
comments: string = ""

Gets or sets the comments associated with this block

forceIrradianceInFragment: boolean = false

Force the shader to compute irradiance in the fragment shader in order to take bump in account.

generateOnlyFragmentCode: boolean = false

Indicates that no code should be generated in the vertex shader. Can be useful in some specific circumstances (like when doing ray marching for eg)

inputsAreExclusive: boolean = false

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

onCodeIsReadyObservable: any = ...

Observable raised when the block code is ready (if the code loading is async)

uniqueId: number

Gets or sets the unique id of the node

useSphericalHarmonics: boolean = true

Defines if the material uses spherical harmonics vs spherical polynomials for the diffuse part of the IBL.

visibleInInspector: boolean = false

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

visibleOnFrame: boolean = false

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

  • get willBeGeneratedIntoVertexShaderFromFragmentShader(): boolean

    Gets a boolean indicating that the code of this block will be promoted to vertex shader even if connected to fragment output

    Returns boolean

  • Gets the main code of the block (fragment side)

    Parameters

    • state: NodeMaterialBuildState

      current state of the node material building

    • normalVarName: string

      name of the existing variable corresponding to the normal

    Returns string

    the shader code

  • Generates the reflection coords code for the fragment code path

    Parameters

    • state: NodeMaterialBuildState

      defines the build state

    • worldNormalVarName: string

      name of the world normal variable

    • OptionalworldPos: string

      name of the world position variable. If not provided, will use the world position connected to this block

    • onlyReflectionVector: boolean = false

      if true, generates code only for the reflection vector computation, not for the reflection coordinates

    • doNotEmitInvertZ: boolean = false

      if true, does not emit the invertZ code

    Returns string

    the shader code