Class PBRSheenConfiguration
Hierarchy (View Summary)
- MaterialPluginBase
- PBRSheenConfiguration
Index
Constructors
Properties
Accessors
Methods
Constructors
constructor
-
new PBRSheenConfiguration(
material: PBRBaseMaterial,
addToPluginList?: boolean,
): PBRSheenConfigurationParameters
- material: PBRBaseMaterial
- addToPluginList: boolean = true
Returns PBRSheenConfiguration
Properties
color
Defines the sheen color.
do Not Serialize
Specifies if the material plugin should be serialized, true to skip serialization
intensity
Defines the sheen intensity.
Readonlymark All Defines As Dirty
Helper function to mark defines as being dirty.
name
Defines the name of the plugin
priority
Defines the priority of the plugin. Lower numbers run first.
register For Extra Events
Indicates that this plugin should be notified for the extra events (HasRenderTargetTextures / FillRenderTargetTextures / HardBindForSubMesh)
resolve Includes
Indicates that any #include directive in the plugin code must be replaced by the corresponding code.
Accessors
albedo Scaling
If true, the sheen effect is layered above the base BRDF with the albedo-scaling technique. It allows the strength of the sheen effect to not depend on the base color of the material, making it easier to setup and tweak the effect
is Enabled
Defines if the material uses sheen.
link Sheen With Albedo
Defines if the sheen is linked to the sheen color.
roughness
Defines the sheen roughness. It is not taken into account if linkSheenWithAlbedo is true. To stay backward compatible, material roughness is used instead if sheen roughness = null
texture
Stores the sheen tint values in a texture. rgb is tint a is a intensity or roughness if the roughness property has been defined and useRoughnessFromTexture is true (in that case, textureRoughness won't be used) If the roughness property has been defined and useRoughnessFromTexture is false then the alpha channel is not used to modulate roughness
texture Roughness
Stores the sheen roughness in a texture. alpha channel is the roughness. This texture won't be used if the texture property is not empty and useRoughnessFromTexture is true
use Roughness From Main Texture
Indicates that the alpha channel of the texture property will be used for roughness. Has no effect if the roughness (and texture!) property is not defined
Methods
add Fallbacks
-
addFallbacks(
defines: MaterialSheenDefines,
fallbacks: EffectFallbacks,
currentRank: number,
): numberAdd fallbacks to the effect fallbacks list.
Parameters
- defines: MaterialSheenDefines
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.
- defines: MaterialSheenDefines
bind For Sub Mesh
-
bindForSubMesh(
uniformBuffer: UniformBuffer,
scene: Scene,
engine: Engine,
subMesh: SubMesh,
): voidBinds sheen data for a sub mesh.
Parameters
- uniformBuffer: UniformBuffer
defines the uniform buffer to update
- scene: Scene
defines the scene to use for texture binding
- engine: Engine
defines the engine to use for capability checks
- subMesh: SubMesh
defines the sub mesh being rendered
Returns void
- uniformBuffer: UniformBuffer
collect Defines
-
Collects all defines.
Parameters
- defines: { [name: string]: { default: any; type: string } }
The object to append to.
Returns void
- defines: { [name: string]: { default: any; type: string } }
copy To
-
Makes a duplicate of the current configuration into another one.
Parameters
- plugin: MaterialPluginBase
define the config where to copy the info
Returns void
- plugin: MaterialPluginBase
dispose
-
Disposes the sheen textures.
Parameters
OptionalforceDisposeTextures: booleandefines whether to dispose the textures
Returns void
fill Render Target Textures
-
Fills the list of render target textures.
Parameters
- _renderTargets: SmartArray<RenderTargetTexture>
the list of render targets to update
Returns void
- _renderTargets: SmartArray<RenderTargetTexture>
get Active Textures
-
Adds the active sheen textures.
Parameters
- activeTextures: BaseTexture[]
defines the list of active textures to update
Returns void
- activeTextures: BaseTexture[]
get Animatables
-
Adds the animatable sheen textures.
Parameters
- animatables: IAnimatable[]
defines the list of animatables to update
Returns void
- animatables: IAnimatable[]
get Attributes
-
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
- _attributes: string[]
get Class Name
-
Gets the current class name useful for serialization or dynamic coding.
Returns string
The class name.
get Custom Code
-
getCustomCode(
_shaderType: string,
_shaderLanguage?: ShaderLanguage,
): Nullable<{ [pointName: string]: string }>Returns a list of custom shader code fragments to customize the shader.
Parameters
- _shaderType: string
"vertex" or "fragment"
- _shaderLanguage: ShaderLanguage = ShaderLanguage.GLSL
The shader language to use.
Returns Nullable<{ [pointName: string]: string }>
null if no code to be added, or a list of pointName => code. Note that
pointNamecan 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. - _shaderType: string
get Samplers
-
Adds the sheen sampler names.
Parameters
- samplers: string[]
defines the list of sampler names to update
Returns void
- samplers: string[]
get Uniform Buffers Names
-
Gets the uniform buffers names added by the plugin.
Parameters
- _ubos: string[]
list that the ubo names should be added to.
Returns void
- _ubos: string[]
get Uniforms
-
getUniforms(): {
fragment?: string;
ubo?: { name: string; size: number; type: string }[];
vertex?: string;
}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?: { name: string; size: number; type: string }[];
vertex?: string;
}the description of the uniforms
hard Bind For Sub Mesh
-
hardBindForSubMesh(
_uniformBuffer: UniformBuffer,
_scene: Scene,
_engine: AbstractEngine,
_subMesh: SubMesh,
): voidBinds 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: AbstractEngine
defines the engine the material belongs to.
- _subMesh: SubMesh
the submesh to bind data for
Returns void
- _uniformBuffer: UniformBuffer
has Render Target Textures
-
Gets a boolean indicating that current material needs to register RTT
Returns boolean
true if this uses a render target otherwise false.
has Texture
-
Checks whether sheen uses a texture.
Parameters
- texture: BaseTexture
defines the texture to check
Returns boolean
true if the texture is used by sheen
- texture: BaseTexture
is Compatible
-
Gets a boolean indicating that the plugin is compatible with a given shader language.
Returns boolean
true if the plugin is compatible with the shader language
is Ready For Sub Mesh
-
Checks whether the sheen textures are ready for the sub mesh.
Parameters
- defines: MaterialSheenDefines
defines the material defines to inspect
- scene: Scene
defines the scene to use for readiness checks
Returns boolean
true if sheen is ready
- defines: MaterialSheenDefines
parse
-
Parses a plugin 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
- source: any
prepare Defines
-
Sets the defines for the next rendering
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
- _defines: MaterialDefines
prepare Defines Before Attributes
-
Updates shader defines for sheen before attributes are processed.
Parameters
- defines: MaterialSheenDefines
defines the material defines to update
- scene: Scene
defines the scene to use for texture checks
Returns void
- defines: MaterialSheenDefines
serialize
-
Serializes this plugin configuration.
Returns any
- An object with the serialized config.
Plugin that implements the sheen component of the PBR material.