Class PBRSubSurfaceConfiguration
Hierarchy
- PBRSubSurfaceConfiguration
Index
Constructors
Properties
- diffusion
Distance - index
OfRefraction - invert
RefractionY - is
Refraction Enabled - is
Scattering Enabled - is
Translucency Enabled - link
Refraction With Transparency - maximum
Thickness - minimum
Thickness - refraction
Intensity - refraction
Texture - thickness
Texture - tint
Color - tint
Color AtDistance - translucency
Intensity - use
Albedo ToTint Refraction - use
Mask From Thickness Texture - use
Mask From Thickness Texture Gltf
Accessors
Methods
Constructors
constructor
-
Instantiate a new istance of sub surface configuration.
Parameters
-
markAllSubMeshesAsTexturesDirty: () => void
Callback to flag the material to dirty
-
-
Returns void
-
-
-
markScenePrePassDirty: () => void
Callback to flag the scene as prepass dirty
-
-
Returns void
-
-
-
scene: Scene
The scene
Returns PBRSubSurfaceConfiguration
-
Properties
diffusion DistanceSearch playground for diffusionDistance
Defines how far each channel transmit through the media. It is defined as a color to simplify it selection.
index OfRefractionSearch playground for indexOfRefraction
Index of refraction of the material base layer. https://en.wikipedia.org/wiki/List_of_refractive_indices
This does not only impact refraction but also the Base F0 of Dielectric Materials.
From dielectric fresnel rules: F0 = square((iorT - iorI) / (iorT + iorI))
invert RefractionYSearch playground for invertRefractionY
Controls if refraction needs to be inverted on Y. This could be useful for procedural texture.
is Refraction EnabledSearch playground for isRefractionEnabled
Defines if the refraction is enabled in the material.
is Scattering EnabledSearch playground for isScatteringEnabled
Defines if the sub surface scattering is enabled in the material.
is Translucency EnabledSearch playground for isTranslucencyEnabled
Defines if the translucency is enabled in the material.
link Refraction With TransparencySearch playground for linkRefractionWithTransparency
This parameters will make the material used its opacity to control how much it is refracting aginst not. Materials half opaque for instance using refraction could benefit from this control.
maximum ThicknessSearch playground for maximumThickness
Defines the maximum thickness stored in the thickness map.
minimum ThicknessSearch playground for minimumThickness
Defines the minimum thickness stored in the thickness map. If no thickness map is defined, this value will be used to simulate thickness.
refraction IntensitySearch playground for refractionIntensity
Defines the refraction intensity of the material. The refraction when enabled replaces the Diffuse part of the material. The intensity helps transitionning between diffuse and refraction.
refraction TextureSearch playground for refractionTexture
Defines the texture to use for refraction.
thickness TextureSearch playground for thicknessTexture
Stores the average thickness of a mesh in a texture (The texture is holding the values linearly). The red channel of the texture should contain the thickness remapped between 0 and 1. 0 would mean minimumThickness 1 would mean maximumThickness The other channels might be use as a mask to vary the different effects intensity.
tint ColorSearch playground for tintColor
Defines the volume tint of the material. This is used for both translucency and scattering.
tint Color AtDistanceSearch playground for tintColorAtDistance
Defines the distance at which the tint color should be found in the media. This is used for refraction only.
translucency IntensitySearch playground for translucencyIntensity
Defines the translucency intensity of the material. When translucency has been enabled, this defines how much of the "translucency" is addded to the diffuse part of the material.
use Albedo ToTint RefractionSearch playground for useAlbedoToTintRefraction
When enabled, transparent surfaces will be tinted with the albedo colour (independent of thickness)
use Mask From Thickness TextureSearch playground for useMaskFromThicknessTexture
Stores the intensity of the different subsurface effects in the thickness texture.
- the green channel is the translucency intensity.
- the blue channel is the scattering intensity.
- the alpha channel is the refraction intensity.
use Mask From Thickness Texture GltfSearch playground for useMaskFromThicknessTextureGltf
Stores the intensity of the different subsurface effects in the thickness texture. This variation matches the channel-packing that is used by glTF.
- the red channel is the transmission/translucency intensity.
- the green channel is the thickness.
Accessors
disable Alpha Blending
-
Returns true if alpha blending should be disabled.
Returns boolean
scattering Diffusion Profile
volume Index OfRefraction
-
Index of refraction of the material's volume. https://en.wikipedia.org/wiki/List_of_refractive_indices
This ONLY impacts refraction. If not provided or given a non-valid value, the volume will use the same IOR as the surface.
Returns number
-
Index of refraction of the material's volume. https://en.wikipedia.org/wiki/List_of_refractive_indices
This ONLY impacts refraction. If not provided or given a non-valid value, the volume will use the same IOR as the surface.
Parameters
-
value: number
Returns any
-
Methods
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
defines the engine the material belongs to.
-
isFrozen: boolean
defines whether the material is frozen or not.
-
lodBasedMicrosurface: boolean
defines whether the material relies on lod based microsurface or not.
-
realTimeFiltering: boolean
defines whether the textures should be filtered on the fly.
Returns void
-
copy ToSearch playground for copyTo
-
Makes a duplicate of the current configuration into another one.
Parameters
-
configuration: PBRSubSurfaceConfiguration
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 Class NameSearch playground for getClassName
-
Get the current class name of the texture useful for serialization or dynamic coding.
Returns string
"PBRSubSurfaceConfiguration"
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
-
Gets wehter the submesh is ready to be used or not.
Parameters
-
defines: IMaterialSubSurfaceDefines
the list of "defines" to update.
-
scene: Scene
defines the scene the material belongs to.
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
-
Checks to see if a texture is used in the material.
Parameters
-
defines: IMaterialSubSurfaceDefines
the list of "defines" to update.
-
scene: Scene
defines the scene to the material belongs to.
Returns void
-
serializeSearch playground for serialize
-
Serializes this Sub Surface configuration.
Returns any
- An object with the serialized config.
unbindSearch playground for unbind
-
Unbinds the material from the mesh.
Parameters
-
activeEffect: Effect
defines the effect that should be unbound from.
Returns boolean
true if unbound, otherwise false
-
Static Add FallbacksSearch playground for AddFallbacks
-
Add fallbacks to the effect fallbacks list.
Parameters
-
defines: IMaterialSubSurfaceDefines
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.
-
Static Add SamplersSearch playground for AddSamplers
-
Add the required samplers to the current list.
Parameters
-
samplers: string[]
defines the current sampler list.
Returns void
-
Static Add UniformsSearch playground for AddUniforms
-
Add the required uniforms to the current list.
Parameters
-
uniforms: string[]
defines the current uniform list.
Returns void
-
Static Prepare Uniform BufferSearch playground for PrepareUniformBuffer
-
Add the required uniforms to the current buffer.
Parameters
-
uniformBuffer: UniformBuffer
defines the current uniform buffer.
Returns void
-
Define the code related to the sub surface parameters of the pbr material.