David Catuhe преди 6 години
родител
ревизия
95df9ff458
променени са 28 файла, в които са добавени 2280 реда и са изтрити 526 реда
  1. 270 37
      dist/preview release/babylon.d.ts
  2. 2 2
      dist/preview release/babylon.js
  3. 780 269
      dist/preview release/babylon.max.js
  4. 1 1
      dist/preview release/babylon.max.js.map
  5. 551 74
      dist/preview release/babylon.module.d.ts
  6. 1 1
      dist/preview release/glTF2Interface/package.json
  7. 2 2
      dist/preview release/gui/package.json
  8. 6 6
      dist/preview release/inspector/babylon.inspector.bundle.js
  9. 21 1
      dist/preview release/inspector/babylon.inspector.bundle.max.js
  10. 1 1
      dist/preview release/inspector/babylon.inspector.bundle.max.js.map
  11. 6 6
      dist/preview release/inspector/package.json
  12. 20 4
      dist/preview release/loaders/babylon.objFileLoader.js
  13. 1 1
      dist/preview release/loaders/babylon.objFileLoader.js.map
  14. 1 1
      dist/preview release/loaders/babylon.objFileLoader.min.js
  15. 20 4
      dist/preview release/loaders/babylonjs.loaders.js
  16. 1 1
      dist/preview release/loaders/babylonjs.loaders.js.map
  17. 2 2
      dist/preview release/loaders/babylonjs.loaders.min.js
  18. 3 3
      dist/preview release/loaders/package.json
  19. 2 2
      dist/preview release/materialsLibrary/package.json
  20. 1 1
      dist/preview release/package.json
  21. 2 2
      dist/preview release/postProcessesLibrary/package.json
  22. 2 2
      dist/preview release/proceduralTexturesLibrary/package.json
  23. 3 3
      dist/preview release/serializers/package.json
  24. 551 74
      dist/preview release/viewer/babylon.module.d.ts
  25. 25 21
      dist/preview release/viewer/babylon.viewer.js
  26. 2 2
      dist/preview release/viewer/babylon.viewer.max.js
  27. 1 1
      package.json
  28. 2 2
      src/Engines/engine.ts

+ 270 - 37
dist/preview release/babylon.d.ts

@@ -22088,7 +22088,7 @@ declare module BABYLON {
          * @param rootUrl defines the root URL to use to load textures
          * @param rootUrl defines the root URL to use to load textures
          * @returns a new material
          * @returns a new material
          */
          */
-        static Parse(parsedMaterial: any, scene: Scene, rootUrl: string): any;
+        static Parse(parsedMaterial: any, scene: Scene, rootUrl: string): Nullable<Material>;
     }
     }
 }
 }
 declare module BABYLON {
 declare module BABYLON {
@@ -38112,6 +38112,11 @@ declare module BABYLON {
          * Are anisotropic textures enabled in the application.
          * Are anisotropic textures enabled in the application.
          */
          */
         static AnisotropicTextureEnabled: boolean;
         static AnisotropicTextureEnabled: boolean;
+        private static _ThicknessTextureEnabled;
+        /**
+         * Are thickness textures enabled in the application.
+         */
+        static ThicknessTextureEnabled: boolean;
     }
     }
 }
 }
 declare module BABYLON {
 declare module BABYLON {
@@ -43655,12 +43660,12 @@ declare module BABYLON {
          */
          */
         isTintEnabled: boolean;
         isTintEnabled: boolean;
         /**
         /**
-         * Defines if the clear coat tint is enabled in the material.
+         * Defines the clear coat tint of the material.
          * This is only use if tint is enabled
          * This is only use if tint is enabled
          */
          */
         tintColor: Color3;
         tintColor: Color3;
         /**
         /**
-         * Defines if the distance at which the tint color should be found in the
+         * Defines the distance at which the tint color should be found in the
          * clear coat media.
          * clear coat media.
          * This is only use if tint is enabled
          * This is only use if tint is enabled
          */
          */
@@ -43687,7 +43692,7 @@ declare module BABYLON {
          */
          */
         constructor(markAllSubMeshesAsTexturesDirty: () => void);
         constructor(markAllSubMeshesAsTexturesDirty: () => void);
         /**
         /**
-         * Specifies that the submesh is ready to be used.
+         * Gets wehter the submesh is ready to be used or not.
          * @param defines the list of "defines" to update.
          * @param defines the list of "defines" to update.
          * @param scene defines the scene the material belongs to.
          * @param scene defines the scene the material belongs to.
          * @param engine defines the engine the material belongs to.
          * @param engine defines the engine the material belongs to.
@@ -44123,6 +44128,247 @@ declare module BABYLON {
     }
     }
 }
 }
 declare module BABYLON {
 declare module BABYLON {
+    /**
+     * @hidden
+     */
+    export interface IMaterialSubSurfaceDefines {
+        SUBSURFACE: boolean;
+        SS_REFRACTION: boolean;
+        SS_TRANSLUCENCY: boolean;
+        SS_SCATERRING: boolean;
+        SS_THICKNESSANDMASK_TEXTURE: boolean;
+        SS_THICKNESSANDMASK_TEXTUREDIRECTUV: number;
+        SS_REFRACTIONMAP_3D: boolean;
+        SS_REFRACTIONMAP_OPPOSITEZ: boolean;
+        SS_LODINREFRACTIONALPHA: boolean;
+        SS_GAMMAREFRACTION: boolean;
+        SS_RGBDREFRACTION: boolean;
+        SS_LINKREFRACTIONTOTRANSPARENCY: boolean;
+        SS_MASK_FROM_THICKNESS_TEXTURE: boolean;
+        /** @hidden */
+        _areTexturesDirty: boolean;
+    }
+    /**
+     * Define the code related to the sub surface parameters of the pbr material.
+     */
+    export class PBRSubSurfaceConfiguration {
+        private _isRefractionEnabled;
+        /**
+         * Defines if the refraction is enabled in the material.
+         */
+        isRefractionEnabled: boolean;
+        private _isTranslucencyEnabled;
+        /**
+         * Defines if the translucency is enabled in the material.
+         */
+        isTranslucencyEnabled: boolean;
+        private _isScatteringEnabled;
+        /**
+         * 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.
+         */
+        refractionIntensity: number;
+        /**
+         * 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.
+         */
+        translucencyIntensity: number;
+        /**
+         * Defines the scattering intensity of the material.
+         * When scattering has been enabled, this defines how much of the "scattered light"
+         * is addded to the diffuse part of the material.
+         */
+        scatteringIntensity: number;
+        private _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.
+         */
+        thicknessTexture: Nullable<BaseTexture>;
+        private _refractionTexture;
+        /**
+         * Defines the texture to use for refraction.
+         */
+        refractionTexture: Nullable<BaseTexture>;
+        private _indexOfRefraction;
+        /**
+         * Defines the indice of refraction used in the material.
+         * https://en.wikipedia.org/wiki/List_of_refractive_indices
+         */
+        indexOfRefraction: number;
+        private _invertRefractionY;
+        /**
+         * Controls if refraction needs to be inverted on Y. This could be useful for procedural texture.
+         */
+        invertRefractionY: boolean;
+        private _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.
+         */
+        linkRefractionWithTransparency: boolean;
+        /**
+         * Defines the minimum thickness stored in the thickness map.
+         * If no thickness map is defined, this value will be used to simulate thickness.
+         */
+        minimumThickness: number;
+        /**
+         * Defines the maximum thickness stored in the thickness map.
+         */
+        maximumThickness: number;
+        /**
+         * Defines the volume tint of the material.
+         * This is used for both translucency and scattering.
+         */
+        tintColor: Color3;
+        /**
+         * Defines the distance at which the tint color should be found in the media.
+         * This is used for refraction only.
+         */
+        tintColorAtDistance: number;
+        /**
+         * Defines how far each channel transmit through the media.
+         * It is defined as a color to simplify it selection.
+         */
+        diffusionDistance: Color3;
+        private _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.
+         */
+        useMaskFromThicknessTexture: boolean;
+        /** @hidden */
+        private _internalMarkAllSubMeshesAsTexturesDirty;
+        /** @hidden */
+        _markAllSubMeshesAsTexturesDirty(): void;
+        /**
+         * Instantiate a new istance of sub surface configuration.
+         * @param markAllSubMeshesAsTexturesDirty Callback to flag the material to dirty
+         */
+        constructor(markAllSubMeshesAsTexturesDirty: () => void);
+        /**
+         * Gets wehter the submesh is ready to be used or not.
+         * @param defines the list of "defines" to update.
+         * @param scene defines the scene the material belongs to.
+         * @returns - boolean indicating that the submesh is ready or not.
+         */
+        isReadyForSubMesh(defines: IMaterialSubSurfaceDefines, scene: Scene): boolean;
+        /**
+         * Checks to see if a texture is used in the material.
+         * @param defines the list of "defines" to update.
+         * @param scene defines the scene to the material belongs to.
+         */
+        prepareDefines(defines: IMaterialSubSurfaceDefines, scene: Scene): void;
+        /**
+         * Binds the material data.
+         * @param uniformBuffer defines the Uniform buffer to fill in.
+         * @param scene defines the scene the material belongs to.
+         * @param engine defines the engine the material belongs to.
+         * @param isFrozen defines wether the material is frozen or not.
+         * @param lodBasedMicrosurface defines wether the material relies on lod based microsurface or not.
+         */
+        bindForSubMesh(uniformBuffer: UniformBuffer, scene: Scene, engine: Engine, isFrozen: boolean, lodBasedMicrosurface: boolean): void;
+        /**
+         * Unbinds the material from the mesh.
+         * @param activeEffect defines the effect that should be unbound from.
+         * @returns true if unbound, otherwise false
+         */
+        unbind(activeEffect: Effect): boolean;
+        /**
+         * Returns the texture used for refraction or null if none is used.
+         * @param scene defines the scene the material belongs to.
+         * @returns - Refraction texture if present.  If no refraction texture and refraction
+         * is linked with transparency, returns environment texture.  Otherwise, returns null.
+         */
+        private _getRefractionTexture;
+        /**
+         * Returns true if alpha blending should be disabled.
+         */
+        readonly disableAlphaBlending: boolean;
+        /**
+         * Fills the list of render target textures.
+         * @param renderTargets the list of render targets to update
+         */
+        fillRenderTargetTextures(renderTargets: SmartArray<RenderTargetTexture>): void;
+        /**
+         * Checks to see if a texture is used in the material.
+         * @param texture - Base texture to use.
+         * @returns - Boolean specifying if a texture is used in the material.
+         */
+        hasTexture(texture: BaseTexture): boolean;
+        /**
+         * Gets a boolean indicating that current material needs to register RTT
+         * @returns true if this uses a render target otherwise false.
+         */
+        hasRenderTargetTextures(): boolean;
+        /**
+         * Returns an array of the actively used textures.
+         * @param activeTextures Array of BaseTextures
+         */
+        getActiveTextures(activeTextures: BaseTexture[]): void;
+        /**
+         * Returns the animatable textures.
+         * @param animatables Array of animatable textures.
+         */
+        getAnimatables(animatables: IAnimatable[]): void;
+        /**
+         * Disposes the resources of the material.
+         * @param forceDisposeTextures - Forces the disposal of all textures.
+         */
+        dispose(forceDisposeTextures?: boolean): void;
+        /**
+        * Get the current class name of the texture useful for serialization or dynamic coding.
+        * @returns "PBRSubSurfaceConfiguration"
+        */
+        getClassName(): string;
+        /**
+         * Add fallbacks to the effect fallbacks list.
+         * @param defines defines the Base texture to use.
+         * @param fallbacks defines the current fallback list.
+         * @param currentRank defines the current fallback rank.
+         * @returns the new fallback rank.
+         */
+        static AddFallbacks(defines: IMaterialSubSurfaceDefines, fallbacks: EffectFallbacks, currentRank: number): number;
+        /**
+         * Add the required uniforms to the current list.
+         * @param uniforms defines the current uniform list.
+         */
+        static AddUniforms(uniforms: string[]): void;
+        /**
+         * Add the required samplers to the current list.
+         * @param samplers defines the current sampler list.
+         */
+        static AddSamplers(samplers: string[]): void;
+        /**
+         * Add the required uniforms to the current buffer.
+         * @param uniformBuffer defines the current uniform buffer.
+         */
+        static PrepareUniformBuffer(uniformBuffer: UniformBuffer): void;
+        /**
+         * Makes a duplicate of the current configuration into another one.
+         * @param configuration define the config where to copy the info
+         */
+        copyTo(configuration: PBRSubSurfaceConfiguration): void;
+        /**
+         * Serializes this Sub Surface configuration.
+         * @returns - An object with the serialized config.
+         */
+        serialize(): any;
+        /**
+         * Parses a Sub Surface Configuration from a serialized object.
+         * @param source - Serialized object.
+         */
+        parse(source: any): void;
+    }
+}
+declare module BABYLON {
     /** @hidden */
     /** @hidden */
     export var pbrFragmentDeclaration: {
     export var pbrFragmentDeclaration: {
         name: string;
         name: string;
@@ -44232,7 +44478,7 @@ declare module BABYLON {
      * Manages the defines for the PBR Material.
      * Manages the defines for the PBR Material.
      * @hidden
      * @hidden
      */
      */
-    export class PBRMaterialDefines extends MaterialDefines implements IImageProcessingConfigurationDefines, IMaterialClearCoatDefines, IMaterialAnisotropicDefines, IMaterialBRDFDefines, IMaterialSheenDefines {
+    export class PBRMaterialDefines extends MaterialDefines implements IImageProcessingConfigurationDefines, IMaterialClearCoatDefines, IMaterialAnisotropicDefines, IMaterialBRDFDefines, IMaterialSheenDefines, IMaterialSubSurfaceDefines {
         PBR: boolean;
         PBR: boolean;
         MAINUV1: boolean;
         MAINUV1: boolean;
         MAINUV2: boolean;
         MAINUV2: boolean;
@@ -44309,13 +44555,6 @@ declare module BABYLON {
         RGBDREFLECTION: boolean;
         RGBDREFLECTION: boolean;
         RADIANCEOCCLUSION: boolean;
         RADIANCEOCCLUSION: boolean;
         HORIZONOCCLUSION: boolean;
         HORIZONOCCLUSION: boolean;
-        REFRACTION: boolean;
-        REFRACTIONMAP_3D: boolean;
-        REFRACTIONMAP_OPPOSITEZ: boolean;
-        LODINREFRACTIONALPHA: boolean;
-        GAMMAREFRACTION: boolean;
-        RGBDREFRACTION: boolean;
-        LINKREFRACTIONTOTRANSPARENCY: boolean;
         INSTANCES: boolean;
         INSTANCES: boolean;
         NUM_BONE_INFLUENCERS: number;
         NUM_BONE_INFLUENCERS: number;
         BonesPerMesh: number;
         BonesPerMesh: number;
@@ -44371,6 +44610,19 @@ declare module BABYLON {
         SHEEN_TEXTURE: boolean;
         SHEEN_TEXTURE: boolean;
         SHEEN_TEXTUREDIRECTUV: number;
         SHEEN_TEXTUREDIRECTUV: number;
         SHEEN_LINKWITHALBEDO: boolean;
         SHEEN_LINKWITHALBEDO: boolean;
+        SUBSURFACE: boolean;
+        SS_REFRACTION: boolean;
+        SS_TRANSLUCENCY: boolean;
+        SS_SCATERRING: boolean;
+        SS_THICKNESSANDMASK_TEXTURE: boolean;
+        SS_THICKNESSANDMASK_TEXTUREDIRECTUV: number;
+        SS_REFRACTIONMAP_3D: boolean;
+        SS_REFRACTIONMAP_OPPOSITEZ: boolean;
+        SS_LODINREFRACTIONALPHA: boolean;
+        SS_GAMMAREFRACTION: boolean;
+        SS_RGBDREFRACTION: boolean;
+        SS_LINKREFRACTIONTOTRANSPARENCY: boolean;
+        SS_MASK_FROM_THICKNESS_TEXTURE: boolean;
         UNLIT: boolean;
         UNLIT: boolean;
         DEBUGMODE: number;
         DEBUGMODE: number;
         /**
         /**
@@ -44481,10 +44733,6 @@ declare module BABYLON {
          */
          */
         protected _reflectionTexture: BaseTexture;
         protected _reflectionTexture: BaseTexture;
         /**
         /**
-         * Stores the refraction values in a texture.
-         */
-        protected _refractionTexture: BaseTexture;
-        /**
          * Stores the emissive values in a texture.
          * Stores the emissive values in a texture.
          */
          */
         protected _emissiveTexture: BaseTexture;
         protected _emissiveTexture: BaseTexture;
@@ -44544,19 +44792,6 @@ declare module BABYLON {
          */
          */
         protected _microSurface: number;
         protected _microSurface: number;
         /**
         /**
-         * source material index of refraction (IOR)' / 'destination material IOR.
-         */
-        protected _indexOfRefraction: number;
-        /**
-         * Controls if refraction needs to be inverted on Y. This could be useful for procedural texture.
-         */
-        protected _invertRefractionY: boolean;
-        /**
-         * 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.
-         */
-        protected _linkRefractionWithTransparency: boolean;
-        /**
          * Specifies that the material will use the light map as a show map.
          * Specifies that the material will use the light map as a show map.
          */
          */
         protected _useLightmapAsShadowmap: boolean;
         protected _useLightmapAsShadowmap: boolean;
@@ -44766,6 +45001,10 @@ declare module BABYLON {
          */
          */
         readonly sheen: PBRSheenConfiguration;
         readonly sheen: PBRSheenConfiguration;
         /**
         /**
+         * Defines the SubSurface parameters for the material.
+         */
+        readonly subSurface: PBRSubSurfaceConfiguration;
+        /**
          * Custom callback helping to override the default shader used in the material.
          * Custom callback helping to override the default shader used in the material.
          */
          */
         customShaderNameResolve: (shaderName: string, uniforms: string[], uniformBuffers: string[], samplers: string[], defines: PBRMaterialDefines) => string;
         customShaderNameResolve: (shaderName: string, uniforms: string[], uniformBuffers: string[], samplers: string[], defines: PBRMaterialDefines) => string;
@@ -44857,7 +45096,7 @@ declare module BABYLON {
          */
          */
         buildUniformLayout(): void;
         buildUniformLayout(): void;
         /**
         /**
-         * Unbinds the textures.
+         * Unbinds the material from the mesh
          */
          */
         unbind(): void;
         unbind(): void;
         /**
         /**
@@ -44878,12 +45117,6 @@ declare module BABYLON {
          */
          */
         private _getReflectionTexture;
         private _getReflectionTexture;
         /**
         /**
-         * Returns the texture used for refraction or null if none is used.
-         * @returns - Refection texture if present.  If no refraction texture and refraction
-         * is linked with transparency, returns environment texture.  Otherwise, returns null.
-         */
-        private _getRefractionTexture;
-        /**
          * Returns an array of the actively used textures.
          * Returns an array of the actively used textures.
          * @returns - Array of BaseTextures
          * @returns - Array of BaseTextures
          */
          */
@@ -45021,7 +45254,7 @@ declare module BABYLON {
         /**
         /**
          * Stores the refracted light information in a texture.
          * Stores the refracted light information in a texture.
          */
          */
-        refractionTexture: BaseTexture;
+        refractionTexture: Nullable<BaseTexture>;
         /**
         /**
          * The color of a material in ambient lighting.
          * The color of a material in ambient lighting.
          */
          */

Файловите разлики са ограничени, защото са твърде много
+ 2 - 2
dist/preview release/babylon.js


Файловите разлики са ограничени, защото са твърде много
+ 780 - 269
dist/preview release/babylon.max.js


Файловите разлики са ограничени, защото са твърде много
+ 1 - 1
dist/preview release/babylon.max.js.map


+ 551 - 74
dist/preview release/babylon.module.d.ts

@@ -22665,7 +22665,7 @@ declare module "babylonjs/Materials/material" {
          * @param rootUrl defines the root URL to use to load textures
          * @param rootUrl defines the root URL to use to load textures
          * @returns a new material
          * @returns a new material
          */
          */
-        static Parse(parsedMaterial: any, scene: Scene, rootUrl: string): any;
+        static Parse(parsedMaterial: any, scene: Scene, rootUrl: string): Nullable<Material>;
     }
     }
 }
 }
 declare module "babylonjs/Meshes/subMesh" {
 declare module "babylonjs/Meshes/subMesh" {
@@ -39277,6 +39277,11 @@ declare module "babylonjs/Materials/materialFlags" {
          * Are anisotropic textures enabled in the application.
          * Are anisotropic textures enabled in the application.
          */
          */
         static AnisotropicTextureEnabled: boolean;
         static AnisotropicTextureEnabled: boolean;
+        private static _ThicknessTextureEnabled;
+        /**
+         * Are thickness textures enabled in the application.
+         */
+        static ThicknessTextureEnabled: boolean;
     }
     }
 }
 }
 declare module "babylonjs/Shaders/ShadersInclude/defaultFragmentDeclaration" {
 declare module "babylonjs/Shaders/ShadersInclude/defaultFragmentDeclaration" {
@@ -45365,12 +45370,12 @@ declare module "babylonjs/Materials/PBR/pbrClearCoatConfiguration" {
          */
          */
         isTintEnabled: boolean;
         isTintEnabled: boolean;
         /**
         /**
-         * Defines if the clear coat tint is enabled in the material.
+         * Defines the clear coat tint of the material.
          * This is only use if tint is enabled
          * This is only use if tint is enabled
          */
          */
         tintColor: Color3;
         tintColor: Color3;
         /**
         /**
-         * Defines if the distance at which the tint color should be found in the
+         * Defines the distance at which the tint color should be found in the
          * clear coat media.
          * clear coat media.
          * This is only use if tint is enabled
          * This is only use if tint is enabled
          */
          */
@@ -45397,7 +45402,7 @@ declare module "babylonjs/Materials/PBR/pbrClearCoatConfiguration" {
          */
          */
         constructor(markAllSubMeshesAsTexturesDirty: () => void);
         constructor(markAllSubMeshesAsTexturesDirty: () => void);
         /**
         /**
-         * Specifies that the submesh is ready to be used.
+         * Gets wehter the submesh is ready to be used or not.
          * @param defines the list of "defines" to update.
          * @param defines the list of "defines" to update.
          * @param scene defines the scene the material belongs to.
          * @param scene defines the scene the material belongs to.
          * @param engine defines the engine the material belongs to.
          * @param engine defines the engine the material belongs to.
@@ -45847,6 +45852,257 @@ declare module "babylonjs/Materials/PBR/pbrSheenConfiguration" {
         parse(source: any): void;
         parse(source: any): void;
     }
     }
 }
 }
+declare module "babylonjs/Materials/PBR/pbrSubSurfaceConfiguration" {
+    import { Nullable } from "babylonjs/types";
+    import { IAnimatable } from "babylonjs/Misc/tools";
+    import { Color3 } from "babylonjs/Maths/math";
+    import { SmartArray } from "babylonjs/Misc/smartArray";
+    import { BaseTexture } from "babylonjs/Materials/Textures/baseTexture";
+    import { RenderTargetTexture } from "babylonjs/Materials/Textures/renderTargetTexture";
+    import { Effect, EffectFallbacks } from "babylonjs/Materials/effect";
+    import { UniformBuffer } from "babylonjs/Materials/uniformBuffer";
+    import { Engine } from "babylonjs/Engines/engine";
+    import { Scene } from "babylonjs/scene";
+    /**
+     * @hidden
+     */
+    export interface IMaterialSubSurfaceDefines {
+        SUBSURFACE: boolean;
+        SS_REFRACTION: boolean;
+        SS_TRANSLUCENCY: boolean;
+        SS_SCATERRING: boolean;
+        SS_THICKNESSANDMASK_TEXTURE: boolean;
+        SS_THICKNESSANDMASK_TEXTUREDIRECTUV: number;
+        SS_REFRACTIONMAP_3D: boolean;
+        SS_REFRACTIONMAP_OPPOSITEZ: boolean;
+        SS_LODINREFRACTIONALPHA: boolean;
+        SS_GAMMAREFRACTION: boolean;
+        SS_RGBDREFRACTION: boolean;
+        SS_LINKREFRACTIONTOTRANSPARENCY: boolean;
+        SS_MASK_FROM_THICKNESS_TEXTURE: boolean;
+        /** @hidden */
+        _areTexturesDirty: boolean;
+    }
+    /**
+     * Define the code related to the sub surface parameters of the pbr material.
+     */
+    export class PBRSubSurfaceConfiguration {
+        private _isRefractionEnabled;
+        /**
+         * Defines if the refraction is enabled in the material.
+         */
+        isRefractionEnabled: boolean;
+        private _isTranslucencyEnabled;
+        /**
+         * Defines if the translucency is enabled in the material.
+         */
+        isTranslucencyEnabled: boolean;
+        private _isScatteringEnabled;
+        /**
+         * 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.
+         */
+        refractionIntensity: number;
+        /**
+         * 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.
+         */
+        translucencyIntensity: number;
+        /**
+         * Defines the scattering intensity of the material.
+         * When scattering has been enabled, this defines how much of the "scattered light"
+         * is addded to the diffuse part of the material.
+         */
+        scatteringIntensity: number;
+        private _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.
+         */
+        thicknessTexture: Nullable<BaseTexture>;
+        private _refractionTexture;
+        /**
+         * Defines the texture to use for refraction.
+         */
+        refractionTexture: Nullable<BaseTexture>;
+        private _indexOfRefraction;
+        /**
+         * Defines the indice of refraction used in the material.
+         * https://en.wikipedia.org/wiki/List_of_refractive_indices
+         */
+        indexOfRefraction: number;
+        private _invertRefractionY;
+        /**
+         * Controls if refraction needs to be inverted on Y. This could be useful for procedural texture.
+         */
+        invertRefractionY: boolean;
+        private _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.
+         */
+        linkRefractionWithTransparency: boolean;
+        /**
+         * Defines the minimum thickness stored in the thickness map.
+         * If no thickness map is defined, this value will be used to simulate thickness.
+         */
+        minimumThickness: number;
+        /**
+         * Defines the maximum thickness stored in the thickness map.
+         */
+        maximumThickness: number;
+        /**
+         * Defines the volume tint of the material.
+         * This is used for both translucency and scattering.
+         */
+        tintColor: Color3;
+        /**
+         * Defines the distance at which the tint color should be found in the media.
+         * This is used for refraction only.
+         */
+        tintColorAtDistance: number;
+        /**
+         * Defines how far each channel transmit through the media.
+         * It is defined as a color to simplify it selection.
+         */
+        diffusionDistance: Color3;
+        private _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.
+         */
+        useMaskFromThicknessTexture: boolean;
+        /** @hidden */
+        private _internalMarkAllSubMeshesAsTexturesDirty;
+        /** @hidden */
+        _markAllSubMeshesAsTexturesDirty(): void;
+        /**
+         * Instantiate a new istance of sub surface configuration.
+         * @param markAllSubMeshesAsTexturesDirty Callback to flag the material to dirty
+         */
+        constructor(markAllSubMeshesAsTexturesDirty: () => void);
+        /**
+         * Gets wehter the submesh is ready to be used or not.
+         * @param defines the list of "defines" to update.
+         * @param scene defines the scene the material belongs to.
+         * @returns - boolean indicating that the submesh is ready or not.
+         */
+        isReadyForSubMesh(defines: IMaterialSubSurfaceDefines, scene: Scene): boolean;
+        /**
+         * Checks to see if a texture is used in the material.
+         * @param defines the list of "defines" to update.
+         * @param scene defines the scene to the material belongs to.
+         */
+        prepareDefines(defines: IMaterialSubSurfaceDefines, scene: Scene): void;
+        /**
+         * Binds the material data.
+         * @param uniformBuffer defines the Uniform buffer to fill in.
+         * @param scene defines the scene the material belongs to.
+         * @param engine defines the engine the material belongs to.
+         * @param isFrozen defines wether the material is frozen or not.
+         * @param lodBasedMicrosurface defines wether the material relies on lod based microsurface or not.
+         */
+        bindForSubMesh(uniformBuffer: UniformBuffer, scene: Scene, engine: Engine, isFrozen: boolean, lodBasedMicrosurface: boolean): void;
+        /**
+         * Unbinds the material from the mesh.
+         * @param activeEffect defines the effect that should be unbound from.
+         * @returns true if unbound, otherwise false
+         */
+        unbind(activeEffect: Effect): boolean;
+        /**
+         * Returns the texture used for refraction or null if none is used.
+         * @param scene defines the scene the material belongs to.
+         * @returns - Refraction texture if present.  If no refraction texture and refraction
+         * is linked with transparency, returns environment texture.  Otherwise, returns null.
+         */
+        private _getRefractionTexture;
+        /**
+         * Returns true if alpha blending should be disabled.
+         */
+        readonly disableAlphaBlending: boolean;
+        /**
+         * Fills the list of render target textures.
+         * @param renderTargets the list of render targets to update
+         */
+        fillRenderTargetTextures(renderTargets: SmartArray<RenderTargetTexture>): void;
+        /**
+         * Checks to see if a texture is used in the material.
+         * @param texture - Base texture to use.
+         * @returns - Boolean specifying if a texture is used in the material.
+         */
+        hasTexture(texture: BaseTexture): boolean;
+        /**
+         * Gets a boolean indicating that current material needs to register RTT
+         * @returns true if this uses a render target otherwise false.
+         */
+        hasRenderTargetTextures(): boolean;
+        /**
+         * Returns an array of the actively used textures.
+         * @param activeTextures Array of BaseTextures
+         */
+        getActiveTextures(activeTextures: BaseTexture[]): void;
+        /**
+         * Returns the animatable textures.
+         * @param animatables Array of animatable textures.
+         */
+        getAnimatables(animatables: IAnimatable[]): void;
+        /**
+         * Disposes the resources of the material.
+         * @param forceDisposeTextures - Forces the disposal of all textures.
+         */
+        dispose(forceDisposeTextures?: boolean): void;
+        /**
+        * Get the current class name of the texture useful for serialization or dynamic coding.
+        * @returns "PBRSubSurfaceConfiguration"
+        */
+        getClassName(): string;
+        /**
+         * Add fallbacks to the effect fallbacks list.
+         * @param defines defines the Base texture to use.
+         * @param fallbacks defines the current fallback list.
+         * @param currentRank defines the current fallback rank.
+         * @returns the new fallback rank.
+         */
+        static AddFallbacks(defines: IMaterialSubSurfaceDefines, fallbacks: EffectFallbacks, currentRank: number): number;
+        /**
+         * Add the required uniforms to the current list.
+         * @param uniforms defines the current uniform list.
+         */
+        static AddUniforms(uniforms: string[]): void;
+        /**
+         * Add the required samplers to the current list.
+         * @param samplers defines the current sampler list.
+         */
+        static AddSamplers(samplers: string[]): void;
+        /**
+         * Add the required uniforms to the current buffer.
+         * @param uniformBuffer defines the current uniform buffer.
+         */
+        static PrepareUniformBuffer(uniformBuffer: UniformBuffer): void;
+        /**
+         * Makes a duplicate of the current configuration into another one.
+         * @param configuration define the config where to copy the info
+         */
+        copyTo(configuration: PBRSubSurfaceConfiguration): void;
+        /**
+         * Serializes this Sub Surface configuration.
+         * @returns - An object with the serialized config.
+         */
+        serialize(): any;
+        /**
+         * Parses a Sub Surface Configuration from a serialized object.
+         * @param source - Serialized object.
+         */
+        parse(source: any): void;
+    }
+}
 declare module "babylonjs/Shaders/ShadersInclude/pbrFragmentDeclaration" {
 declare module "babylonjs/Shaders/ShadersInclude/pbrFragmentDeclaration" {
     /** @hidden */
     /** @hidden */
     export var pbrFragmentDeclaration: {
     export var pbrFragmentDeclaration: {
@@ -46015,6 +46271,7 @@ declare module "babylonjs/Materials/PBR/pbrBaseMaterial" {
     import { IMaterialAnisotropicDefines, PBRAnisotropicConfiguration } from "babylonjs/Materials/PBR/pbrAnisotropicConfiguration";
     import { IMaterialAnisotropicDefines, PBRAnisotropicConfiguration } from "babylonjs/Materials/PBR/pbrAnisotropicConfiguration";
     import { IMaterialBRDFDefines, PBRBRDFConfiguration } from "babylonjs/Materials/PBR/pbrBRDFConfiguration";
     import { IMaterialBRDFDefines, PBRBRDFConfiguration } from "babylonjs/Materials/PBR/pbrBRDFConfiguration";
     import { IMaterialSheenDefines, PBRSheenConfiguration } from "babylonjs/Materials/PBR/pbrSheenConfiguration";
     import { IMaterialSheenDefines, PBRSheenConfiguration } from "babylonjs/Materials/PBR/pbrSheenConfiguration";
+    import { IMaterialSubSurfaceDefines, PBRSubSurfaceConfiguration } from "babylonjs/Materials/PBR/pbrSubSurfaceConfiguration";
     import { ImageProcessingConfiguration, IImageProcessingConfigurationDefines } from "babylonjs/Materials/imageProcessingConfiguration";
     import { ImageProcessingConfiguration, IImageProcessingConfigurationDefines } from "babylonjs/Materials/imageProcessingConfiguration";
     import { Material } from "babylonjs/Materials/material";
     import { Material } from "babylonjs/Materials/material";
     import { MaterialDefines } from "babylonjs/Materials/materialDefines";
     import { MaterialDefines } from "babylonjs/Materials/materialDefines";
@@ -46026,7 +46283,7 @@ declare module "babylonjs/Materials/PBR/pbrBaseMaterial" {
      * Manages the defines for the PBR Material.
      * Manages the defines for the PBR Material.
      * @hidden
      * @hidden
      */
      */
-    export class PBRMaterialDefines extends MaterialDefines implements IImageProcessingConfigurationDefines, IMaterialClearCoatDefines, IMaterialAnisotropicDefines, IMaterialBRDFDefines, IMaterialSheenDefines {
+    export class PBRMaterialDefines extends MaterialDefines implements IImageProcessingConfigurationDefines, IMaterialClearCoatDefines, IMaterialAnisotropicDefines, IMaterialBRDFDefines, IMaterialSheenDefines, IMaterialSubSurfaceDefines {
         PBR: boolean;
         PBR: boolean;
         MAINUV1: boolean;
         MAINUV1: boolean;
         MAINUV2: boolean;
         MAINUV2: boolean;
@@ -46103,13 +46360,6 @@ declare module "babylonjs/Materials/PBR/pbrBaseMaterial" {
         RGBDREFLECTION: boolean;
         RGBDREFLECTION: boolean;
         RADIANCEOCCLUSION: boolean;
         RADIANCEOCCLUSION: boolean;
         HORIZONOCCLUSION: boolean;
         HORIZONOCCLUSION: boolean;
-        REFRACTION: boolean;
-        REFRACTIONMAP_3D: boolean;
-        REFRACTIONMAP_OPPOSITEZ: boolean;
-        LODINREFRACTIONALPHA: boolean;
-        GAMMAREFRACTION: boolean;
-        RGBDREFRACTION: boolean;
-        LINKREFRACTIONTOTRANSPARENCY: boolean;
         INSTANCES: boolean;
         INSTANCES: boolean;
         NUM_BONE_INFLUENCERS: number;
         NUM_BONE_INFLUENCERS: number;
         BonesPerMesh: number;
         BonesPerMesh: number;
@@ -46165,6 +46415,19 @@ declare module "babylonjs/Materials/PBR/pbrBaseMaterial" {
         SHEEN_TEXTURE: boolean;
         SHEEN_TEXTURE: boolean;
         SHEEN_TEXTUREDIRECTUV: number;
         SHEEN_TEXTUREDIRECTUV: number;
         SHEEN_LINKWITHALBEDO: boolean;
         SHEEN_LINKWITHALBEDO: boolean;
+        SUBSURFACE: boolean;
+        SS_REFRACTION: boolean;
+        SS_TRANSLUCENCY: boolean;
+        SS_SCATERRING: boolean;
+        SS_THICKNESSANDMASK_TEXTURE: boolean;
+        SS_THICKNESSANDMASK_TEXTUREDIRECTUV: number;
+        SS_REFRACTIONMAP_3D: boolean;
+        SS_REFRACTIONMAP_OPPOSITEZ: boolean;
+        SS_LODINREFRACTIONALPHA: boolean;
+        SS_GAMMAREFRACTION: boolean;
+        SS_RGBDREFRACTION: boolean;
+        SS_LINKREFRACTIONTOTRANSPARENCY: boolean;
+        SS_MASK_FROM_THICKNESS_TEXTURE: boolean;
         UNLIT: boolean;
         UNLIT: boolean;
         DEBUGMODE: number;
         DEBUGMODE: number;
         /**
         /**
@@ -46275,10 +46538,6 @@ declare module "babylonjs/Materials/PBR/pbrBaseMaterial" {
          */
          */
         protected _reflectionTexture: BaseTexture;
         protected _reflectionTexture: BaseTexture;
         /**
         /**
-         * Stores the refraction values in a texture.
-         */
-        protected _refractionTexture: BaseTexture;
-        /**
          * Stores the emissive values in a texture.
          * Stores the emissive values in a texture.
          */
          */
         protected _emissiveTexture: BaseTexture;
         protected _emissiveTexture: BaseTexture;
@@ -46338,19 +46597,6 @@ declare module "babylonjs/Materials/PBR/pbrBaseMaterial" {
          */
          */
         protected _microSurface: number;
         protected _microSurface: number;
         /**
         /**
-         * source material index of refraction (IOR)' / 'destination material IOR.
-         */
-        protected _indexOfRefraction: number;
-        /**
-         * Controls if refraction needs to be inverted on Y. This could be useful for procedural texture.
-         */
-        protected _invertRefractionY: boolean;
-        /**
-         * 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.
-         */
-        protected _linkRefractionWithTransparency: boolean;
-        /**
          * Specifies that the material will use the light map as a show map.
          * Specifies that the material will use the light map as a show map.
          */
          */
         protected _useLightmapAsShadowmap: boolean;
         protected _useLightmapAsShadowmap: boolean;
@@ -46560,6 +46806,10 @@ declare module "babylonjs/Materials/PBR/pbrBaseMaterial" {
          */
          */
         readonly sheen: PBRSheenConfiguration;
         readonly sheen: PBRSheenConfiguration;
         /**
         /**
+         * Defines the SubSurface parameters for the material.
+         */
+        readonly subSurface: PBRSubSurfaceConfiguration;
+        /**
          * Custom callback helping to override the default shader used in the material.
          * Custom callback helping to override the default shader used in the material.
          */
          */
         customShaderNameResolve: (shaderName: string, uniforms: string[], uniformBuffers: string[], samplers: string[], defines: PBRMaterialDefines) => string;
         customShaderNameResolve: (shaderName: string, uniforms: string[], uniformBuffers: string[], samplers: string[], defines: PBRMaterialDefines) => string;
@@ -46651,7 +46901,7 @@ declare module "babylonjs/Materials/PBR/pbrBaseMaterial" {
          */
          */
         buildUniformLayout(): void;
         buildUniformLayout(): void;
         /**
         /**
-         * Unbinds the textures.
+         * Unbinds the material from the mesh
          */
          */
         unbind(): void;
         unbind(): void;
         /**
         /**
@@ -46672,12 +46922,6 @@ declare module "babylonjs/Materials/PBR/pbrBaseMaterial" {
          */
          */
         private _getReflectionTexture;
         private _getReflectionTexture;
         /**
         /**
-         * Returns the texture used for refraction or null if none is used.
-         * @returns - Refection texture if present.  If no refraction texture and refraction
-         * is linked with transparency, returns environment texture.  Otherwise, returns null.
-         */
-        private _getRefractionTexture;
-        /**
          * Returns an array of the actively used textures.
          * Returns an array of the actively used textures.
          * @returns - Array of BaseTextures
          * @returns - Array of BaseTextures
          */
          */
@@ -46822,7 +47066,7 @@ declare module "babylonjs/Materials/PBR/pbrMaterial" {
         /**
         /**
          * Stores the refracted light information in a texture.
          * Stores the refracted light information in a texture.
          */
          */
-        refractionTexture: BaseTexture;
+        refractionTexture: Nullable<BaseTexture>;
         /**
         /**
          * The color of a material in ambient lighting.
          * The color of a material in ambient lighting.
          */
          */
@@ -81267,7 +81511,7 @@ declare module BABYLON {
          * @param rootUrl defines the root URL to use to load textures
          * @param rootUrl defines the root URL to use to load textures
          * @returns a new material
          * @returns a new material
          */
          */
-        static Parse(parsedMaterial: any, scene: Scene, rootUrl: string): any;
+        static Parse(parsedMaterial: any, scene: Scene, rootUrl: string): Nullable<Material>;
     }
     }
 }
 }
 declare module BABYLON {
 declare module BABYLON {
@@ -97291,6 +97535,11 @@ declare module BABYLON {
          * Are anisotropic textures enabled in the application.
          * Are anisotropic textures enabled in the application.
          */
          */
         static AnisotropicTextureEnabled: boolean;
         static AnisotropicTextureEnabled: boolean;
+        private static _ThicknessTextureEnabled;
+        /**
+         * Are thickness textures enabled in the application.
+         */
+        static ThicknessTextureEnabled: boolean;
     }
     }
 }
 }
 declare module BABYLON {
 declare module BABYLON {
@@ -102834,12 +103083,12 @@ declare module BABYLON {
          */
          */
         isTintEnabled: boolean;
         isTintEnabled: boolean;
         /**
         /**
-         * Defines if the clear coat tint is enabled in the material.
+         * Defines the clear coat tint of the material.
          * This is only use if tint is enabled
          * This is only use if tint is enabled
          */
          */
         tintColor: Color3;
         tintColor: Color3;
         /**
         /**
-         * Defines if the distance at which the tint color should be found in the
+         * Defines the distance at which the tint color should be found in the
          * clear coat media.
          * clear coat media.
          * This is only use if tint is enabled
          * This is only use if tint is enabled
          */
          */
@@ -102866,7 +103115,7 @@ declare module BABYLON {
          */
          */
         constructor(markAllSubMeshesAsTexturesDirty: () => void);
         constructor(markAllSubMeshesAsTexturesDirty: () => void);
         /**
         /**
-         * Specifies that the submesh is ready to be used.
+         * Gets wehter the submesh is ready to be used or not.
          * @param defines the list of "defines" to update.
          * @param defines the list of "defines" to update.
          * @param scene defines the scene the material belongs to.
          * @param scene defines the scene the material belongs to.
          * @param engine defines the engine the material belongs to.
          * @param engine defines the engine the material belongs to.
@@ -103302,6 +103551,247 @@ declare module BABYLON {
     }
     }
 }
 }
 declare module BABYLON {
 declare module BABYLON {
+    /**
+     * @hidden
+     */
+    export interface IMaterialSubSurfaceDefines {
+        SUBSURFACE: boolean;
+        SS_REFRACTION: boolean;
+        SS_TRANSLUCENCY: boolean;
+        SS_SCATERRING: boolean;
+        SS_THICKNESSANDMASK_TEXTURE: boolean;
+        SS_THICKNESSANDMASK_TEXTUREDIRECTUV: number;
+        SS_REFRACTIONMAP_3D: boolean;
+        SS_REFRACTIONMAP_OPPOSITEZ: boolean;
+        SS_LODINREFRACTIONALPHA: boolean;
+        SS_GAMMAREFRACTION: boolean;
+        SS_RGBDREFRACTION: boolean;
+        SS_LINKREFRACTIONTOTRANSPARENCY: boolean;
+        SS_MASK_FROM_THICKNESS_TEXTURE: boolean;
+        /** @hidden */
+        _areTexturesDirty: boolean;
+    }
+    /**
+     * Define the code related to the sub surface parameters of the pbr material.
+     */
+    export class PBRSubSurfaceConfiguration {
+        private _isRefractionEnabled;
+        /**
+         * Defines if the refraction is enabled in the material.
+         */
+        isRefractionEnabled: boolean;
+        private _isTranslucencyEnabled;
+        /**
+         * Defines if the translucency is enabled in the material.
+         */
+        isTranslucencyEnabled: boolean;
+        private _isScatteringEnabled;
+        /**
+         * 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.
+         */
+        refractionIntensity: number;
+        /**
+         * 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.
+         */
+        translucencyIntensity: number;
+        /**
+         * Defines the scattering intensity of the material.
+         * When scattering has been enabled, this defines how much of the "scattered light"
+         * is addded to the diffuse part of the material.
+         */
+        scatteringIntensity: number;
+        private _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.
+         */
+        thicknessTexture: Nullable<BaseTexture>;
+        private _refractionTexture;
+        /**
+         * Defines the texture to use for refraction.
+         */
+        refractionTexture: Nullable<BaseTexture>;
+        private _indexOfRefraction;
+        /**
+         * Defines the indice of refraction used in the material.
+         * https://en.wikipedia.org/wiki/List_of_refractive_indices
+         */
+        indexOfRefraction: number;
+        private _invertRefractionY;
+        /**
+         * Controls if refraction needs to be inverted on Y. This could be useful for procedural texture.
+         */
+        invertRefractionY: boolean;
+        private _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.
+         */
+        linkRefractionWithTransparency: boolean;
+        /**
+         * Defines the minimum thickness stored in the thickness map.
+         * If no thickness map is defined, this value will be used to simulate thickness.
+         */
+        minimumThickness: number;
+        /**
+         * Defines the maximum thickness stored in the thickness map.
+         */
+        maximumThickness: number;
+        /**
+         * Defines the volume tint of the material.
+         * This is used for both translucency and scattering.
+         */
+        tintColor: Color3;
+        /**
+         * Defines the distance at which the tint color should be found in the media.
+         * This is used for refraction only.
+         */
+        tintColorAtDistance: number;
+        /**
+         * Defines how far each channel transmit through the media.
+         * It is defined as a color to simplify it selection.
+         */
+        diffusionDistance: Color3;
+        private _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.
+         */
+        useMaskFromThicknessTexture: boolean;
+        /** @hidden */
+        private _internalMarkAllSubMeshesAsTexturesDirty;
+        /** @hidden */
+        _markAllSubMeshesAsTexturesDirty(): void;
+        /**
+         * Instantiate a new istance of sub surface configuration.
+         * @param markAllSubMeshesAsTexturesDirty Callback to flag the material to dirty
+         */
+        constructor(markAllSubMeshesAsTexturesDirty: () => void);
+        /**
+         * Gets wehter the submesh is ready to be used or not.
+         * @param defines the list of "defines" to update.
+         * @param scene defines the scene the material belongs to.
+         * @returns - boolean indicating that the submesh is ready or not.
+         */
+        isReadyForSubMesh(defines: IMaterialSubSurfaceDefines, scene: Scene): boolean;
+        /**
+         * Checks to see if a texture is used in the material.
+         * @param defines the list of "defines" to update.
+         * @param scene defines the scene to the material belongs to.
+         */
+        prepareDefines(defines: IMaterialSubSurfaceDefines, scene: Scene): void;
+        /**
+         * Binds the material data.
+         * @param uniformBuffer defines the Uniform buffer to fill in.
+         * @param scene defines the scene the material belongs to.
+         * @param engine defines the engine the material belongs to.
+         * @param isFrozen defines wether the material is frozen or not.
+         * @param lodBasedMicrosurface defines wether the material relies on lod based microsurface or not.
+         */
+        bindForSubMesh(uniformBuffer: UniformBuffer, scene: Scene, engine: Engine, isFrozen: boolean, lodBasedMicrosurface: boolean): void;
+        /**
+         * Unbinds the material from the mesh.
+         * @param activeEffect defines the effect that should be unbound from.
+         * @returns true if unbound, otherwise false
+         */
+        unbind(activeEffect: Effect): boolean;
+        /**
+         * Returns the texture used for refraction or null if none is used.
+         * @param scene defines the scene the material belongs to.
+         * @returns - Refraction texture if present.  If no refraction texture and refraction
+         * is linked with transparency, returns environment texture.  Otherwise, returns null.
+         */
+        private _getRefractionTexture;
+        /**
+         * Returns true if alpha blending should be disabled.
+         */
+        readonly disableAlphaBlending: boolean;
+        /**
+         * Fills the list of render target textures.
+         * @param renderTargets the list of render targets to update
+         */
+        fillRenderTargetTextures(renderTargets: SmartArray<RenderTargetTexture>): void;
+        /**
+         * Checks to see if a texture is used in the material.
+         * @param texture - Base texture to use.
+         * @returns - Boolean specifying if a texture is used in the material.
+         */
+        hasTexture(texture: BaseTexture): boolean;
+        /**
+         * Gets a boolean indicating that current material needs to register RTT
+         * @returns true if this uses a render target otherwise false.
+         */
+        hasRenderTargetTextures(): boolean;
+        /**
+         * Returns an array of the actively used textures.
+         * @param activeTextures Array of BaseTextures
+         */
+        getActiveTextures(activeTextures: BaseTexture[]): void;
+        /**
+         * Returns the animatable textures.
+         * @param animatables Array of animatable textures.
+         */
+        getAnimatables(animatables: IAnimatable[]): void;
+        /**
+         * Disposes the resources of the material.
+         * @param forceDisposeTextures - Forces the disposal of all textures.
+         */
+        dispose(forceDisposeTextures?: boolean): void;
+        /**
+        * Get the current class name of the texture useful for serialization or dynamic coding.
+        * @returns "PBRSubSurfaceConfiguration"
+        */
+        getClassName(): string;
+        /**
+         * Add fallbacks to the effect fallbacks list.
+         * @param defines defines the Base texture to use.
+         * @param fallbacks defines the current fallback list.
+         * @param currentRank defines the current fallback rank.
+         * @returns the new fallback rank.
+         */
+        static AddFallbacks(defines: IMaterialSubSurfaceDefines, fallbacks: EffectFallbacks, currentRank: number): number;
+        /**
+         * Add the required uniforms to the current list.
+         * @param uniforms defines the current uniform list.
+         */
+        static AddUniforms(uniforms: string[]): void;
+        /**
+         * Add the required samplers to the current list.
+         * @param samplers defines the current sampler list.
+         */
+        static AddSamplers(samplers: string[]): void;
+        /**
+         * Add the required uniforms to the current buffer.
+         * @param uniformBuffer defines the current uniform buffer.
+         */
+        static PrepareUniformBuffer(uniformBuffer: UniformBuffer): void;
+        /**
+         * Makes a duplicate of the current configuration into another one.
+         * @param configuration define the config where to copy the info
+         */
+        copyTo(configuration: PBRSubSurfaceConfiguration): void;
+        /**
+         * Serializes this Sub Surface configuration.
+         * @returns - An object with the serialized config.
+         */
+        serialize(): any;
+        /**
+         * Parses a Sub Surface Configuration from a serialized object.
+         * @param source - Serialized object.
+         */
+        parse(source: any): void;
+    }
+}
+declare module BABYLON {
     /** @hidden */
     /** @hidden */
     export var pbrFragmentDeclaration: {
     export var pbrFragmentDeclaration: {
         name: string;
         name: string;
@@ -103411,7 +103901,7 @@ declare module BABYLON {
      * Manages the defines for the PBR Material.
      * Manages the defines for the PBR Material.
      * @hidden
      * @hidden
      */
      */
-    export class PBRMaterialDefines extends MaterialDefines implements IImageProcessingConfigurationDefines, IMaterialClearCoatDefines, IMaterialAnisotropicDefines, IMaterialBRDFDefines, IMaterialSheenDefines {
+    export class PBRMaterialDefines extends MaterialDefines implements IImageProcessingConfigurationDefines, IMaterialClearCoatDefines, IMaterialAnisotropicDefines, IMaterialBRDFDefines, IMaterialSheenDefines, IMaterialSubSurfaceDefines {
         PBR: boolean;
         PBR: boolean;
         MAINUV1: boolean;
         MAINUV1: boolean;
         MAINUV2: boolean;
         MAINUV2: boolean;
@@ -103488,13 +103978,6 @@ declare module BABYLON {
         RGBDREFLECTION: boolean;
         RGBDREFLECTION: boolean;
         RADIANCEOCCLUSION: boolean;
         RADIANCEOCCLUSION: boolean;
         HORIZONOCCLUSION: boolean;
         HORIZONOCCLUSION: boolean;
-        REFRACTION: boolean;
-        REFRACTIONMAP_3D: boolean;
-        REFRACTIONMAP_OPPOSITEZ: boolean;
-        LODINREFRACTIONALPHA: boolean;
-        GAMMAREFRACTION: boolean;
-        RGBDREFRACTION: boolean;
-        LINKREFRACTIONTOTRANSPARENCY: boolean;
         INSTANCES: boolean;
         INSTANCES: boolean;
         NUM_BONE_INFLUENCERS: number;
         NUM_BONE_INFLUENCERS: number;
         BonesPerMesh: number;
         BonesPerMesh: number;
@@ -103550,6 +104033,19 @@ declare module BABYLON {
         SHEEN_TEXTURE: boolean;
         SHEEN_TEXTURE: boolean;
         SHEEN_TEXTUREDIRECTUV: number;
         SHEEN_TEXTUREDIRECTUV: number;
         SHEEN_LINKWITHALBEDO: boolean;
         SHEEN_LINKWITHALBEDO: boolean;
+        SUBSURFACE: boolean;
+        SS_REFRACTION: boolean;
+        SS_TRANSLUCENCY: boolean;
+        SS_SCATERRING: boolean;
+        SS_THICKNESSANDMASK_TEXTURE: boolean;
+        SS_THICKNESSANDMASK_TEXTUREDIRECTUV: number;
+        SS_REFRACTIONMAP_3D: boolean;
+        SS_REFRACTIONMAP_OPPOSITEZ: boolean;
+        SS_LODINREFRACTIONALPHA: boolean;
+        SS_GAMMAREFRACTION: boolean;
+        SS_RGBDREFRACTION: boolean;
+        SS_LINKREFRACTIONTOTRANSPARENCY: boolean;
+        SS_MASK_FROM_THICKNESS_TEXTURE: boolean;
         UNLIT: boolean;
         UNLIT: boolean;
         DEBUGMODE: number;
         DEBUGMODE: number;
         /**
         /**
@@ -103660,10 +104156,6 @@ declare module BABYLON {
          */
          */
         protected _reflectionTexture: BaseTexture;
         protected _reflectionTexture: BaseTexture;
         /**
         /**
-         * Stores the refraction values in a texture.
-         */
-        protected _refractionTexture: BaseTexture;
-        /**
          * Stores the emissive values in a texture.
          * Stores the emissive values in a texture.
          */
          */
         protected _emissiveTexture: BaseTexture;
         protected _emissiveTexture: BaseTexture;
@@ -103723,19 +104215,6 @@ declare module BABYLON {
          */
          */
         protected _microSurface: number;
         protected _microSurface: number;
         /**
         /**
-         * source material index of refraction (IOR)' / 'destination material IOR.
-         */
-        protected _indexOfRefraction: number;
-        /**
-         * Controls if refraction needs to be inverted on Y. This could be useful for procedural texture.
-         */
-        protected _invertRefractionY: boolean;
-        /**
-         * 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.
-         */
-        protected _linkRefractionWithTransparency: boolean;
-        /**
          * Specifies that the material will use the light map as a show map.
          * Specifies that the material will use the light map as a show map.
          */
          */
         protected _useLightmapAsShadowmap: boolean;
         protected _useLightmapAsShadowmap: boolean;
@@ -103945,6 +104424,10 @@ declare module BABYLON {
          */
          */
         readonly sheen: PBRSheenConfiguration;
         readonly sheen: PBRSheenConfiguration;
         /**
         /**
+         * Defines the SubSurface parameters for the material.
+         */
+        readonly subSurface: PBRSubSurfaceConfiguration;
+        /**
          * Custom callback helping to override the default shader used in the material.
          * Custom callback helping to override the default shader used in the material.
          */
          */
         customShaderNameResolve: (shaderName: string, uniforms: string[], uniformBuffers: string[], samplers: string[], defines: PBRMaterialDefines) => string;
         customShaderNameResolve: (shaderName: string, uniforms: string[], uniformBuffers: string[], samplers: string[], defines: PBRMaterialDefines) => string;
@@ -104036,7 +104519,7 @@ declare module BABYLON {
          */
          */
         buildUniformLayout(): void;
         buildUniformLayout(): void;
         /**
         /**
-         * Unbinds the textures.
+         * Unbinds the material from the mesh
          */
          */
         unbind(): void;
         unbind(): void;
         /**
         /**
@@ -104057,12 +104540,6 @@ declare module BABYLON {
          */
          */
         private _getReflectionTexture;
         private _getReflectionTexture;
         /**
         /**
-         * Returns the texture used for refraction or null if none is used.
-         * @returns - Refection texture if present.  If no refraction texture and refraction
-         * is linked with transparency, returns environment texture.  Otherwise, returns null.
-         */
-        private _getRefractionTexture;
-        /**
          * Returns an array of the actively used textures.
          * Returns an array of the actively used textures.
          * @returns - Array of BaseTextures
          * @returns - Array of BaseTextures
          */
          */
@@ -104200,7 +104677,7 @@ declare module BABYLON {
         /**
         /**
          * Stores the refracted light information in a texture.
          * Stores the refracted light information in a texture.
          */
          */
-        refractionTexture: BaseTexture;
+        refractionTexture: Nullable<BaseTexture>;
         /**
         /**
          * The color of a material in ambient lighting.
          * The color of a material in ambient lighting.
          */
          */

+ 1 - 1
dist/preview release/glTF2Interface/package.json

@@ -1,7 +1,7 @@
 {
 {
     "name": "babylonjs-gltf2interface",
     "name": "babylonjs-gltf2interface",
     "description": "A typescript declaration of babylon's gltf2 inteface.",
     "description": "A typescript declaration of babylon's gltf2 inteface.",
-    "version": "4.0.0-alpha.33",
+    "version": "4.0.0-beta.1",
     "repository": {
     "repository": {
         "type": "git",
         "type": "git",
         "url": "https://github.com/BabylonJS/Babylon.js.git"
         "url": "https://github.com/BabylonJS/Babylon.js.git"

+ 2 - 2
dist/preview release/gui/package.json

@@ -4,7 +4,7 @@
     },
     },
     "name": "babylonjs-gui",
     "name": "babylonjs-gui",
     "description": "The Babylon.js GUI library is an extension you can use to generate interactive user interface. It is build on top of the DynamicTexture.",
     "description": "The Babylon.js GUI library is an extension you can use to generate interactive user interface. It is build on top of the DynamicTexture.",
-    "version": "4.0.0-alpha.33",
+    "version": "4.0.0-beta.1",
     "repository": {
     "repository": {
         "type": "git",
         "type": "git",
         "url": "https://github.com/BabylonJS/Babylon.js.git"
         "url": "https://github.com/BabylonJS/Babylon.js.git"
@@ -28,7 +28,7 @@
     ],
     ],
     "license": "Apache-2.0",
     "license": "Apache-2.0",
     "dependencies": {
     "dependencies": {
-        "babylonjs": "4.0.0-alpha.33"
+        "babylonjs": "4.0.0-beta.1"
     },
     },
     "engines": {
     "engines": {
         "node": "*"
         "node": "*"

Файловите разлики са ограничени, защото са твърде много
+ 6 - 6
dist/preview release/inspector/babylon.inspector.bundle.js


+ 21 - 1
dist/preview release/inspector/babylon.inspector.bundle.max.js

@@ -37366,6 +37366,7 @@ var PBRMaterialPropertyGridComponent = /** @class */ (function (_super) {
             { label: "ClearCoat Tint Map", value: 28 },
             { label: "ClearCoat Tint Map", value: 28 },
             { label: "Sheen Map", value: 29 },
             { label: "Sheen Map", value: 29 },
             { label: "Anisotropic Map", value: 30 },
             { label: "Anisotropic Map", value: 30 },
+            { label: "Thickness Map", value: 31 },
             // Env
             // Env
             { label: "Env Refraction", value: 40 },
             { label: "Env Refraction", value: 40 },
             { label: "Env Reflection", value: 41 },
             { label: "Env Reflection", value: 41 },
@@ -37385,6 +37386,8 @@ var PBRMaterialPropertyGridComponent = /** @class */ (function (_super) {
             { label: "ClearCoat Color", value: 65 },
             { label: "ClearCoat Color", value: 65 },
             { label: "ClearCoat Roughness", value: 66 },
             { label: "ClearCoat Roughness", value: 66 },
             { label: "ClearCoat NdotV", value: 67 },
             { label: "ClearCoat NdotV", value: 67 },
+            { label: "Transmittance", value: 68 },
+            { label: "Refraction Transmittance", value: 69 },
             // Misc
             // Misc
             { label: "SEO", value: 70 },
             { label: "SEO", value: 70 },
             { label: "EHO", value: 71 },
             { label: "EHO", value: 71 },
@@ -37443,6 +37446,24 @@ var PBRMaterialPropertyGridComponent = /** @class */ (function (_super) {
                         react__WEBPACK_IMPORTED_MODULE_1__["createElement"](_lines_sliderLineComponent__WEBPACK_IMPORTED_MODULE_7__["SliderLineComponent"], { label: "Intensity", target: material.sheen, propertyName: "intensity", minimum: 0, maximum: 1, step: 0.01, onPropertyChangedObservable: this.props.onPropertyChangedObservable }),
                         react__WEBPACK_IMPORTED_MODULE_1__["createElement"](_lines_sliderLineComponent__WEBPACK_IMPORTED_MODULE_7__["SliderLineComponent"], { label: "Intensity", target: material.sheen, propertyName: "intensity", minimum: 0, maximum: 1, step: 0.01, onPropertyChangedObservable: this.props.onPropertyChangedObservable }),
                         react__WEBPACK_IMPORTED_MODULE_1__["createElement"](_lines_color3LineComponent__WEBPACK_IMPORTED_MODULE_4__["Color3LineComponent"], { label: "Color", target: material.sheen, propertyName: "color", onPropertyChangedObservable: this.props.onPropertyChangedObservable }),
                         react__WEBPACK_IMPORTED_MODULE_1__["createElement"](_lines_color3LineComponent__WEBPACK_IMPORTED_MODULE_4__["Color3LineComponent"], { label: "Color", target: material.sheen, propertyName: "color", onPropertyChangedObservable: this.props.onPropertyChangedObservable }),
                         react__WEBPACK_IMPORTED_MODULE_1__["createElement"](_lines_textureLinkLineComponent__WEBPACK_IMPORTED_MODULE_10__["TextureLinkLineComponent"], { label: "Texture", texture: material.sheen.texture, material: material, onSelectionChangedObservable: this.props.onSelectionChangedObservable, onDebugSelectionChangeObservable: this._onDebugSelectionChangeObservable }))),
                         react__WEBPACK_IMPORTED_MODULE_1__["createElement"](_lines_textureLinkLineComponent__WEBPACK_IMPORTED_MODULE_10__["TextureLinkLineComponent"], { label: "Texture", texture: material.sheen.texture, material: material, onSelectionChangedObservable: this.props.onSelectionChangedObservable, onDebugSelectionChangeObservable: this._onDebugSelectionChangeObservable }))),
+            react__WEBPACK_IMPORTED_MODULE_1__["createElement"](_lineContainerComponent__WEBPACK_IMPORTED_MODULE_3__["LineContainerComponent"], { globalState: this.props.globalState, title: "SUBSURFACE" },
+                react__WEBPACK_IMPORTED_MODULE_1__["createElement"](_lines_textureLinkLineComponent__WEBPACK_IMPORTED_MODULE_10__["TextureLinkLineComponent"], { label: "Thickness", texture: material.subSurface.thicknessTexture, material: material, onSelectionChangedObservable: this.props.onSelectionChangedObservable, onDebugSelectionChangeObservable: this._onDebugSelectionChangeObservable }),
+                react__WEBPACK_IMPORTED_MODULE_1__["createElement"](_lines_sliderLineComponent__WEBPACK_IMPORTED_MODULE_7__["SliderLineComponent"], { label: "Min Thickness", target: material.subSurface, propertyName: "minimumThickness", minimum: 0, maximum: 10, step: 0.1, onPropertyChangedObservable: this.props.onPropertyChangedObservable }),
+                react__WEBPACK_IMPORTED_MODULE_1__["createElement"](_lines_sliderLineComponent__WEBPACK_IMPORTED_MODULE_7__["SliderLineComponent"], { label: "Max Thickness", target: material.subSurface, propertyName: "maximumThickness", minimum: 0, maximum: 10, step: 0.1, onPropertyChangedObservable: this.props.onPropertyChangedObservable }),
+                react__WEBPACK_IMPORTED_MODULE_1__["createElement"](_lines_checkBoxLineComponent__WEBPACK_IMPORTED_MODULE_5__["CheckBoxLineComponent"], { label: "Mask From Thickness", target: material.subSurface, propertyName: "useMaskFromThicknessTexture", onValueChanged: function () { return _this.forceUpdate(); }, onPropertyChangedObservable: this.props.onPropertyChangedObservable }),
+                react__WEBPACK_IMPORTED_MODULE_1__["createElement"](_lines_color3LineComponent__WEBPACK_IMPORTED_MODULE_4__["Color3LineComponent"], { label: "Tint Color", target: material.subSurface, propertyName: "tintColor", onPropertyChangedObservable: this.props.onPropertyChangedObservable }),
+                react__WEBPACK_IMPORTED_MODULE_1__["createElement"](_lines_checkBoxLineComponent__WEBPACK_IMPORTED_MODULE_5__["CheckBoxLineComponent"], { label: "Refraction Enabled", target: material.subSurface, propertyName: "isRefractionEnabled", onValueChanged: function () { return _this.forceUpdate(); }, onPropertyChangedObservable: this.props.onPropertyChangedObservable }),
+                material.subSurface.isRefractionEnabled &&
+                    react__WEBPACK_IMPORTED_MODULE_1__["createElement"]("div", { className: "fragment" },
+                        react__WEBPACK_IMPORTED_MODULE_1__["createElement"](_lines_sliderLineComponent__WEBPACK_IMPORTED_MODULE_7__["SliderLineComponent"], { label: "Intensity", target: material.subSurface, propertyName: "refractionIntensity", minimum: 0, maximum: 1, step: 0.01, onPropertyChangedObservable: this.props.onPropertyChangedObservable }),
+                        react__WEBPACK_IMPORTED_MODULE_1__["createElement"](_lines_sliderLineComponent__WEBPACK_IMPORTED_MODULE_7__["SliderLineComponent"], { label: "Index of Refraction", target: material.subSurface, propertyName: "indexOfRefraction", minimum: 1, maximum: 2, step: 0.01, onPropertyChangedObservable: this.props.onPropertyChangedObservable }),
+                        react__WEBPACK_IMPORTED_MODULE_1__["createElement"](_lines_sliderLineComponent__WEBPACK_IMPORTED_MODULE_7__["SliderLineComponent"], { label: "Tint at Distance", target: material.subSurface, propertyName: "tintColorAtDistance", minimum: 0, maximum: 10, step: 0.1, onPropertyChangedObservable: this.props.onPropertyChangedObservable }),
+                        react__WEBPACK_IMPORTED_MODULE_1__["createElement"](_lines_checkBoxLineComponent__WEBPACK_IMPORTED_MODULE_5__["CheckBoxLineComponent"], { label: "Link refraction with transparency", target: material.subSurface, propertyName: "linkRefractionWithTransparency", onPropertyChangedObservable: this.props.onPropertyChangedObservable })),
+                react__WEBPACK_IMPORTED_MODULE_1__["createElement"](_lines_checkBoxLineComponent__WEBPACK_IMPORTED_MODULE_5__["CheckBoxLineComponent"], { label: "Transluency Enabled", target: material.subSurface, propertyName: "isTranslucencyEnabled", onValueChanged: function () { return _this.forceUpdate(); }, onPropertyChangedObservable: this.props.onPropertyChangedObservable }),
+                material.subSurface.isTranslucencyEnabled &&
+                    react__WEBPACK_IMPORTED_MODULE_1__["createElement"]("div", { className: "fragment" },
+                        react__WEBPACK_IMPORTED_MODULE_1__["createElement"](_lines_sliderLineComponent__WEBPACK_IMPORTED_MODULE_7__["SliderLineComponent"], { label: "Intensity", target: material.subSurface, propertyName: "translucencyIntensity", minimum: 0, maximum: 1, step: 0.01, onPropertyChangedObservable: this.props.onPropertyChangedObservable }),
+                        react__WEBPACK_IMPORTED_MODULE_1__["createElement"](_lines_color3LineComponent__WEBPACK_IMPORTED_MODULE_4__["Color3LineComponent"], { label: "Diffusion Distance", target: material.subSurface, propertyName: "diffusionDistance", onPropertyChangedObservable: this.props.onPropertyChangedObservable }))),
             react__WEBPACK_IMPORTED_MODULE_1__["createElement"](_lineContainerComponent__WEBPACK_IMPORTED_MODULE_3__["LineContainerComponent"], { globalState: this.props.globalState, title: "LEVELS", closed: true },
             react__WEBPACK_IMPORTED_MODULE_1__["createElement"](_lineContainerComponent__WEBPACK_IMPORTED_MODULE_3__["LineContainerComponent"], { globalState: this.props.globalState, title: "LEVELS", closed: true },
                 react__WEBPACK_IMPORTED_MODULE_1__["createElement"](_lines_sliderLineComponent__WEBPACK_IMPORTED_MODULE_7__["SliderLineComponent"], { label: "Environment", target: material, propertyName: "environmentIntensity", minimum: 0, maximum: 1, step: 0.01, onPropertyChangedObservable: this.props.onPropertyChangedObservable }),
                 react__WEBPACK_IMPORTED_MODULE_1__["createElement"](_lines_sliderLineComponent__WEBPACK_IMPORTED_MODULE_7__["SliderLineComponent"], { label: "Environment", target: material, propertyName: "environmentIntensity", minimum: 0, maximum: 1, step: 0.01, onPropertyChangedObservable: this.props.onPropertyChangedObservable }),
                 react__WEBPACK_IMPORTED_MODULE_1__["createElement"](_lines_sliderLineComponent__WEBPACK_IMPORTED_MODULE_7__["SliderLineComponent"], { label: "Specular", target: material, propertyName: "specularIntensity", minimum: 0, maximum: 1, step: 0.01, onPropertyChangedObservable: this.props.onPropertyChangedObservable }),
                 react__WEBPACK_IMPORTED_MODULE_1__["createElement"](_lines_sliderLineComponent__WEBPACK_IMPORTED_MODULE_7__["SliderLineComponent"], { label: "Specular", target: material, propertyName: "specularIntensity", minimum: 0, maximum: 1, step: 0.01, onPropertyChangedObservable: this.props.onPropertyChangedObservable }),
@@ -37458,7 +37479,6 @@ var PBRMaterialPropertyGridComponent = /** @class */ (function (_super) {
                 react__WEBPACK_IMPORTED_MODULE_1__["createElement"](_lines_checkBoxLineComponent__WEBPACK_IMPORTED_MODULE_5__["CheckBoxLineComponent"], { label: "Alpha from albedo", target: material, propertyName: "useAlphaFromAlbedoTexture", onPropertyChangedObservable: this.props.onPropertyChangedObservable }),
                 react__WEBPACK_IMPORTED_MODULE_1__["createElement"](_lines_checkBoxLineComponent__WEBPACK_IMPORTED_MODULE_5__["CheckBoxLineComponent"], { label: "Alpha from albedo", target: material, propertyName: "useAlphaFromAlbedoTexture", onPropertyChangedObservable: this.props.onPropertyChangedObservable }),
                 react__WEBPACK_IMPORTED_MODULE_1__["createElement"](_lines_checkBoxLineComponent__WEBPACK_IMPORTED_MODULE_5__["CheckBoxLineComponent"], { label: "Ambient in grayscale", target: material, propertyName: "useAmbientInGrayScale", onPropertyChangedObservable: this.props.onPropertyChangedObservable }),
                 react__WEBPACK_IMPORTED_MODULE_1__["createElement"](_lines_checkBoxLineComponent__WEBPACK_IMPORTED_MODULE_5__["CheckBoxLineComponent"], { label: "Ambient in grayscale", target: material, propertyName: "useAmbientInGrayScale", onPropertyChangedObservable: this.props.onPropertyChangedObservable }),
                 react__WEBPACK_IMPORTED_MODULE_1__["createElement"](_lines_checkBoxLineComponent__WEBPACK_IMPORTED_MODULE_5__["CheckBoxLineComponent"], { label: "Radiance over alpha", target: material, propertyName: "useRadianceOverAlpha", onPropertyChangedObservable: this.props.onPropertyChangedObservable }),
                 react__WEBPACK_IMPORTED_MODULE_1__["createElement"](_lines_checkBoxLineComponent__WEBPACK_IMPORTED_MODULE_5__["CheckBoxLineComponent"], { label: "Radiance over alpha", target: material, propertyName: "useRadianceOverAlpha", onPropertyChangedObservable: this.props.onPropertyChangedObservable }),
-                react__WEBPACK_IMPORTED_MODULE_1__["createElement"](_lines_checkBoxLineComponent__WEBPACK_IMPORTED_MODULE_5__["CheckBoxLineComponent"], { label: "Link refraction with transparency", target: material, propertyName: "linkRefractionWithTransparency", onPropertyChangedObservable: this.props.onPropertyChangedObservable }),
                 react__WEBPACK_IMPORTED_MODULE_1__["createElement"](_lines_checkBoxLineComponent__WEBPACK_IMPORTED_MODULE_5__["CheckBoxLineComponent"], { label: "Micro-surface from ref. map alpha", target: material, propertyName: "useMicroSurfaceFromReflectivityMapAlpha", onPropertyChangedObservable: this.props.onPropertyChangedObservable }),
                 react__WEBPACK_IMPORTED_MODULE_1__["createElement"](_lines_checkBoxLineComponent__WEBPACK_IMPORTED_MODULE_5__["CheckBoxLineComponent"], { label: "Micro-surface from ref. map alpha", target: material, propertyName: "useMicroSurfaceFromReflectivityMapAlpha", onPropertyChangedObservable: this.props.onPropertyChangedObservable }),
                 react__WEBPACK_IMPORTED_MODULE_1__["createElement"](_lines_checkBoxLineComponent__WEBPACK_IMPORTED_MODULE_5__["CheckBoxLineComponent"], { label: "Specular over alpha", target: material, propertyName: "useSpecularOverAlpha", onPropertyChangedObservable: this.props.onPropertyChangedObservable }),
                 react__WEBPACK_IMPORTED_MODULE_1__["createElement"](_lines_checkBoxLineComponent__WEBPACK_IMPORTED_MODULE_5__["CheckBoxLineComponent"], { label: "Specular over alpha", target: material, propertyName: "useSpecularOverAlpha", onPropertyChangedObservable: this.props.onPropertyChangedObservable }),
                 react__WEBPACK_IMPORTED_MODULE_1__["createElement"](_lines_checkBoxLineComponent__WEBPACK_IMPORTED_MODULE_5__["CheckBoxLineComponent"], { label: "Specular anti-aliasing", target: material, propertyName: "enableSpecularAntiAliasing", onPropertyChangedObservable: this.props.onPropertyChangedObservable })),
                 react__WEBPACK_IMPORTED_MODULE_1__["createElement"](_lines_checkBoxLineComponent__WEBPACK_IMPORTED_MODULE_5__["CheckBoxLineComponent"], { label: "Specular anti-aliasing", target: material, propertyName: "enableSpecularAntiAliasing", onPropertyChangedObservable: this.props.onPropertyChangedObservable })),

Файловите разлики са ограничени, защото са твърде много
+ 1 - 1
dist/preview release/inspector/babylon.inspector.bundle.max.js.map


+ 6 - 6
dist/preview release/inspector/package.json

@@ -4,7 +4,7 @@
     },
     },
     "name": "babylonjs-inspector",
     "name": "babylonjs-inspector",
     "description": "The Babylon.js inspector.",
     "description": "The Babylon.js inspector.",
-    "version": "4.0.0-alpha.33",
+    "version": "4.0.0-beta.1",
     "repository": {
     "repository": {
         "type": "git",
         "type": "git",
         "url": "https://github.com/BabylonJS/Babylon.js.git"
         "url": "https://github.com/BabylonJS/Babylon.js.git"
@@ -31,11 +31,11 @@
     "dependencies": {
     "dependencies": {
         "@types/react": "~16.7.3",
         "@types/react": "~16.7.3",
         "@types/react-dom": "~16.0.9",
         "@types/react-dom": "~16.0.9",
-        "babylonjs": "4.0.0-alpha.33",
-        "babylonjs-gui": "4.0.0-alpha.33",
-        "babylonjs-loaders": "4.0.0-alpha.33",
-        "babylonjs-serializers": "4.0.0-alpha.33",
-        "babylonjs-gltf2interface": "4.0.0-alpha.33"
+        "babylonjs": "4.0.0-beta.1",
+        "babylonjs-gui": "4.0.0-beta.1",
+        "babylonjs-loaders": "4.0.0-beta.1",
+        "babylonjs-serializers": "4.0.0-beta.1",
+        "babylonjs-gltf2interface": "4.0.0-beta.1"
     },
     },
     "engines": {
     "engines": {
         "node": "*"
         "node": "*"

+ 20 - 4
dist/preview release/loaders/babylon.objFileLoader.js

@@ -530,6 +530,22 @@ var OBJFileLoader = /** @class */ (function () {
         return this.importMeshAsync(null, scene, data, rootUrl).then(function (result) {
         return this.importMeshAsync(null, scene, data, rootUrl).then(function (result) {
             var container = new babylonjs_Maths_math__WEBPACK_IMPORTED_MODULE_0__["AssetContainer"](scene);
             var container = new babylonjs_Maths_math__WEBPACK_IMPORTED_MODULE_0__["AssetContainer"](scene);
             result.meshes.forEach(function (mesh) { return container.meshes.push(mesh); });
             result.meshes.forEach(function (mesh) { return container.meshes.push(mesh); });
+            result.meshes.forEach(function (mesh) {
+                var material = mesh.material;
+                if (material) {
+                    // Materials
+                    if (container.materials.indexOf(material) == -1) {
+                        container.materials.push(material);
+                        // Textures
+                        var textures = material.getActiveTextures();
+                        textures.forEach(function (t) {
+                            if (container.textures.indexOf(t) == -1) {
+                                container.textures.push(t);
+                            }
+                        });
+                    }
+                }
+            });
             container.removeAllFromScene();
             container.removeAllFromScene();
             return container;
             return container;
         });
         });
@@ -595,7 +611,7 @@ var OBJFileLoader = /** @class */ (function () {
                 arr[obj[0]] = { normals: [], idx: [], uv: [] };
                 arr[obj[0]] = { normals: [], idx: [], uv: [] };
             }
             }
             var idx = arr[obj[0]].normals.indexOf(obj[1]);
             var idx = arr[obj[0]].normals.indexOf(obj[1]);
-            if (idx != 1 && (obj[2] == arr[obj[0]].uv[idx])) {
+            if (idx != 1 && (obj[2] === arr[obj[0]].uv[idx])) {
                 return arr[obj[0]].idx[idx];
                 return arr[obj[0]].idx[idx];
             }
             }
             return -1;
             return -1;
@@ -630,7 +646,7 @@ var OBJFileLoader = /** @class */ (function () {
                 ]);
                 ]);
             }
             }
             //If it not exists
             //If it not exists
-            if (_index == -1) {
+            if (_index === -1) {
                 //Add an new indice.
                 //Add an new indice.
                 //The array of indices is only an array with his length equal to the number of triangles - 1.
                 //The array of indices is only an array with his length equal to the number of triangles - 1.
                 //We add vertices data in this order
                 //We add vertices data in this order
@@ -1054,7 +1070,7 @@ var OBJFileLoader = /** @class */ (function () {
             //check meshesNames (stlFileLoader)
             //check meshesNames (stlFileLoader)
             if (meshesNames && meshesFromObj[j].name) {
             if (meshesNames && meshesFromObj[j].name) {
                 if (meshesNames instanceof Array) {
                 if (meshesNames instanceof Array) {
-                    if (meshesNames.indexOf(meshesFromObj[j].name) == -1) {
+                    if (meshesNames.indexOf(meshesFromObj[j].name) === -1) {
                         continue;
                         continue;
                     }
                     }
                 }
                 }
@@ -1120,7 +1136,7 @@ var OBJFileLoader = /** @class */ (function () {
                                 startIndex = _index + 1;
                                 startIndex = _index + 1;
                             }
                             }
                             //If the material is not used dispose it
                             //If the material is not used dispose it
-                            if (_index == -1 && _indices.length == 0) {
+                            if (_index === -1 && _indices.length === 0) {
                                 //If the material is not needed, remove it
                                 //If the material is not needed, remove it
                                 materialsFromMTLFile.materials[n].dispose();
                                 materialsFromMTLFile.materials[n].dispose();
                             }
                             }

Файловите разлики са ограничени, защото са твърде много
+ 1 - 1
dist/preview release/loaders/babylon.objFileLoader.js.map


Файловите разлики са ограничени, защото са твърде много
+ 1 - 1
dist/preview release/loaders/babylon.objFileLoader.min.js


+ 20 - 4
dist/preview release/loaders/babylonjs.loaders.js

@@ -748,6 +748,22 @@ var OBJFileLoader = /** @class */ (function () {
         return this.importMeshAsync(null, scene, data, rootUrl).then(function (result) {
         return this.importMeshAsync(null, scene, data, rootUrl).then(function (result) {
             var container = new babylonjs_Maths_math__WEBPACK_IMPORTED_MODULE_0__["AssetContainer"](scene);
             var container = new babylonjs_Maths_math__WEBPACK_IMPORTED_MODULE_0__["AssetContainer"](scene);
             result.meshes.forEach(function (mesh) { return container.meshes.push(mesh); });
             result.meshes.forEach(function (mesh) { return container.meshes.push(mesh); });
+            result.meshes.forEach(function (mesh) {
+                var material = mesh.material;
+                if (material) {
+                    // Materials
+                    if (container.materials.indexOf(material) == -1) {
+                        container.materials.push(material);
+                        // Textures
+                        var textures = material.getActiveTextures();
+                        textures.forEach(function (t) {
+                            if (container.textures.indexOf(t) == -1) {
+                                container.textures.push(t);
+                            }
+                        });
+                    }
+                }
+            });
             container.removeAllFromScene();
             container.removeAllFromScene();
             return container;
             return container;
         });
         });
@@ -813,7 +829,7 @@ var OBJFileLoader = /** @class */ (function () {
                 arr[obj[0]] = { normals: [], idx: [], uv: [] };
                 arr[obj[0]] = { normals: [], idx: [], uv: [] };
             }
             }
             var idx = arr[obj[0]].normals.indexOf(obj[1]);
             var idx = arr[obj[0]].normals.indexOf(obj[1]);
-            if (idx != 1 && (obj[2] == arr[obj[0]].uv[idx])) {
+            if (idx != 1 && (obj[2] === arr[obj[0]].uv[idx])) {
                 return arr[obj[0]].idx[idx];
                 return arr[obj[0]].idx[idx];
             }
             }
             return -1;
             return -1;
@@ -848,7 +864,7 @@ var OBJFileLoader = /** @class */ (function () {
                 ]);
                 ]);
             }
             }
             //If it not exists
             //If it not exists
-            if (_index == -1) {
+            if (_index === -1) {
                 //Add an new indice.
                 //Add an new indice.
                 //The array of indices is only an array with his length equal to the number of triangles - 1.
                 //The array of indices is only an array with his length equal to the number of triangles - 1.
                 //We add vertices data in this order
                 //We add vertices data in this order
@@ -1272,7 +1288,7 @@ var OBJFileLoader = /** @class */ (function () {
             //check meshesNames (stlFileLoader)
             //check meshesNames (stlFileLoader)
             if (meshesNames && meshesFromObj[j].name) {
             if (meshesNames && meshesFromObj[j].name) {
                 if (meshesNames instanceof Array) {
                 if (meshesNames instanceof Array) {
-                    if (meshesNames.indexOf(meshesFromObj[j].name) == -1) {
+                    if (meshesNames.indexOf(meshesFromObj[j].name) === -1) {
                         continue;
                         continue;
                     }
                     }
                 }
                 }
@@ -1338,7 +1354,7 @@ var OBJFileLoader = /** @class */ (function () {
                                 startIndex = _index + 1;
                                 startIndex = _index + 1;
                             }
                             }
                             //If the material is not used dispose it
                             //If the material is not used dispose it
-                            if (_index == -1 && _indices.length == 0) {
+                            if (_index === -1 && _indices.length === 0) {
                                 //If the material is not needed, remove it
                                 //If the material is not needed, remove it
                                 materialsFromMTLFile.materials[n].dispose();
                                 materialsFromMTLFile.materials[n].dispose();
                             }
                             }

Файловите разлики са ограничени, защото са твърде много
+ 1 - 1
dist/preview release/loaders/babylonjs.loaders.js.map


Файловите разлики са ограничени, защото са твърде много
+ 2 - 2
dist/preview release/loaders/babylonjs.loaders.min.js


+ 3 - 3
dist/preview release/loaders/package.json

@@ -4,7 +4,7 @@
     },
     },
     "name": "babylonjs-loaders",
     "name": "babylonjs-loaders",
     "description": "The Babylon.js file loaders library is an extension you can use to load different 3D file types into a Babylon scene.",
     "description": "The Babylon.js file loaders library is an extension you can use to load different 3D file types into a Babylon scene.",
-    "version": "4.0.0-alpha.33",
+    "version": "4.0.0-beta.1",
     "repository": {
     "repository": {
         "type": "git",
         "type": "git",
         "url": "https://github.com/BabylonJS/Babylon.js.git"
         "url": "https://github.com/BabylonJS/Babylon.js.git"
@@ -28,8 +28,8 @@
     ],
     ],
     "license": "Apache-2.0",
     "license": "Apache-2.0",
     "dependencies": {
     "dependencies": {
-        "babylonjs-gltf2interface": "4.0.0-alpha.33",
-        "babylonjs": "4.0.0-alpha.33"
+        "babylonjs-gltf2interface": "4.0.0-beta.1",
+        "babylonjs": "4.0.0-beta.1"
     },
     },
     "engines": {
     "engines": {
         "node": "*"
         "node": "*"

+ 2 - 2
dist/preview release/materialsLibrary/package.json

@@ -4,7 +4,7 @@
     },
     },
     "name": "babylonjs-materials",
     "name": "babylonjs-materials",
     "description": "The Babylon.js materials library is a collection of advanced materials to be used in a Babylon.js scene.",
     "description": "The Babylon.js materials library is a collection of advanced materials to be used in a Babylon.js scene.",
-    "version": "4.0.0-alpha.33",
+    "version": "4.0.0-beta.1",
     "repository": {
     "repository": {
         "type": "git",
         "type": "git",
         "url": "https://github.com/BabylonJS/Babylon.js.git"
         "url": "https://github.com/BabylonJS/Babylon.js.git"
@@ -28,7 +28,7 @@
     ],
     ],
     "license": "Apache-2.0",
     "license": "Apache-2.0",
     "dependencies": {
     "dependencies": {
-        "babylonjs": "4.0.0-alpha.33"
+        "babylonjs": "4.0.0-beta.1"
     },
     },
     "engines": {
     "engines": {
         "node": "*"
         "node": "*"

+ 1 - 1
dist/preview release/package.json

@@ -9,7 +9,7 @@
     ],
     ],
     "name": "babylonjs",
     "name": "babylonjs",
     "description": "Babylon.js is a JavaScript 3D engine based on webgl.",
     "description": "Babylon.js is a JavaScript 3D engine based on webgl.",
-    "version": "4.0.0-alpha.33",
+    "version": "4.0.0-beta.1",
     "repository": {
     "repository": {
         "type": "git",
         "type": "git",
         "url": "https://github.com/BabylonJS/Babylon.js.git"
         "url": "https://github.com/BabylonJS/Babylon.js.git"

+ 2 - 2
dist/preview release/postProcessesLibrary/package.json

@@ -4,7 +4,7 @@
     },
     },
     "name": "babylonjs-post-process",
     "name": "babylonjs-post-process",
     "description": "The Babylon.js materials library is a collection of advanced materials to be used in a Babylon.js scene.",
     "description": "The Babylon.js materials library is a collection of advanced materials to be used in a Babylon.js scene.",
-    "version": "4.0.0-alpha.33",
+    "version": "4.0.0-beta.1",
     "repository": {
     "repository": {
         "type": "git",
         "type": "git",
         "url": "https://github.com/BabylonJS/Babylon.js.git"
         "url": "https://github.com/BabylonJS/Babylon.js.git"
@@ -28,7 +28,7 @@
     ],
     ],
     "license": "Apache-2.0",
     "license": "Apache-2.0",
     "dependencies": {
     "dependencies": {
-        "babylonjs": "4.0.0-alpha.33"
+        "babylonjs": "4.0.0-beta.1"
     },
     },
     "engines": {
     "engines": {
         "node": "*"
         "node": "*"

+ 2 - 2
dist/preview release/proceduralTexturesLibrary/package.json

@@ -4,7 +4,7 @@
     },
     },
     "name": "babylonjs-procedural-textures",
     "name": "babylonjs-procedural-textures",
     "description": "The Babylon.js materials library is a collection of advanced materials to be used in a Babylon.js scene.",
     "description": "The Babylon.js materials library is a collection of advanced materials to be used in a Babylon.js scene.",
-    "version": "4.0.0-alpha.33",
+    "version": "4.0.0-beta.1",
     "repository": {
     "repository": {
         "type": "git",
         "type": "git",
         "url": "https://github.com/BabylonJS/Babylon.js.git"
         "url": "https://github.com/BabylonJS/Babylon.js.git"
@@ -28,7 +28,7 @@
     ],
     ],
     "license": "Apache-2.0",
     "license": "Apache-2.0",
     "dependencies": {
     "dependencies": {
-        "babylonjs": "4.0.0-alpha.33"
+        "babylonjs": "4.0.0-beta.1"
     },
     },
     "engines": {
     "engines": {
         "node": "*"
         "node": "*"

+ 3 - 3
dist/preview release/serializers/package.json

@@ -4,7 +4,7 @@
     },
     },
     "name": "babylonjs-serializers",
     "name": "babylonjs-serializers",
     "description": "The Babylon.js serializers library is an extension you can use to serialize Babylon scenes.",
     "description": "The Babylon.js serializers library is an extension you can use to serialize Babylon scenes.",
-    "version": "4.0.0-alpha.33",
+    "version": "4.0.0-beta.1",
     "repository": {
     "repository": {
         "type": "git",
         "type": "git",
         "url": "https://github.com/BabylonJS/Babylon.js.git"
         "url": "https://github.com/BabylonJS/Babylon.js.git"
@@ -28,8 +28,8 @@
     ],
     ],
     "license": "Apache-2.0",
     "license": "Apache-2.0",
     "dependencies": {
     "dependencies": {
-        "babylonjs": "4.0.0-alpha.33",
-        "babylonjs-gltf2interface": "4.0.0-alpha.33"
+        "babylonjs": "4.0.0-beta.1",
+        "babylonjs-gltf2interface": "4.0.0-beta.1"
     },
     },
     "engines": {
     "engines": {
         "node": "*"
         "node": "*"

+ 551 - 74
dist/preview release/viewer/babylon.module.d.ts

@@ -22665,7 +22665,7 @@ declare module "babylonjs/Materials/material" {
          * @param rootUrl defines the root URL to use to load textures
          * @param rootUrl defines the root URL to use to load textures
          * @returns a new material
          * @returns a new material
          */
          */
-        static Parse(parsedMaterial: any, scene: Scene, rootUrl: string): any;
+        static Parse(parsedMaterial: any, scene: Scene, rootUrl: string): Nullable<Material>;
     }
     }
 }
 }
 declare module "babylonjs/Meshes/subMesh" {
 declare module "babylonjs/Meshes/subMesh" {
@@ -39277,6 +39277,11 @@ declare module "babylonjs/Materials/materialFlags" {
          * Are anisotropic textures enabled in the application.
          * Are anisotropic textures enabled in the application.
          */
          */
         static AnisotropicTextureEnabled: boolean;
         static AnisotropicTextureEnabled: boolean;
+        private static _ThicknessTextureEnabled;
+        /**
+         * Are thickness textures enabled in the application.
+         */
+        static ThicknessTextureEnabled: boolean;
     }
     }
 }
 }
 declare module "babylonjs/Shaders/ShadersInclude/defaultFragmentDeclaration" {
 declare module "babylonjs/Shaders/ShadersInclude/defaultFragmentDeclaration" {
@@ -45365,12 +45370,12 @@ declare module "babylonjs/Materials/PBR/pbrClearCoatConfiguration" {
          */
          */
         isTintEnabled: boolean;
         isTintEnabled: boolean;
         /**
         /**
-         * Defines if the clear coat tint is enabled in the material.
+         * Defines the clear coat tint of the material.
          * This is only use if tint is enabled
          * This is only use if tint is enabled
          */
          */
         tintColor: Color3;
         tintColor: Color3;
         /**
         /**
-         * Defines if the distance at which the tint color should be found in the
+         * Defines the distance at which the tint color should be found in the
          * clear coat media.
          * clear coat media.
          * This is only use if tint is enabled
          * This is only use if tint is enabled
          */
          */
@@ -45397,7 +45402,7 @@ declare module "babylonjs/Materials/PBR/pbrClearCoatConfiguration" {
          */
          */
         constructor(markAllSubMeshesAsTexturesDirty: () => void);
         constructor(markAllSubMeshesAsTexturesDirty: () => void);
         /**
         /**
-         * Specifies that the submesh is ready to be used.
+         * Gets wehter the submesh is ready to be used or not.
          * @param defines the list of "defines" to update.
          * @param defines the list of "defines" to update.
          * @param scene defines the scene the material belongs to.
          * @param scene defines the scene the material belongs to.
          * @param engine defines the engine the material belongs to.
          * @param engine defines the engine the material belongs to.
@@ -45847,6 +45852,257 @@ declare module "babylonjs/Materials/PBR/pbrSheenConfiguration" {
         parse(source: any): void;
         parse(source: any): void;
     }
     }
 }
 }
+declare module "babylonjs/Materials/PBR/pbrSubSurfaceConfiguration" {
+    import { Nullable } from "babylonjs/types";
+    import { IAnimatable } from "babylonjs/Misc/tools";
+    import { Color3 } from "babylonjs/Maths/math";
+    import { SmartArray } from "babylonjs/Misc/smartArray";
+    import { BaseTexture } from "babylonjs/Materials/Textures/baseTexture";
+    import { RenderTargetTexture } from "babylonjs/Materials/Textures/renderTargetTexture";
+    import { Effect, EffectFallbacks } from "babylonjs/Materials/effect";
+    import { UniformBuffer } from "babylonjs/Materials/uniformBuffer";
+    import { Engine } from "babylonjs/Engines/engine";
+    import { Scene } from "babylonjs/scene";
+    /**
+     * @hidden
+     */
+    export interface IMaterialSubSurfaceDefines {
+        SUBSURFACE: boolean;
+        SS_REFRACTION: boolean;
+        SS_TRANSLUCENCY: boolean;
+        SS_SCATERRING: boolean;
+        SS_THICKNESSANDMASK_TEXTURE: boolean;
+        SS_THICKNESSANDMASK_TEXTUREDIRECTUV: number;
+        SS_REFRACTIONMAP_3D: boolean;
+        SS_REFRACTIONMAP_OPPOSITEZ: boolean;
+        SS_LODINREFRACTIONALPHA: boolean;
+        SS_GAMMAREFRACTION: boolean;
+        SS_RGBDREFRACTION: boolean;
+        SS_LINKREFRACTIONTOTRANSPARENCY: boolean;
+        SS_MASK_FROM_THICKNESS_TEXTURE: boolean;
+        /** @hidden */
+        _areTexturesDirty: boolean;
+    }
+    /**
+     * Define the code related to the sub surface parameters of the pbr material.
+     */
+    export class PBRSubSurfaceConfiguration {
+        private _isRefractionEnabled;
+        /**
+         * Defines if the refraction is enabled in the material.
+         */
+        isRefractionEnabled: boolean;
+        private _isTranslucencyEnabled;
+        /**
+         * Defines if the translucency is enabled in the material.
+         */
+        isTranslucencyEnabled: boolean;
+        private _isScatteringEnabled;
+        /**
+         * 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.
+         */
+        refractionIntensity: number;
+        /**
+         * 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.
+         */
+        translucencyIntensity: number;
+        /**
+         * Defines the scattering intensity of the material.
+         * When scattering has been enabled, this defines how much of the "scattered light"
+         * is addded to the diffuse part of the material.
+         */
+        scatteringIntensity: number;
+        private _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.
+         */
+        thicknessTexture: Nullable<BaseTexture>;
+        private _refractionTexture;
+        /**
+         * Defines the texture to use for refraction.
+         */
+        refractionTexture: Nullable<BaseTexture>;
+        private _indexOfRefraction;
+        /**
+         * Defines the indice of refraction used in the material.
+         * https://en.wikipedia.org/wiki/List_of_refractive_indices
+         */
+        indexOfRefraction: number;
+        private _invertRefractionY;
+        /**
+         * Controls if refraction needs to be inverted on Y. This could be useful for procedural texture.
+         */
+        invertRefractionY: boolean;
+        private _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.
+         */
+        linkRefractionWithTransparency: boolean;
+        /**
+         * Defines the minimum thickness stored in the thickness map.
+         * If no thickness map is defined, this value will be used to simulate thickness.
+         */
+        minimumThickness: number;
+        /**
+         * Defines the maximum thickness stored in the thickness map.
+         */
+        maximumThickness: number;
+        /**
+         * Defines the volume tint of the material.
+         * This is used for both translucency and scattering.
+         */
+        tintColor: Color3;
+        /**
+         * Defines the distance at which the tint color should be found in the media.
+         * This is used for refraction only.
+         */
+        tintColorAtDistance: number;
+        /**
+         * Defines how far each channel transmit through the media.
+         * It is defined as a color to simplify it selection.
+         */
+        diffusionDistance: Color3;
+        private _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.
+         */
+        useMaskFromThicknessTexture: boolean;
+        /** @hidden */
+        private _internalMarkAllSubMeshesAsTexturesDirty;
+        /** @hidden */
+        _markAllSubMeshesAsTexturesDirty(): void;
+        /**
+         * Instantiate a new istance of sub surface configuration.
+         * @param markAllSubMeshesAsTexturesDirty Callback to flag the material to dirty
+         */
+        constructor(markAllSubMeshesAsTexturesDirty: () => void);
+        /**
+         * Gets wehter the submesh is ready to be used or not.
+         * @param defines the list of "defines" to update.
+         * @param scene defines the scene the material belongs to.
+         * @returns - boolean indicating that the submesh is ready or not.
+         */
+        isReadyForSubMesh(defines: IMaterialSubSurfaceDefines, scene: Scene): boolean;
+        /**
+         * Checks to see if a texture is used in the material.
+         * @param defines the list of "defines" to update.
+         * @param scene defines the scene to the material belongs to.
+         */
+        prepareDefines(defines: IMaterialSubSurfaceDefines, scene: Scene): void;
+        /**
+         * Binds the material data.
+         * @param uniformBuffer defines the Uniform buffer to fill in.
+         * @param scene defines the scene the material belongs to.
+         * @param engine defines the engine the material belongs to.
+         * @param isFrozen defines wether the material is frozen or not.
+         * @param lodBasedMicrosurface defines wether the material relies on lod based microsurface or not.
+         */
+        bindForSubMesh(uniformBuffer: UniformBuffer, scene: Scene, engine: Engine, isFrozen: boolean, lodBasedMicrosurface: boolean): void;
+        /**
+         * Unbinds the material from the mesh.
+         * @param activeEffect defines the effect that should be unbound from.
+         * @returns true if unbound, otherwise false
+         */
+        unbind(activeEffect: Effect): boolean;
+        /**
+         * Returns the texture used for refraction or null if none is used.
+         * @param scene defines the scene the material belongs to.
+         * @returns - Refraction texture if present.  If no refraction texture and refraction
+         * is linked with transparency, returns environment texture.  Otherwise, returns null.
+         */
+        private _getRefractionTexture;
+        /**
+         * Returns true if alpha blending should be disabled.
+         */
+        readonly disableAlphaBlending: boolean;
+        /**
+         * Fills the list of render target textures.
+         * @param renderTargets the list of render targets to update
+         */
+        fillRenderTargetTextures(renderTargets: SmartArray<RenderTargetTexture>): void;
+        /**
+         * Checks to see if a texture is used in the material.
+         * @param texture - Base texture to use.
+         * @returns - Boolean specifying if a texture is used in the material.
+         */
+        hasTexture(texture: BaseTexture): boolean;
+        /**
+         * Gets a boolean indicating that current material needs to register RTT
+         * @returns true if this uses a render target otherwise false.
+         */
+        hasRenderTargetTextures(): boolean;
+        /**
+         * Returns an array of the actively used textures.
+         * @param activeTextures Array of BaseTextures
+         */
+        getActiveTextures(activeTextures: BaseTexture[]): void;
+        /**
+         * Returns the animatable textures.
+         * @param animatables Array of animatable textures.
+         */
+        getAnimatables(animatables: IAnimatable[]): void;
+        /**
+         * Disposes the resources of the material.
+         * @param forceDisposeTextures - Forces the disposal of all textures.
+         */
+        dispose(forceDisposeTextures?: boolean): void;
+        /**
+        * Get the current class name of the texture useful for serialization or dynamic coding.
+        * @returns "PBRSubSurfaceConfiguration"
+        */
+        getClassName(): string;
+        /**
+         * Add fallbacks to the effect fallbacks list.
+         * @param defines defines the Base texture to use.
+         * @param fallbacks defines the current fallback list.
+         * @param currentRank defines the current fallback rank.
+         * @returns the new fallback rank.
+         */
+        static AddFallbacks(defines: IMaterialSubSurfaceDefines, fallbacks: EffectFallbacks, currentRank: number): number;
+        /**
+         * Add the required uniforms to the current list.
+         * @param uniforms defines the current uniform list.
+         */
+        static AddUniforms(uniforms: string[]): void;
+        /**
+         * Add the required samplers to the current list.
+         * @param samplers defines the current sampler list.
+         */
+        static AddSamplers(samplers: string[]): void;
+        /**
+         * Add the required uniforms to the current buffer.
+         * @param uniformBuffer defines the current uniform buffer.
+         */
+        static PrepareUniformBuffer(uniformBuffer: UniformBuffer): void;
+        /**
+         * Makes a duplicate of the current configuration into another one.
+         * @param configuration define the config where to copy the info
+         */
+        copyTo(configuration: PBRSubSurfaceConfiguration): void;
+        /**
+         * Serializes this Sub Surface configuration.
+         * @returns - An object with the serialized config.
+         */
+        serialize(): any;
+        /**
+         * Parses a Sub Surface Configuration from a serialized object.
+         * @param source - Serialized object.
+         */
+        parse(source: any): void;
+    }
+}
 declare module "babylonjs/Shaders/ShadersInclude/pbrFragmentDeclaration" {
 declare module "babylonjs/Shaders/ShadersInclude/pbrFragmentDeclaration" {
     /** @hidden */
     /** @hidden */
     export var pbrFragmentDeclaration: {
     export var pbrFragmentDeclaration: {
@@ -46015,6 +46271,7 @@ declare module "babylonjs/Materials/PBR/pbrBaseMaterial" {
     import { IMaterialAnisotropicDefines, PBRAnisotropicConfiguration } from "babylonjs/Materials/PBR/pbrAnisotropicConfiguration";
     import { IMaterialAnisotropicDefines, PBRAnisotropicConfiguration } from "babylonjs/Materials/PBR/pbrAnisotropicConfiguration";
     import { IMaterialBRDFDefines, PBRBRDFConfiguration } from "babylonjs/Materials/PBR/pbrBRDFConfiguration";
     import { IMaterialBRDFDefines, PBRBRDFConfiguration } from "babylonjs/Materials/PBR/pbrBRDFConfiguration";
     import { IMaterialSheenDefines, PBRSheenConfiguration } from "babylonjs/Materials/PBR/pbrSheenConfiguration";
     import { IMaterialSheenDefines, PBRSheenConfiguration } from "babylonjs/Materials/PBR/pbrSheenConfiguration";
+    import { IMaterialSubSurfaceDefines, PBRSubSurfaceConfiguration } from "babylonjs/Materials/PBR/pbrSubSurfaceConfiguration";
     import { ImageProcessingConfiguration, IImageProcessingConfigurationDefines } from "babylonjs/Materials/imageProcessingConfiguration";
     import { ImageProcessingConfiguration, IImageProcessingConfigurationDefines } from "babylonjs/Materials/imageProcessingConfiguration";
     import { Material } from "babylonjs/Materials/material";
     import { Material } from "babylonjs/Materials/material";
     import { MaterialDefines } from "babylonjs/Materials/materialDefines";
     import { MaterialDefines } from "babylonjs/Materials/materialDefines";
@@ -46026,7 +46283,7 @@ declare module "babylonjs/Materials/PBR/pbrBaseMaterial" {
      * Manages the defines for the PBR Material.
      * Manages the defines for the PBR Material.
      * @hidden
      * @hidden
      */
      */
-    export class PBRMaterialDefines extends MaterialDefines implements IImageProcessingConfigurationDefines, IMaterialClearCoatDefines, IMaterialAnisotropicDefines, IMaterialBRDFDefines, IMaterialSheenDefines {
+    export class PBRMaterialDefines extends MaterialDefines implements IImageProcessingConfigurationDefines, IMaterialClearCoatDefines, IMaterialAnisotropicDefines, IMaterialBRDFDefines, IMaterialSheenDefines, IMaterialSubSurfaceDefines {
         PBR: boolean;
         PBR: boolean;
         MAINUV1: boolean;
         MAINUV1: boolean;
         MAINUV2: boolean;
         MAINUV2: boolean;
@@ -46103,13 +46360,6 @@ declare module "babylonjs/Materials/PBR/pbrBaseMaterial" {
         RGBDREFLECTION: boolean;
         RGBDREFLECTION: boolean;
         RADIANCEOCCLUSION: boolean;
         RADIANCEOCCLUSION: boolean;
         HORIZONOCCLUSION: boolean;
         HORIZONOCCLUSION: boolean;
-        REFRACTION: boolean;
-        REFRACTIONMAP_3D: boolean;
-        REFRACTIONMAP_OPPOSITEZ: boolean;
-        LODINREFRACTIONALPHA: boolean;
-        GAMMAREFRACTION: boolean;
-        RGBDREFRACTION: boolean;
-        LINKREFRACTIONTOTRANSPARENCY: boolean;
         INSTANCES: boolean;
         INSTANCES: boolean;
         NUM_BONE_INFLUENCERS: number;
         NUM_BONE_INFLUENCERS: number;
         BonesPerMesh: number;
         BonesPerMesh: number;
@@ -46165,6 +46415,19 @@ declare module "babylonjs/Materials/PBR/pbrBaseMaterial" {
         SHEEN_TEXTURE: boolean;
         SHEEN_TEXTURE: boolean;
         SHEEN_TEXTUREDIRECTUV: number;
         SHEEN_TEXTUREDIRECTUV: number;
         SHEEN_LINKWITHALBEDO: boolean;
         SHEEN_LINKWITHALBEDO: boolean;
+        SUBSURFACE: boolean;
+        SS_REFRACTION: boolean;
+        SS_TRANSLUCENCY: boolean;
+        SS_SCATERRING: boolean;
+        SS_THICKNESSANDMASK_TEXTURE: boolean;
+        SS_THICKNESSANDMASK_TEXTUREDIRECTUV: number;
+        SS_REFRACTIONMAP_3D: boolean;
+        SS_REFRACTIONMAP_OPPOSITEZ: boolean;
+        SS_LODINREFRACTIONALPHA: boolean;
+        SS_GAMMAREFRACTION: boolean;
+        SS_RGBDREFRACTION: boolean;
+        SS_LINKREFRACTIONTOTRANSPARENCY: boolean;
+        SS_MASK_FROM_THICKNESS_TEXTURE: boolean;
         UNLIT: boolean;
         UNLIT: boolean;
         DEBUGMODE: number;
         DEBUGMODE: number;
         /**
         /**
@@ -46275,10 +46538,6 @@ declare module "babylonjs/Materials/PBR/pbrBaseMaterial" {
          */
          */
         protected _reflectionTexture: BaseTexture;
         protected _reflectionTexture: BaseTexture;
         /**
         /**
-         * Stores the refraction values in a texture.
-         */
-        protected _refractionTexture: BaseTexture;
-        /**
          * Stores the emissive values in a texture.
          * Stores the emissive values in a texture.
          */
          */
         protected _emissiveTexture: BaseTexture;
         protected _emissiveTexture: BaseTexture;
@@ -46338,19 +46597,6 @@ declare module "babylonjs/Materials/PBR/pbrBaseMaterial" {
          */
          */
         protected _microSurface: number;
         protected _microSurface: number;
         /**
         /**
-         * source material index of refraction (IOR)' / 'destination material IOR.
-         */
-        protected _indexOfRefraction: number;
-        /**
-         * Controls if refraction needs to be inverted on Y. This could be useful for procedural texture.
-         */
-        protected _invertRefractionY: boolean;
-        /**
-         * 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.
-         */
-        protected _linkRefractionWithTransparency: boolean;
-        /**
          * Specifies that the material will use the light map as a show map.
          * Specifies that the material will use the light map as a show map.
          */
          */
         protected _useLightmapAsShadowmap: boolean;
         protected _useLightmapAsShadowmap: boolean;
@@ -46560,6 +46806,10 @@ declare module "babylonjs/Materials/PBR/pbrBaseMaterial" {
          */
          */
         readonly sheen: PBRSheenConfiguration;
         readonly sheen: PBRSheenConfiguration;
         /**
         /**
+         * Defines the SubSurface parameters for the material.
+         */
+        readonly subSurface: PBRSubSurfaceConfiguration;
+        /**
          * Custom callback helping to override the default shader used in the material.
          * Custom callback helping to override the default shader used in the material.
          */
          */
         customShaderNameResolve: (shaderName: string, uniforms: string[], uniformBuffers: string[], samplers: string[], defines: PBRMaterialDefines) => string;
         customShaderNameResolve: (shaderName: string, uniforms: string[], uniformBuffers: string[], samplers: string[], defines: PBRMaterialDefines) => string;
@@ -46651,7 +46901,7 @@ declare module "babylonjs/Materials/PBR/pbrBaseMaterial" {
          */
          */
         buildUniformLayout(): void;
         buildUniformLayout(): void;
         /**
         /**
-         * Unbinds the textures.
+         * Unbinds the material from the mesh
          */
          */
         unbind(): void;
         unbind(): void;
         /**
         /**
@@ -46672,12 +46922,6 @@ declare module "babylonjs/Materials/PBR/pbrBaseMaterial" {
          */
          */
         private _getReflectionTexture;
         private _getReflectionTexture;
         /**
         /**
-         * Returns the texture used for refraction or null if none is used.
-         * @returns - Refection texture if present.  If no refraction texture and refraction
-         * is linked with transparency, returns environment texture.  Otherwise, returns null.
-         */
-        private _getRefractionTexture;
-        /**
          * Returns an array of the actively used textures.
          * Returns an array of the actively used textures.
          * @returns - Array of BaseTextures
          * @returns - Array of BaseTextures
          */
          */
@@ -46822,7 +47066,7 @@ declare module "babylonjs/Materials/PBR/pbrMaterial" {
         /**
         /**
          * Stores the refracted light information in a texture.
          * Stores the refracted light information in a texture.
          */
          */
-        refractionTexture: BaseTexture;
+        refractionTexture: Nullable<BaseTexture>;
         /**
         /**
          * The color of a material in ambient lighting.
          * The color of a material in ambient lighting.
          */
          */
@@ -81267,7 +81511,7 @@ declare module BABYLON {
          * @param rootUrl defines the root URL to use to load textures
          * @param rootUrl defines the root URL to use to load textures
          * @returns a new material
          * @returns a new material
          */
          */
-        static Parse(parsedMaterial: any, scene: Scene, rootUrl: string): any;
+        static Parse(parsedMaterial: any, scene: Scene, rootUrl: string): Nullable<Material>;
     }
     }
 }
 }
 declare module BABYLON {
 declare module BABYLON {
@@ -97291,6 +97535,11 @@ declare module BABYLON {
          * Are anisotropic textures enabled in the application.
          * Are anisotropic textures enabled in the application.
          */
          */
         static AnisotropicTextureEnabled: boolean;
         static AnisotropicTextureEnabled: boolean;
+        private static _ThicknessTextureEnabled;
+        /**
+         * Are thickness textures enabled in the application.
+         */
+        static ThicknessTextureEnabled: boolean;
     }
     }
 }
 }
 declare module BABYLON {
 declare module BABYLON {
@@ -102834,12 +103083,12 @@ declare module BABYLON {
          */
          */
         isTintEnabled: boolean;
         isTintEnabled: boolean;
         /**
         /**
-         * Defines if the clear coat tint is enabled in the material.
+         * Defines the clear coat tint of the material.
          * This is only use if tint is enabled
          * This is only use if tint is enabled
          */
          */
         tintColor: Color3;
         tintColor: Color3;
         /**
         /**
-         * Defines if the distance at which the tint color should be found in the
+         * Defines the distance at which the tint color should be found in the
          * clear coat media.
          * clear coat media.
          * This is only use if tint is enabled
          * This is only use if tint is enabled
          */
          */
@@ -102866,7 +103115,7 @@ declare module BABYLON {
          */
          */
         constructor(markAllSubMeshesAsTexturesDirty: () => void);
         constructor(markAllSubMeshesAsTexturesDirty: () => void);
         /**
         /**
-         * Specifies that the submesh is ready to be used.
+         * Gets wehter the submesh is ready to be used or not.
          * @param defines the list of "defines" to update.
          * @param defines the list of "defines" to update.
          * @param scene defines the scene the material belongs to.
          * @param scene defines the scene the material belongs to.
          * @param engine defines the engine the material belongs to.
          * @param engine defines the engine the material belongs to.
@@ -103302,6 +103551,247 @@ declare module BABYLON {
     }
     }
 }
 }
 declare module BABYLON {
 declare module BABYLON {
+    /**
+     * @hidden
+     */
+    export interface IMaterialSubSurfaceDefines {
+        SUBSURFACE: boolean;
+        SS_REFRACTION: boolean;
+        SS_TRANSLUCENCY: boolean;
+        SS_SCATERRING: boolean;
+        SS_THICKNESSANDMASK_TEXTURE: boolean;
+        SS_THICKNESSANDMASK_TEXTUREDIRECTUV: number;
+        SS_REFRACTIONMAP_3D: boolean;
+        SS_REFRACTIONMAP_OPPOSITEZ: boolean;
+        SS_LODINREFRACTIONALPHA: boolean;
+        SS_GAMMAREFRACTION: boolean;
+        SS_RGBDREFRACTION: boolean;
+        SS_LINKREFRACTIONTOTRANSPARENCY: boolean;
+        SS_MASK_FROM_THICKNESS_TEXTURE: boolean;
+        /** @hidden */
+        _areTexturesDirty: boolean;
+    }
+    /**
+     * Define the code related to the sub surface parameters of the pbr material.
+     */
+    export class PBRSubSurfaceConfiguration {
+        private _isRefractionEnabled;
+        /**
+         * Defines if the refraction is enabled in the material.
+         */
+        isRefractionEnabled: boolean;
+        private _isTranslucencyEnabled;
+        /**
+         * Defines if the translucency is enabled in the material.
+         */
+        isTranslucencyEnabled: boolean;
+        private _isScatteringEnabled;
+        /**
+         * 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.
+         */
+        refractionIntensity: number;
+        /**
+         * 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.
+         */
+        translucencyIntensity: number;
+        /**
+         * Defines the scattering intensity of the material.
+         * When scattering has been enabled, this defines how much of the "scattered light"
+         * is addded to the diffuse part of the material.
+         */
+        scatteringIntensity: number;
+        private _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.
+         */
+        thicknessTexture: Nullable<BaseTexture>;
+        private _refractionTexture;
+        /**
+         * Defines the texture to use for refraction.
+         */
+        refractionTexture: Nullable<BaseTexture>;
+        private _indexOfRefraction;
+        /**
+         * Defines the indice of refraction used in the material.
+         * https://en.wikipedia.org/wiki/List_of_refractive_indices
+         */
+        indexOfRefraction: number;
+        private _invertRefractionY;
+        /**
+         * Controls if refraction needs to be inverted on Y. This could be useful for procedural texture.
+         */
+        invertRefractionY: boolean;
+        private _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.
+         */
+        linkRefractionWithTransparency: boolean;
+        /**
+         * Defines the minimum thickness stored in the thickness map.
+         * If no thickness map is defined, this value will be used to simulate thickness.
+         */
+        minimumThickness: number;
+        /**
+         * Defines the maximum thickness stored in the thickness map.
+         */
+        maximumThickness: number;
+        /**
+         * Defines the volume tint of the material.
+         * This is used for both translucency and scattering.
+         */
+        tintColor: Color3;
+        /**
+         * Defines the distance at which the tint color should be found in the media.
+         * This is used for refraction only.
+         */
+        tintColorAtDistance: number;
+        /**
+         * Defines how far each channel transmit through the media.
+         * It is defined as a color to simplify it selection.
+         */
+        diffusionDistance: Color3;
+        private _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.
+         */
+        useMaskFromThicknessTexture: boolean;
+        /** @hidden */
+        private _internalMarkAllSubMeshesAsTexturesDirty;
+        /** @hidden */
+        _markAllSubMeshesAsTexturesDirty(): void;
+        /**
+         * Instantiate a new istance of sub surface configuration.
+         * @param markAllSubMeshesAsTexturesDirty Callback to flag the material to dirty
+         */
+        constructor(markAllSubMeshesAsTexturesDirty: () => void);
+        /**
+         * Gets wehter the submesh is ready to be used or not.
+         * @param defines the list of "defines" to update.
+         * @param scene defines the scene the material belongs to.
+         * @returns - boolean indicating that the submesh is ready or not.
+         */
+        isReadyForSubMesh(defines: IMaterialSubSurfaceDefines, scene: Scene): boolean;
+        /**
+         * Checks to see if a texture is used in the material.
+         * @param defines the list of "defines" to update.
+         * @param scene defines the scene to the material belongs to.
+         */
+        prepareDefines(defines: IMaterialSubSurfaceDefines, scene: Scene): void;
+        /**
+         * Binds the material data.
+         * @param uniformBuffer defines the Uniform buffer to fill in.
+         * @param scene defines the scene the material belongs to.
+         * @param engine defines the engine the material belongs to.
+         * @param isFrozen defines wether the material is frozen or not.
+         * @param lodBasedMicrosurface defines wether the material relies on lod based microsurface or not.
+         */
+        bindForSubMesh(uniformBuffer: UniformBuffer, scene: Scene, engine: Engine, isFrozen: boolean, lodBasedMicrosurface: boolean): void;
+        /**
+         * Unbinds the material from the mesh.
+         * @param activeEffect defines the effect that should be unbound from.
+         * @returns true if unbound, otherwise false
+         */
+        unbind(activeEffect: Effect): boolean;
+        /**
+         * Returns the texture used for refraction or null if none is used.
+         * @param scene defines the scene the material belongs to.
+         * @returns - Refraction texture if present.  If no refraction texture and refraction
+         * is linked with transparency, returns environment texture.  Otherwise, returns null.
+         */
+        private _getRefractionTexture;
+        /**
+         * Returns true if alpha blending should be disabled.
+         */
+        readonly disableAlphaBlending: boolean;
+        /**
+         * Fills the list of render target textures.
+         * @param renderTargets the list of render targets to update
+         */
+        fillRenderTargetTextures(renderTargets: SmartArray<RenderTargetTexture>): void;
+        /**
+         * Checks to see if a texture is used in the material.
+         * @param texture - Base texture to use.
+         * @returns - Boolean specifying if a texture is used in the material.
+         */
+        hasTexture(texture: BaseTexture): boolean;
+        /**
+         * Gets a boolean indicating that current material needs to register RTT
+         * @returns true if this uses a render target otherwise false.
+         */
+        hasRenderTargetTextures(): boolean;
+        /**
+         * Returns an array of the actively used textures.
+         * @param activeTextures Array of BaseTextures
+         */
+        getActiveTextures(activeTextures: BaseTexture[]): void;
+        /**
+         * Returns the animatable textures.
+         * @param animatables Array of animatable textures.
+         */
+        getAnimatables(animatables: IAnimatable[]): void;
+        /**
+         * Disposes the resources of the material.
+         * @param forceDisposeTextures - Forces the disposal of all textures.
+         */
+        dispose(forceDisposeTextures?: boolean): void;
+        /**
+        * Get the current class name of the texture useful for serialization or dynamic coding.
+        * @returns "PBRSubSurfaceConfiguration"
+        */
+        getClassName(): string;
+        /**
+         * Add fallbacks to the effect fallbacks list.
+         * @param defines defines the Base texture to use.
+         * @param fallbacks defines the current fallback list.
+         * @param currentRank defines the current fallback rank.
+         * @returns the new fallback rank.
+         */
+        static AddFallbacks(defines: IMaterialSubSurfaceDefines, fallbacks: EffectFallbacks, currentRank: number): number;
+        /**
+         * Add the required uniforms to the current list.
+         * @param uniforms defines the current uniform list.
+         */
+        static AddUniforms(uniforms: string[]): void;
+        /**
+         * Add the required samplers to the current list.
+         * @param samplers defines the current sampler list.
+         */
+        static AddSamplers(samplers: string[]): void;
+        /**
+         * Add the required uniforms to the current buffer.
+         * @param uniformBuffer defines the current uniform buffer.
+         */
+        static PrepareUniformBuffer(uniformBuffer: UniformBuffer): void;
+        /**
+         * Makes a duplicate of the current configuration into another one.
+         * @param configuration define the config where to copy the info
+         */
+        copyTo(configuration: PBRSubSurfaceConfiguration): void;
+        /**
+         * Serializes this Sub Surface configuration.
+         * @returns - An object with the serialized config.
+         */
+        serialize(): any;
+        /**
+         * Parses a Sub Surface Configuration from a serialized object.
+         * @param source - Serialized object.
+         */
+        parse(source: any): void;
+    }
+}
+declare module BABYLON {
     /** @hidden */
     /** @hidden */
     export var pbrFragmentDeclaration: {
     export var pbrFragmentDeclaration: {
         name: string;
         name: string;
@@ -103411,7 +103901,7 @@ declare module BABYLON {
      * Manages the defines for the PBR Material.
      * Manages the defines for the PBR Material.
      * @hidden
      * @hidden
      */
      */
-    export class PBRMaterialDefines extends MaterialDefines implements IImageProcessingConfigurationDefines, IMaterialClearCoatDefines, IMaterialAnisotropicDefines, IMaterialBRDFDefines, IMaterialSheenDefines {
+    export class PBRMaterialDefines extends MaterialDefines implements IImageProcessingConfigurationDefines, IMaterialClearCoatDefines, IMaterialAnisotropicDefines, IMaterialBRDFDefines, IMaterialSheenDefines, IMaterialSubSurfaceDefines {
         PBR: boolean;
         PBR: boolean;
         MAINUV1: boolean;
         MAINUV1: boolean;
         MAINUV2: boolean;
         MAINUV2: boolean;
@@ -103488,13 +103978,6 @@ declare module BABYLON {
         RGBDREFLECTION: boolean;
         RGBDREFLECTION: boolean;
         RADIANCEOCCLUSION: boolean;
         RADIANCEOCCLUSION: boolean;
         HORIZONOCCLUSION: boolean;
         HORIZONOCCLUSION: boolean;
-        REFRACTION: boolean;
-        REFRACTIONMAP_3D: boolean;
-        REFRACTIONMAP_OPPOSITEZ: boolean;
-        LODINREFRACTIONALPHA: boolean;
-        GAMMAREFRACTION: boolean;
-        RGBDREFRACTION: boolean;
-        LINKREFRACTIONTOTRANSPARENCY: boolean;
         INSTANCES: boolean;
         INSTANCES: boolean;
         NUM_BONE_INFLUENCERS: number;
         NUM_BONE_INFLUENCERS: number;
         BonesPerMesh: number;
         BonesPerMesh: number;
@@ -103550,6 +104033,19 @@ declare module BABYLON {
         SHEEN_TEXTURE: boolean;
         SHEEN_TEXTURE: boolean;
         SHEEN_TEXTUREDIRECTUV: number;
         SHEEN_TEXTUREDIRECTUV: number;
         SHEEN_LINKWITHALBEDO: boolean;
         SHEEN_LINKWITHALBEDO: boolean;
+        SUBSURFACE: boolean;
+        SS_REFRACTION: boolean;
+        SS_TRANSLUCENCY: boolean;
+        SS_SCATERRING: boolean;
+        SS_THICKNESSANDMASK_TEXTURE: boolean;
+        SS_THICKNESSANDMASK_TEXTUREDIRECTUV: number;
+        SS_REFRACTIONMAP_3D: boolean;
+        SS_REFRACTIONMAP_OPPOSITEZ: boolean;
+        SS_LODINREFRACTIONALPHA: boolean;
+        SS_GAMMAREFRACTION: boolean;
+        SS_RGBDREFRACTION: boolean;
+        SS_LINKREFRACTIONTOTRANSPARENCY: boolean;
+        SS_MASK_FROM_THICKNESS_TEXTURE: boolean;
         UNLIT: boolean;
         UNLIT: boolean;
         DEBUGMODE: number;
         DEBUGMODE: number;
         /**
         /**
@@ -103660,10 +104156,6 @@ declare module BABYLON {
          */
          */
         protected _reflectionTexture: BaseTexture;
         protected _reflectionTexture: BaseTexture;
         /**
         /**
-         * Stores the refraction values in a texture.
-         */
-        protected _refractionTexture: BaseTexture;
-        /**
          * Stores the emissive values in a texture.
          * Stores the emissive values in a texture.
          */
          */
         protected _emissiveTexture: BaseTexture;
         protected _emissiveTexture: BaseTexture;
@@ -103723,19 +104215,6 @@ declare module BABYLON {
          */
          */
         protected _microSurface: number;
         protected _microSurface: number;
         /**
         /**
-         * source material index of refraction (IOR)' / 'destination material IOR.
-         */
-        protected _indexOfRefraction: number;
-        /**
-         * Controls if refraction needs to be inverted on Y. This could be useful for procedural texture.
-         */
-        protected _invertRefractionY: boolean;
-        /**
-         * 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.
-         */
-        protected _linkRefractionWithTransparency: boolean;
-        /**
          * Specifies that the material will use the light map as a show map.
          * Specifies that the material will use the light map as a show map.
          */
          */
         protected _useLightmapAsShadowmap: boolean;
         protected _useLightmapAsShadowmap: boolean;
@@ -103945,6 +104424,10 @@ declare module BABYLON {
          */
          */
         readonly sheen: PBRSheenConfiguration;
         readonly sheen: PBRSheenConfiguration;
         /**
         /**
+         * Defines the SubSurface parameters for the material.
+         */
+        readonly subSurface: PBRSubSurfaceConfiguration;
+        /**
          * Custom callback helping to override the default shader used in the material.
          * Custom callback helping to override the default shader used in the material.
          */
          */
         customShaderNameResolve: (shaderName: string, uniforms: string[], uniformBuffers: string[], samplers: string[], defines: PBRMaterialDefines) => string;
         customShaderNameResolve: (shaderName: string, uniforms: string[], uniformBuffers: string[], samplers: string[], defines: PBRMaterialDefines) => string;
@@ -104036,7 +104519,7 @@ declare module BABYLON {
          */
          */
         buildUniformLayout(): void;
         buildUniformLayout(): void;
         /**
         /**
-         * Unbinds the textures.
+         * Unbinds the material from the mesh
          */
          */
         unbind(): void;
         unbind(): void;
         /**
         /**
@@ -104057,12 +104540,6 @@ declare module BABYLON {
          */
          */
         private _getReflectionTexture;
         private _getReflectionTexture;
         /**
         /**
-         * Returns the texture used for refraction or null if none is used.
-         * @returns - Refection texture if present.  If no refraction texture and refraction
-         * is linked with transparency, returns environment texture.  Otherwise, returns null.
-         */
-        private _getRefractionTexture;
-        /**
          * Returns an array of the actively used textures.
          * Returns an array of the actively used textures.
          * @returns - Array of BaseTextures
          * @returns - Array of BaseTextures
          */
          */
@@ -104200,7 +104677,7 @@ declare module BABYLON {
         /**
         /**
          * Stores the refracted light information in a texture.
          * Stores the refracted light information in a texture.
          */
          */
-        refractionTexture: BaseTexture;
+        refractionTexture: Nullable<BaseTexture>;
         /**
         /**
          * The color of a material in ambient lighting.
          * The color of a material in ambient lighting.
          */
          */

Файловите разлики са ограничени, защото са твърде много
+ 25 - 21
dist/preview release/viewer/babylon.viewer.js


Файловите разлики са ограничени, защото са твърде много
+ 2 - 2
dist/preview release/viewer/babylon.viewer.max.js


+ 1 - 1
package.json

@@ -9,7 +9,7 @@
     ],
     ],
     "name": "babylonjs",
     "name": "babylonjs",
     "description": "Babylon.js is a JavaScript 3D engine based on webgl.",
     "description": "Babylon.js is a JavaScript 3D engine based on webgl.",
-    "version": "4.0.0-alpha.33",
+    "version": "4.0.0-beta.1",
     "repository": {
     "repository": {
         "type": "git",
         "type": "git",
         "url": "https://github.com/BabylonJS/Babylon.js.git"
         "url": "https://github.com/BabylonJS/Babylon.js.git"

+ 2 - 2
src/Engines/engine.ts

@@ -502,14 +502,14 @@ export class Engine {
      */
      */
     // Not mixed with Version for tooling purpose.
     // Not mixed with Version for tooling purpose.
     public static get NpmPackage(): string {
     public static get NpmPackage(): string {
-        return "babylonjs@4.0.0-alpha.33";
+        return "babylonjs@4.0.0-beta.1";
     }
     }
 
 
     /**
     /**
      * Returns the current version of the framework
      * Returns the current version of the framework
      */
      */
     public static get Version(): string {
     public static get Version(): string {
-        return "4.0.0-alpha.33";
+        return "4.0.0-beta.1";
     }
     }
 
 
     /**
     /**