Class PBRSubSurfaceConfiguration
Hierarchy
-
MaterialPluginBase
- 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 - name
- priority
- refraction
Intensity - refraction
Intensity Texture - refraction
Texture - register
For Extra Events - thickness
Texture - tint
Color - tint
Color AtDistance - translucency
Intensity - translucency
Intensity Texture - use
Albedo ToTint Refraction - use
Albedo ToTint Translucency - use
Gltf Style Textures - use
Mask From Thickness Texture - use
Thickness AsDepth
Accessors
Methods
Constructors
constructor
-
Parameters
-
material: PBRBaseMaterial
-
Optional addToPluginList: boolean
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 against 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.
nameSearch playground for name
Defines the name of the plugin
prioritySearch playground for priority
Defines the priority of the plugin. Lower numbers run first.
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 transitioning between diffuse and refraction.
refraction Intensity TextureSearch playground for refractionIntensityTexture
Stores the intensity of the refraction. If provided, it takes precedence over thicknessTexture + useMaskFromThicknessTexture
- the green (red if useGltfStyleTextures = true) channel is the refraction intensity.
refraction TextureSearch playground for refractionTexture
Defines the texture to use for refraction.
register For Extra EventsSearch playground for registerForExtraEvents
Indicates that this plugin should be notified for the extra events (HasRenderTargetTextures / FillRenderTargetTextures / HardBindForSubMesh)
thickness TextureSearch playground for thicknessTexture
Stores the average thickness of a mesh in a texture (The texture is holding the values linearly). The red (or green if useGltfStyleTextures=true) 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 added to the diffuse part of the material.
translucency Intensity TextureSearch playground for translucencyIntensityTexture
Stores the intensity of the translucency. If provided, it takes precedence over thicknessTexture + useMaskFromThicknessTexture
- the blue channel is the translucency intensity.
use Albedo ToTint RefractionSearch playground for useAlbedoToTintRefraction
When enabled, transparent surfaces will be tinted with the albedo colour (independent of thickness)
use Albedo ToTint TranslucencySearch playground for useAlbedoToTintTranslucency
When enabled, translucent surfaces will be tinted with the albedo colour (independent of thickness)
use Gltf Style TexturesSearch playground for useGltfStyleTextures
Use channels layout used by glTF:
- thicknessTexture: the green (instead of red) channel is the thickness
- thicknessTexture/refractionIntensityTexture: the red (instead of green) channel is the refraction intensity
- thicknessTexture/translucencyIntensityTexture: no change, use the blue channel for the translucency intensity
use Mask From Thickness TextureSearch playground for useMaskFromThicknessTexture
Stores the intensity of the different subsurface effects in the thickness texture. Note that if refractionIntensityTexture and/or translucencyIntensityTexture is provided it takes precedence over thicknessTexture + useMaskFromThicknessTexture
- the green (red if useGltfStyleTextures = true) channel is the refraction intensity.
- the blue channel is the translucency intensity.
use Thickness AsDepthSearch playground for useThicknessAsDepth
Defines that the thickness should be used as a measure of the depth volume.
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
add FallbacksSearch playground for addFallbacks
-
Parameters
-
defines: MaterialSubSurfaceDefines
-
fallbacks: EffectFallbacks
-
currentRank: number
Returns number
-
bind For Sub MeshSearch playground for bindForSubMesh
-
Parameters
-
uniformBuffer: UniformBuffer
-
scene: Scene
-
engine: Engine
-
subMesh: SubMesh
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
-
Parameters
-
Optional forceDisposeTextures: boolean
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
-
Parameters
-
activeTextures: BaseTexture[]
Returns void
-
get AnimatablesSearch playground for getAnimatables
-
Parameters
-
animatables: IAnimatable[]
Returns void
-
get Class NameSearch playground for getClassName
-
Returns string
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
-
Parameters
-
samplers: string[]
Returns void
-
get UniformsSearch playground for getUniforms
-
Returns { fragment?: string; ubo?: Array<{ name: string; size: number; type: string }>; vertex?: string }
-
Optional fragment?: string
-
Optional ubo?: Array<{ 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
-
Returns boolean
has TextureSearch playground for hasTexture
-
Parameters
-
texture: BaseTexture
Returns boolean
-
is Ready For Sub MeshSearch playground for isReadyForSubMesh
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
-
Parameters
-
defines: MaterialSubSurfaceDefines
-
scene: Scene
-
mesh: AbstractMesh
Returns void
-
serializeSearch playground for serialize
-
Serializes this clear coat configuration.
Returns any
- An object with the serialized config.
Plugin that implements the sub surface component of the PBR material