Class PBRMetallicRoughnessBlock
Hierarchy
-
NodeMaterialBlock
- PBRMetallicRoughnessBlock
Index
Constructors
Properties
- alpha
Test Cutoff - comments
- debug
Factor - debug
Limit - debug
Mode - direct
Intensity - enable
Specular Anti Aliasing - environment
Intensity - force
Normal Forward - inputs
Are Exclusive - light
- light
Falloff - real
Time Filtering - real
Time Filtering Quality - specular
Intensity - unique
Id - unlit
- use
Alpha Blending - use
Alpha Test - use
Energy Conservation - use
Horizon Occlusion - use
Radiance Occlusion - use
Radiance Over Alpha - use
Specular Over Alpha - visible
InInspector - visible
OnFrame
Accessors
- alpha
- ambient
Clr - ambient
Color - ambient
Occ - anisotropy
- base
Color - build
Id - camera
Position - clearcoat
- clearcoat
Dir - clearcoat
Indirect - diffuse
Dir - diffuse
Indirect - index
OfRefraction - inputs
- is
Final Merger - is
Input - is
Unique - lighting
- metallic
- name
- opacity
- outputs
- perturbed
Normal - reflection
- refraction
- roughness
- shadow
- sheen
- sheen
Dir - sheen
Indirect - specular
Dir - specular
Indirect - subsurface
- target
- view
- world
Normal - world
Position
Methods
- _deserialize
- auto
Configure - bind
- build
- clone
- connect
To - dispose
- get
Class Name - get
First Available Input - get
First Available Output - get
Input ByName - get
Output ByName - get
Sibling Output - initialize
- initialize
Defines - is
Ready - prepare
Defines - provide
Fallbacks - register
Input - register
Output - replace
Repeatable Content - serialize
- update
Uniforms And Samples - validate
Block Name
Constructors
constructor
-
Create a new ReflectionBlock
Parameters
-
name: string
defines the block name
Returns PBRMetallicRoughnessBlock
-
Properties
alpha Test CutoffSearch playground for alphaTestCutoff
Defines the alpha limits in alpha test mode.
commentsSearch playground for comments
Gets or sets the comments associated with this block
debug FactorSearch playground for debugFactor
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.
debug LimitSearch playground for debugLimit
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
debug ModeSearch playground for debugMode
Defines the material debug mode. It helps seeing only some components of the material while troubleshooting.
direct IntensitySearch playground for directIntensity
Intensity of the direct lights e.g. the four lights available in your scene. This impacts both the direct diffuse and specular highlights.
enable Specular Anti AliasingSearch playground for enableSpecularAntiAliasing
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.
environment IntensitySearch playground for environmentIntensity
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.
force Normal ForwardSearch playground for forceNormalForward
Force normal to face away from face.
inputs Are ExclusiveSearch playground for inputsAreExclusive
Gets or sets a boolean indicating that only one input can be connected at a time
lightSearch playground for light
Gets or sets the light associated with this block
light FalloffSearch playground for lightFalloff
Defines the falloff type used in this material. It by default is Physical.
real Time FilteringSearch playground for realTimeFiltering
Enables realtime filtering on the texture.
real Time Filtering QualitySearch playground for realTimeFilteringQuality
Quality switch for realtime filtering
specular IntensitySearch playground for specularIntensity
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.
unique IdSearch playground for uniqueId
Gets or sets the unique id of the node
unlitSearch playground for unlit
If set to true, no lighting calculations will be applied.
use Alpha BlendingSearch playground for useAlphaBlending
Specifies that alpha blending should be used
use Alpha TestSearch playground for useAlphaTest
Specifies that alpha test should be used
use Energy ConservationSearch playground for useEnergyConservation
Defines if the material uses energy conservation.
use Horizon OcclusionSearch playground for useHorizonOcclusion
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).
use Radiance OcclusionSearch playground for useRadianceOcclusion
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.
use Radiance Over AlphaSearch playground for useRadianceOverAlpha
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.
use Specular Over AlphaSearch playground for useSpecularOverAlpha
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.
visible InInspectorSearch playground for visibleInInspector
Gets or sets a boolean indicating that this input can be edited in the Inspector (false by default)
visible OnFrameSearch playground for visibleOnFrame
Gets or sets a boolean indicating that this input can be edited from a collapsed frame
Accessors
alpha
-
Gets the alpha output component
Returns NodeMaterialConnectionPoint
ambient Clr
-
Gets the ambient output component
Returns NodeMaterialConnectionPoint
ambient Color
-
Gets the ambient color input component
Returns NodeMaterialConnectionPoint
ambient Occ
-
Gets the ambient occlusion input component
Returns NodeMaterialConnectionPoint
anisotropy
-
Gets the anisotropy object parameters
Returns NodeMaterialConnectionPoint
base Color
-
Gets the base color input component
Returns NodeMaterialConnectionPoint
build Id
-
Gets or sets the build Id
Returns number
-
Gets or sets the build Id
Parameters
-
value: number
Returns any
-
camera Position
-
Gets the camera position input component
Returns NodeMaterialConnectionPoint
clearcoat
-
Gets the clear coat object parameters
Returns NodeMaterialConnectionPoint
clearcoat Dir
-
Gets the clear coat output component
Returns NodeMaterialConnectionPoint
clearcoat Indirect
-
Gets the indirect clear coat output component
Returns NodeMaterialConnectionPoint
diffuse Dir
-
Gets the diffuse output component
Returns NodeMaterialConnectionPoint
diffuse Indirect
-
Gets the indirect diffuse output component
Returns NodeMaterialConnectionPoint
index OfRefraction
-
Gets the index of refraction input component
Returns NodeMaterialConnectionPoint
inputs
-
Gets the list of input points
Returns NodeMaterialConnectionPoint[]
is Final Merger
-
Gets a boolean indicating that this block is an end block (e.g. it is generating a system value)
Returns boolean
is Input
-
Gets a boolean indicating that this block is an input (e.g. it sends data to the shader)
Returns boolean
is Unique
-
Gets a boolean indicating that this block can only be used once per NodeMaterial
Returns boolean
lighting
-
Gets the global lighting output component
Returns NodeMaterialConnectionPoint
metallic
-
Gets the metallic input component
Returns NodeMaterialConnectionPoint
name
-
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
-
Gets the opacity input component
Returns NodeMaterialConnectionPoint
outputs
-
Gets the list of output points
Returns NodeMaterialConnectionPoint[]
perturbed Normal
-
Gets the perturbed normal input component
Returns NodeMaterialConnectionPoint
reflection
-
Gets the reflection object parameters
Returns NodeMaterialConnectionPoint
refraction
-
Gets the refraction output component
Returns NodeMaterialConnectionPoint
roughness
-
Gets the roughness input component
Returns NodeMaterialConnectionPoint
shadow
-
Gets the shadow output component
Returns NodeMaterialConnectionPoint
sheen
-
Gets the sheen object parameters
Returns NodeMaterialConnectionPoint
sheen Dir
-
Gets the sheen output component
Returns NodeMaterialConnectionPoint
sheen Indirect
-
Gets the indirect sheen output component
Returns NodeMaterialConnectionPoint
specular Dir
-
Gets the specular output component
Returns NodeMaterialConnectionPoint
specular Indirect
-
Gets the indirect specular output component
Returns NodeMaterialConnectionPoint
subsurface
-
Gets the sub surface object parameters
Returns NodeMaterialConnectionPoint
target
-
Gets or sets the target of the block
Returns NodeMaterialBlockTargets
-
Gets or sets the target of the block
Parameters
-
value: NodeMaterialBlockTargets
Returns any
-
view
-
Gets the view matrix parameter
Returns NodeMaterialConnectionPoint
world Normal
-
Gets the world normal input component
Returns NodeMaterialConnectionPoint
world Position
-
Gets the world position input component
Returns NodeMaterialConnectionPoint
Methods
_deserializeSearch playground for _deserialize
-
Parameters
-
serializationObject: any
-
scene: Scene
-
rootUrl: string
Returns void
-
auto ConfigureSearch playground for autoConfigure
-
Parameters
-
material: NodeMaterial
Returns void
-
bindSearch playground for bind
-
Parameters
-
effect: Effect
-
nodeMaterial: NodeMaterial
-
Optional mesh: Mesh
Returns void
-
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 Nullable<NodeMaterialBlock>
a copy of the current block
-
connect ToSearch playground for connectTo
-
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 output
Swizzle?: string
-
Returns this | undefined
the current block
-
disposeSearch playground for dispose
-
Release resources
Returns void
get Class NameSearch playground for getClassName
-
Gets the current class name
Returns string
the class name
get First Available InputSearch playground for getFirstAvailableInput
-
Will return the first available input e.g. the first one which is not an uniform or an attribute
Parameters
-
Optional forOutput: Nullable<NodeMaterialConnectionPoint>
defines an optional connection point to check compatibility with
Returns Nullable<NodeMaterialConnectionPoint>
the first available input or null
-
get First Available OutputSearch playground for getFirstAvailableOutput
-
Will return the first available output e.g. the first one which is not yet connected and not a varying
Parameters
-
Optional forBlock: Nullable<NodeMaterialBlock>
defines an optional block to check compatibility with
Returns Nullable<NodeMaterialConnectionPoint>
the first available input or null
-
get Input ByNameSearch playground for getInputByName
-
Find an input by its name
Parameters
-
name: string
defines the name of the input to look for
Returns Nullable<NodeMaterialConnectionPoint>
the input or null if not found
-
get Output ByNameSearch playground for getOutputByName
-
Find an output by its name
Parameters
-
name: string
defines the name of the outputto look for
Returns Nullable<NodeMaterialConnectionPoint>
the output or null if not found
-
get Sibling OutputSearch playground for getSiblingOutput
-
Gets the sibling of the given output
Parameters
-
current: NodeMaterialConnectionPoint
defines the current output
Returns Nullable<NodeMaterialConnectionPoint>
the next output in the list or null
-
initializeSearch playground for initialize
-
Initialize the block and prepare the context for build
Parameters
-
state: NodeMaterialBuildState
defines the state that will be used for the build
Returns void
-
initialize DefinesSearch playground for initializeDefines
-
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
-
is ReadySearch playground for isReady
-
Returns boolean
prepare DefinesSearch playground for prepareDefines
-
Parameters
-
mesh: AbstractMesh
-
nodeMaterial: NodeMaterial
-
defines: NodeMaterialDefines
Returns void
-
provide FallbacksSearch playground for provideFallbacks
-
Add potential fallbacks if shader compilation fails
Parameters
-
mesh: AbstractMesh
defines the mesh to be rendered
-
fallbacks: EffectFallbacks
defines the current prioritized list of fallbacks
Returns void
-
register InputSearch 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
-
register OutputSearch playground for registerOutput
-
Register a new output. Must be called inside a block constructor
Parameters
-
name: string
defines the connection point name
-
type: NodeMaterialBlockConnectionPointTypes
defines the connection point type
-
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
-
replace Repeatable ContentSearch 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
-
Returns any
update Uniforms And SamplesSearch playground for updateUniformsAndSamples
-
Parameters
-
state: NodeMaterialBuildState
-
nodeMaterial: NodeMaterial
-
defines: NodeMaterialDefines
-
uniformBuffers: string[]
Returns void
-
validate Block NameSearch playground for validateBlockName
-
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.
-
Block used to implement the PBR metallic/roughness model