Class PBRBRDFConfiguration
Hierarchy
- MaterialPluginBase
- PBRBRDFConfiguration
Index
Constructors
Properties
- mark
All Defines As Dirty - name
- priority
- register
For Extra Events - use
Energy Conservation - use
Smith Visibility Height Correlated - use
Specular Glossiness Input Energy Conservation - use
Spherical Harmonics - DEFAULT_
USE_ ENERGY_ CONSERVATION - DEFAULT_
USE_ SMITH_ VISIBILITY_ HEIGHT_ CORRELATED - DEFAULT_
USE_ SPECULAR_ GLOSSINESS_ INPUT_ ENERGY_ CONSERVATION - DEFAULT_
USE_ SPHERICAL_ HARMONICS
Methods
- add
Fallbacks - bind
For Sub Mesh - collect
Defines - copy
To - dispose
- fill
Render Target Textures - get
Active Textures - get
Animatables - get
Attributes - get
Class Name - get
Custom Code - get
Samplers - get
Uniform Buffers Names - get
Uniforms - hard
Bind For Sub Mesh - has
Render Target Textures - has
Texture - is
Ready For Sub Mesh - parse
- prepare
Defines - prepare
Defines Before Attributes - serialize
Constructors
constructor
Creates a new material plugin
Parameters
material: PBRBaseMaterial
Optional addToPluginList: boolean
Returns PBRBRDFConfiguration
Properties
Readonly mark All Defines As DirtySearch playground for markAllDefinesAsDirty
Type declaration
Helper function to mark defines as being dirty.
Returns void
nameSearch playground for name
Defines the name of the plugin
prioritySearch playground for priority
Defines the priority of the plugin. Lower numbers run first.
register For Extra EventsSearch playground for registerForExtraEvents
Indicates that this plugin should be notified for the extra events (HasRenderTargetTextures / FillRenderTargetTextures / HardBindForSubMesh)
use Energy ConservationSearch playground for useEnergyConservation
Defines if the material uses energy conservation.
use Smith Visibility Height CorrelatedSearch playground for useSmithVisibilityHeightCorrelated
LEGACY Mode set to false Defines if the material uses height smith correlated visibility term. If you intent to not use our default BRDF, you need to load a separate BRDF Texture for the PBR You can either load https://assets.babylonjs.com/environments/uncorrelatedBRDF.png or https://assets.babylonjs.com/environments/uncorrelatedBRDF.dds to have more precision Not relying on height correlated will also disable energy conservation.
use Specular Glossiness Input Energy ConservationSearch playground for useSpecularGlossinessInputEnergyConservation
Defines if the material uses energy conservation, when the specular workflow is active. If activated, the albedo color is multiplied with (1. - maxChannel(specular color)). If deactivated, a material is only physically plausible, when (albedo color + specular color) < 1. In the deactivated case, the material author has to ensure energy conservation, for a physically plausible rendering.
use Spherical HarmonicsSearch playground for useSphericalHarmonics
LEGACY Mode set to false Defines if the material uses spherical harmonics vs spherical polynomials for the diffuse part of the IBL. The harmonics despite a tiny bigger cost has been proven to provide closer results to the ground truth.
Static DEFAULT_ USE_ ENERGY_ CONSERVATIONSearch playground for DEFAULT_USE_ENERGY_CONSERVATION
Default value used for the energy conservation. This should only be changed to adapt to the type of texture in scene.environmentBRDFTexture.
Static DEFAULT_ USE_ SMITH_ VISIBILITY_ HEIGHT_ CORRELATEDSearch playground for DEFAULT_USE_SMITH_VISIBILITY_HEIGHT_CORRELATED
Default value used for the Smith Visibility Height Correlated mode. This should only be changed to adapt to the type of texture in scene.environmentBRDFTexture.
Static DEFAULT_ USE_ SPECULAR_ GLOSSINESS_ INPUT_ ENERGY_ CONSERVATIONSearch playground for DEFAULT_USE_SPECULAR_GLOSSINESS_INPUT_ENERGY_CONSERVATION
Default value used for activating energy conservation for the specular workflow. If activated, the albedo color is multiplied with (1. - maxChannel(specular color)). If deactivated, a material is only physically plausible, when (albedo color + specular color) < 1.
Static DEFAULT_ USE_ SPHERICAL_ HARMONICSSearch playground for DEFAULT_USE_SPHERICAL_HARMONICS
Default value used for the IBL diffuse part. This can help switching back to the polynomials mode globally which is a tiny bit less GPU intensive at the drawback of a lower quality.
Methods
add FallbacksSearch playground for addFallbacks
Add fallbacks to the effect fallbacks list.
Parameters
defines: MaterialDefines
defines the Base texture to use.
fallbacks: EffectFallbacks
defines the current fallback list.
currentRank: number
defines the current fallback rank.
Returns number
the new fallback rank.
bind For Sub MeshSearch playground for bindForSubMesh
Binds the material data.
Parameters
uniformBuffer: UniformBuffer
defines the Uniform buffer to fill in.
scene: Scene
defines the scene the material belongs to.
engine: Engine
the engine this scene belongs to.
subMesh: SubMesh
the submesh to bind data for
Returns void
collect DefinesSearch playground for collectDefines
Collects all defines.
Parameters
defines: {}
The object to append to.
[name: string]: { default: any; type: string }
default: any
type: string
Returns void
copy ToSearch playground for copyTo
Makes a duplicate of the current configuration into another one.
Parameters
plugin: MaterialPluginBase
define the config where to copy the info
Returns void
disposeSearch playground for dispose
Disposes the resources of the material.
Parameters
Optional forceDisposeTextures: boolean
Forces the disposal of all textures.
Returns void
fill Render Target TexturesSearch playground for fillRenderTargetTextures
Fills the list of render target textures.
Parameters
renderTargets: SmartArray<RenderTargetTexture>
the list of render targets to update
Returns void
get Active TexturesSearch playground for getActiveTextures
Returns an array of the actively used textures.
Parameters
activeTextures: BaseTexture[]
Array of BaseTextures
Returns void
get AnimatablesSearch playground for getAnimatables
Returns the animatable textures.
Parameters
animatables: IAnimatable[]
Array of animatable textures.
Returns void
get AttributesSearch playground for getAttributes
Gets the attributes used by the plugin.
Parameters
attributes: string[]
list that the attribute names should be added to.
scene: Scene
the scene that the material belongs to.
mesh: AbstractMesh
the mesh being rendered.
Returns void
get Class NameSearch playground for getClassName
Gets the current class name useful for serialization or dynamic coding.
Returns string
The class name.
get Custom CodeSearch playground for getCustomCode
Returns a list of custom shader code fragments to customize the shader.
Parameters
shaderType: string
"vertex" or "fragment"
Returns Nullable<{}>
null if no code to be added, or a list of pointName => code. Note that
pointName
can also be a regular expression if it starts with a!
. In that case, the string found by the regular expression (if any) will be replaced by the code provided.
get SamplersSearch playground for getSamplers
Gets the samplers used by the plugin.
Parameters
samplers: string[]
list that the sampler names should be added to.
Returns void
get Uniform Buffers NamesSearch playground for getUniformBuffersNames
Gets the uniform buffers names added by the plugin.
Parameters
ubos: string[]
list that the ubo names should be added to.
Returns void
get UniformsSearch playground for getUniforms
Gets the description of the uniforms to add to the ubo (if engine supports ubos) or to inject directly in the vertex/fragment shaders (if engine does not support ubos)
Returns { fragment?: string; ubo?: { arraySize?: number; name: string; size?: number; type?: string }[]; vertex?: string }
the description of the uniforms
Optional fragment?: string
Optional ubo?: { arraySize?: number; name: string; size?: number; type?: string }[]
Optional vertex?: string
hard Bind For Sub MeshSearch playground for hardBindForSubMesh
Binds the material data (this function is called even if mustRebind() returns false)
Parameters
uniformBuffer: UniformBuffer
defines the Uniform buffer to fill in.
scene: Scene
defines the scene the material belongs to.
engine: Engine
defines the engine the material belongs to.
subMesh: SubMesh
the submesh to bind data for
Returns void
has Render Target TexturesSearch playground for hasRenderTargetTextures
Gets a boolean indicating that current material needs to register RTT
Returns boolean
true if this uses a render target otherwise false.
has TextureSearch playground for hasTexture
Checks to see if a texture is used in the material.
Parameters
texture: BaseTexture
Base texture to use.
Returns boolean
- Boolean specifying if a texture is used in the material.
is Ready For Sub MeshSearch playground for isReadyForSubMesh
Specifies that the submesh is ready to be used.
Parameters
defines: MaterialDefines
the list of "defines" to update.
scene: Scene
defines the scene the material belongs to.
engine: Engine
the engine this scene belongs to.
subMesh: SubMesh
the submesh to check for readiness
Returns boolean
- boolean indicating that the submesh is ready or not.
parseSearch playground for parse
Parses a anisotropy Configuration from a serialized object.
Parameters
source: any
Serialized object.
scene: Scene
Defines the scene we are parsing for
rootUrl: string
Defines the rootUrl to load from
Returns void
prepare DefinesSearch playground for prepareDefines
Sets the defines for the next rendering
Parameters
defines: MaterialBRDFDefines
Returns void
prepare Defines Before AttributesSearch playground for prepareDefinesBeforeAttributes
Sets the defines for the next rendering. Called before MaterialHelper.PrepareDefinesForAttributes is called.
Parameters
defines: MaterialDefines
the list of "defines" to update.
scene: Scene
defines the scene to the material belongs to.
mesh: AbstractMesh
the mesh being rendered
Returns void
serializeSearch playground for serialize
Serializes this clear coat configuration.
Returns any
- An object with the serialized config.
Plugin that implements the BRDF component of the PBR material