Browse Source

Merge branch 'master' of https://github.com/BabylonJS/Babylon.js

David Catuhe 7 năm trước cách đây
mục cha
commit
34acbbbd66

+ 39 - 5
src/Materials/Textures/Procedurals/babylon.customProceduralTexture.ts

@@ -1,20 +1,37 @@
 module BABYLON {
+    /**
+     * Procedural texturing is a way to programmatically create a texture. There are 2 types of procedural textures: code-only, and code that references some classic 2D images, sometimes called 'refMaps' or 'sampler' images.
+     * Custom Procedural textures are the easiest way to create your own procedural in your application.
+     * @see http://doc.babylonjs.com/how_to/how_to_use_procedural_textures#creating-custom-procedural-textures
+     */
     export class CustomProceduralTexture extends ProceduralTexture {
         private _animate: boolean = true;
         private _time: number = 0;
         private _config: any;
-        private _texturePath: any;
-
-        constructor(name: string, texturePath: any, size: number, scene: Scene, fallbackTexture?: Texture, generateMipMaps?: boolean) {
+        private _texturePath: string;
+
+        /**
+         * Instantiates a new Custom Procedural Texture.
+         * Procedural texturing is a way to programmatically create a texture. There are 2 types of procedural textures: code-only, and code that references some classic 2D images, sometimes called 'refMaps' or 'sampler' images.
+         * Custom Procedural textures are the easiest way to create your own procedural in your application.
+         * @see http://doc.babylonjs.com/how_to/how_to_use_procedural_textures#creating-custom-procedural-textures
+         * @param name Define the name of the texture
+         * @param texturePath Define the folder path containing all the cutom texture related files (config, shaders...)
+         * @param size Define the size of the texture to create
+         * @param scene Define the scene the texture belongs to
+         * @param fallbackTexture Define a fallback texture in case there were issues to create the custom texture
+         * @param generateMipMaps Define if the texture should creates mip maps or not
+         */
+        constructor(name: string, texturePath: string, size: number, scene: Scene, fallbackTexture?: Texture, generateMipMaps?: boolean) {
             super(name, size, null, scene, fallbackTexture, generateMipMaps);
             this._texturePath = texturePath;
 
             //Try to load json
-            this.loadJson(texturePath);
+            this._loadJson(texturePath);
             this.refreshRate = 1;
         }
 
-        private loadJson(jsonUrl: string): void {
+        private _loadJson(jsonUrl: string): void {
             let noConfigFile = () => {
                 Tools.Log("No config file found in " + jsonUrl + " trying to use ShadersStore or DOM element");
                 try {
@@ -62,6 +79,10 @@
             }
         }
 
+        /**
+         * Is the texture ready to be used ? (rendered at least once)
+         * @returns true if ready, otherwise, false.
+         */
         public isReady(): boolean {
             if (!super.isReady()) {
                 return false;
@@ -78,6 +99,10 @@
             return true;
         }
 
+        /**
+         * Render the texture to its associated render target.
+         * @param useCameraPostProcess Define if camera post process should be applied to the texture
+         */
         public render(useCameraPostProcess?: boolean): void {
             let scene = this.getScene();
             if (this._animate && scene) {
@@ -88,12 +113,18 @@
             super.render(useCameraPostProcess);
         }
 
+        /**
+         * Update the list of dependant textures samplers in the shader.
+         */
         public updateTextures(): void {
             for (var i = 0; i < this._config.sampler2Ds.length; i++) {
                 this.setTexture(this._config.sampler2Ds[i].sample2Dname, new Texture(this._texturePath + "/" + this._config.sampler2Ds[i].textureRelativeUrl, this.getScene()));
             }
         }
 
+        /**
+         * Update the uniform values of the procedural texture in the shader.
+         */
         public updateShaderUniforms(): void {
             if (this._config) {
                 for (var j = 0; j < this._config.uniforms.length; j++) {
@@ -122,6 +153,9 @@
             this.setFloat("time", this._time);
         }
 
+        /**
+         * Define if the texture animates or not.
+         */
         public get animate(): boolean {
             return this._animate;
         }

+ 127 - 20
src/Materials/Textures/Procedurals/babylon.proceduralTexture.ts

@@ -1,16 +1,15 @@
 module BABYLON {
+    /**
+     * Procedural texturing is a way to programmatically create a texture. There are 2 types of procedural textures: code-only, and code that references some classic 2D images, sometimes called 'refMaps' or 'sampler' images.
+     * This is the base class of any Procedural texture and contains most of the shareable code.
+     * @see http://doc.babylonjs.com/how_to/how_to_use_procedural_textures
+     */
     export class ProceduralTexture extends Texture {
-        @serialize()
-        private _size: number;
-
-        /** @hidden */
-        @serialize()
-        public _generateMipMaps: boolean;
-
+        /**
+         * Define if the texture is enabled or not (disabled texture will not render)
+         */
         @serialize()
         public isEnabled = true;
-        private _currentRefreshId = -1;
-        private _refreshRate = 1;
 
         /**
          * Callback called when the texture is generated
@@ -22,17 +21,26 @@
          */
         public onGeneratedObservable = new Observable<ProceduralTexture>();
 
-        private _vertexBuffers: { [key: string]: Nullable<VertexBuffer> } = {};
-        private _indexBuffer: Nullable<WebGLBuffer>;
-        /** get the internal effect */
+        /** @hidden */
+        @serialize()
+        public _generateMipMaps: boolean;
+
+        /** @hidden **/
         public _effect: Effect;
 
+        /** @hidden */
+        public _textures: { [key: string]: Texture } = {};
+
+        @serialize()
+        private _size: number;
+        private _currentRefreshId = -1;
+        private _refreshRate = 1;
+        private _vertexBuffers: { [key: string]: Nullable<VertexBuffer> } = {};
+        private _indexBuffer: Nullable<WebGLBuffer>;
         private _uniforms = new Array<string>();
         private _samplers = new Array<string>();
         private _fragment: any;
 
-        /** @hidden */
-        public _textures: { [key: string]: Texture } = {};
         private _floats: { [key: string]: number } = {};
         private _ints: { [key: string]: number } = {};
         private _floatsArrays: { [key: string]: number[] } = {};
@@ -52,6 +60,19 @@
         private _contentUpdateId = -1;
         private _contentData: Nullable<ArrayBufferView>;
 
+        /**
+         * Instantiates a new procedural texture.
+         * Procedural texturing is a way to programmatically create a texture. There are 2 types of procedural textures: code-only, and code that references some classic 2D images, sometimes called 'refMaps' or 'sampler' images.
+         * This is the base class of any Procedural texture and contains most of the shareable code.
+         * @see http://doc.babylonjs.com/how_to/how_to_use_procedural_textures
+         * @param name  Define the name of the texture
+         * @param size Define the size of the texture to create
+         * @param fragment Define the fragment shader to use to generate the texture or null if it is defined later
+         * @param scene Define the scene the texture belongs to
+         * @param fallbackTexture Define a fallback texture in case there were issues to create the custom texture
+         * @param generateMipMaps Define if the texture should creates mip maps or not
+         * @param isCube Define if the texture is a cube texture or not (this will render each faces of the cube)
+         */
         constructor(name: string, size: any, fragment: any, scene: Nullable<Scene>, fallbackTexture: Nullable<Texture> = null, generateMipMaps = true, public isCube = false) {
             super(null, scene, !generateMipMaps);
 
@@ -140,6 +161,10 @@
             }
         }
 
+        /**
+         * Resets the texture in order to recreate its associated resources.
+         * This can be called in case of context loss
+         */
         public reset(): void {
             if (this._effect === undefined) {
                 return;
@@ -153,7 +178,10 @@
             return "";
         }
 
-
+        /**
+         * Is the texture ready to be used ? (rendered at least once)
+         * @returns true if ready, otherwise, false.
+         */
         public isReady(): boolean {
             var engine = this._engine;
             var shaders;
@@ -201,20 +229,31 @@
             return this._effect.isReady();
         }
 
+        /**
+         * Resets the refresh counter of the texture and start bak from scratch.
+         * Could be usefull to regenerate the texture if it is setup to render only once.
+         */
         public resetRefreshCounter(): void {
             this._currentRefreshId = -1;
         }
 
+        /**
+         * Set the fragment shader to use in order to render the texture.
+         * @param fragment This can be set to a path (into the shader store) or to a json object containing a fragmentElement property.
+         */
         public setFragment(fragment: any) {
             this._fragment = fragment;
         }
 
+        /**
+         * Define the refresh rate of the texture or the rendering frequency.
+         * Use 0 to render just once, 1 to render on every frame, 2 to render every two frames and so on...
+         */
         @serialize()
         public get refreshRate(): number {
             return this._refreshRate;
         }
 
-        // Use 0 to render just once, 1 to render on every frame, 2 to render every two frames and so on...
         public set refreshRate(value: number) {
             this._refreshRate = value;
             this.resetRefreshCounter();
@@ -247,10 +286,19 @@
             return false;
         }
 
+        /**
+         * Get the size the texture is rendering at.
+         * @returns the size (texture is always squared)
+         */
         public getRenderSize(): number {
             return this._size;
         }
 
+        /**
+         * Resize the texture to new value.
+         * @param size Define the new size the texture should have
+         * @param generateMipMaps Define whether the new texture should create mip maps
+         */
         public resize(size: number, generateMipMaps: boolean): void {
             if (this._fallbackTextureUsed) {
                 return;
@@ -270,6 +318,12 @@
             }
         }
 
+        /**
+         * Set a texture in the shader program used to render.
+         * @param name Define the name of the uniform samplers as defined in the shader
+         * @param texture Define the texture to bind to this sampler
+         * @return the texture itself allowing "fluent" like uniform updates
+         */
         public setTexture(name: string, texture: Texture): ProceduralTexture {
             if (this._samplers.indexOf(name) === -1) {
                 this._samplers.push(name);
@@ -279,6 +333,12 @@
             return this;
         }
 
+        /**
+         * Set a float in the shader.
+         * @param name Define the name of the uniform as defined in the shader
+         * @param value Define the value to give to the uniform
+         * @return the texture itself allowing "fluent" like uniform updates
+         */
         public setFloat(name: string, value: number): ProceduralTexture {
             this._checkUniform(name);
             this._floats[name] = value;
@@ -287,10 +347,10 @@
         }
 
         /**
-         * Set the value of an uniform to an integer value
-         * @param name defines the name of the uniform
-         * @param value defines the value to set
-         * @returns the current procedural texture
+         * Set a int in the shader.
+         * @param name Define the name of the uniform as defined in the shader
+         * @param value Define the value to give to the uniform
+         * @return the texture itself allowing "fluent" like uniform updates
          */
         public setInt(name: string, value: number): ProceduralTexture {
             this._checkUniform(name);
@@ -299,6 +359,12 @@
             return this;
         }
 
+        /**
+         * Set an array of floats in the shader.
+         * @param name Define the name of the uniform as defined in the shader
+         * @param value Define the value to give to the uniform
+         * @return the texture itself allowing "fluent" like uniform updates
+         */
         public setFloats(name: string, value: number[]): ProceduralTexture {
             this._checkUniform(name);
             this._floatsArrays[name] = value;
@@ -306,6 +372,12 @@
             return this;
         }
 
+        /**
+         * Set a vec3 in the shader from a Color3.
+         * @param name Define the name of the uniform as defined in the shader
+         * @param value Define the value to give to the uniform
+         * @return the texture itself allowing "fluent" like uniform updates
+         */
         public setColor3(name: string, value: Color3): ProceduralTexture {
             this._checkUniform(name);
             this._colors3[name] = value;
@@ -313,6 +385,12 @@
             return this;
         }
 
+        /**
+         * Set a vec4 in the shader from a Color4.
+         * @param name Define the name of the uniform as defined in the shader
+         * @param value Define the value to give to the uniform
+         * @return the texture itself allowing "fluent" like uniform updates
+         */
         public setColor4(name: string, value: Color4): ProceduralTexture {
             this._checkUniform(name);
             this._colors4[name] = value;
@@ -320,6 +398,12 @@
             return this;
         }
 
+        /**
+         * Set a vec2 in the shader from a Vector2.
+         * @param name Define the name of the uniform as defined in the shader
+         * @param value Define the value to give to the uniform
+         * @return the texture itself allowing "fluent" like uniform updates
+         */
         public setVector2(name: string, value: Vector2): ProceduralTexture {
             this._checkUniform(name);
             this._vectors2[name] = value;
@@ -327,6 +411,12 @@
             return this;
         }
 
+        /**
+         * Set a vec3 in the shader from a Vector3.
+         * @param name Define the name of the uniform as defined in the shader
+         * @param value Define the value to give to the uniform
+         * @return the texture itself allowing "fluent" like uniform updates
+         */
         public setVector3(name: string, value: Vector3): ProceduralTexture {
             this._checkUniform(name);
             this._vectors3[name] = value;
@@ -334,6 +424,12 @@
             return this;
         }
 
+        /**
+         * Set a mat4 in the shader from a MAtrix.
+         * @param name Define the name of the uniform as defined in the shader
+         * @param value Define the value to give to the uniform
+         * @return the texture itself allowing "fluent" like uniform updates
+         */
         public setMatrix(name: string, value: Matrix): ProceduralTexture {
             this._checkUniform(name);
             this._matrices[name] = value;
@@ -341,6 +437,10 @@
             return this;
         }
 
+        /**
+         * Render the texture to its associated render target.
+         * @param useCameraPostProcess Define if camera post process should be applied to the texture
+         */
         public render(useCameraPostProcess?: boolean): void {
             var scene = this.getScene();
 
@@ -447,6 +547,10 @@
             this.onGeneratedObservable.notifyObservers(this);
         }
 
+        /**
+         * Clone the texture.
+         * @returns the cloned texture
+         */
         public clone(): ProceduralTexture {
             var textureSize = this.getSize();
             var newTexture = new ProceduralTexture(this.name, textureSize.width, this._fragment, <Scene>this.getScene(), this._fallbackTexture, this._generateMipMaps);
@@ -461,6 +565,9 @@
             return newTexture;
         }
 
+        /**
+         * Dispose the texture and release its asoociated resources.
+         */
         public dispose(): void {
             let scene = this.getScene();
 

+ 166 - 0
src/Materials/Textures/babylon.baseTexture.ts

@@ -1,12 +1,27 @@
 module BABYLON {
+    /**
+     * Base class of all the textures in babylon.
+     * It groups all the common properties the materials, post process, lights... might need 
+     * in order to make a correct use of the texture.
+     */
     export class BaseTexture {
+        /**
+         * Default anisotropic filtering level for the application.
+         * It is set to 4 as a good tradeoff between perf and quality.
+         */
         public static DEFAULT_ANISOTROPIC_FILTERING_LEVEL = 4;
 
+        /**
+         * Define the name of the texture.
+         */
         @serialize()
         public name: string;
 
         @serialize("hasAlpha")
         private _hasAlpha = false;
+        /**
+         * Define if the texture is having a usable alpha value (can be use for transparency or glossiness for instance).
+         */
         public set hasAlpha(value: boolean) {
             if (this._hasAlpha === value) {
                 return;
@@ -20,12 +35,24 @@
             return this._hasAlpha;
         }
 
+        /**
+         * Defines if the alpha value should be determined via the rgb values.
+         * If true the luminance of the pixel might be used to find the corresponding alpha value.
+         */
         @serialize()
         public getAlphaFromRGB = false;
 
+        /**
+         * Intensity or strength of the texture.
+         * It is commonly used by materials to fine tune the intensity of the texture
+         */
         @serialize()
         public level = 1;
 
+        /**
+         * Define the UV chanel to use starting from 0 and defaulting to 0.
+         * This is part of the texture as textures usually maps to one uv set.
+         */
         @serialize()
         public coordinatesIndex = 0;
 
@@ -91,15 +118,31 @@
         @serialize()
         public wrapR = Texture.WRAP_ADDRESSMODE;
 
+        /**
+         * With compliant hardware and browser (supporting anisotropic filtering)
+         * this defines the level of anisotropic filtering in the texture.
+         * The higher the better but the slower. This defaults to 4 as it seems to be the best tradeoff.
+         */
         @serialize()
         public anisotropicFilteringLevel = BaseTexture.DEFAULT_ANISOTROPIC_FILTERING_LEVEL;
 
+        /**
+         * Define if the texture is a cube texture or if false a 2d texture.
+         */
         @serialize()
         public isCube = false;
 
+        /**
+         * Define if the texture is a 3d texture (webgl 2) or if false a 2d texture.
+         */
         @serialize()
         public is3D = false;
 
+        /**
+         * Define if the texture contains data in gamma space (most of the png/jpg aside bump).
+         * HDR texture are usually stored in linear space.
+         * This only impacts the PBR and Background materials
+         */
         @serialize()
         public gammaSpace = true;
 
@@ -110,12 +153,21 @@
             return this._texture != null && this._texture._isRGBD;
         }
 
+        /**
+         * Is Z inverted in the texture (useful in a cube texture).
+         */
         @serialize()
         public invertZ = false;
 
+        /**
+         * @hidden
+         */
         @serialize()
         public lodLevelInAlpha = false;
 
+        /**
+         * With prefiltered texture, defined the offset used during the prefiltering steps.
+         */
         @serialize()
         public get lodGenerationOffset(): number {
             if (this._texture) return this._texture._lodGenerationOffset;
@@ -126,6 +178,9 @@
             if (this._texture) this._texture._lodGenerationOffset = value;
         }
 
+        /**
+         * With prefiltered texture, defined the scale used during the prefiltering steps.
+         */
         @serialize()
         public get lodGenerationScale(): number {
             if (this._texture) return this._texture._lodGenerationScale;
@@ -136,9 +191,15 @@
             if (this._texture) this._texture._lodGenerationScale = value;
         }
 
+        /**
+         * Define if the texture is a render target.
+         */
         @serialize()
         public isRenderTarget = false;
 
+        /**
+         * Define the unique id of the texture in the scene.
+         */
         public get uid(): string {
             if (!this._uid) {
                 this._uid = Tools.RandomId();
@@ -146,14 +207,25 @@
             return this._uid;
         }
 
+        /**
+         * Return a string representation of the texture.
+         * @returns the texture as a string
+         */
         public toString(): string {
             return this.name;
         }
 
+        /**
+         * Get the class name of the texture.
+         * @returns "BaseTexture"
+         */
         public getClassName(): string {
             return "BaseTexture";
         }
 
+        /**
+         * Define the list of animation attached to the texture.
+         */
         public animations = new Array<Animation>();
 
         /**
@@ -162,6 +234,10 @@
         public onDisposeObservable = new Observable<BaseTexture>();
 
         private _onDisposeObserver: Nullable<Observer<BaseTexture>>;
+        /**
+         * Callback triggered when the texture has been disposed.
+         * Kept for back compatibility, you can use the onDisposeObservable instead.
+         */
         public set onDispose(callback: () => void) {
             if (this._onDisposeObserver) {
                 this.onDisposeObservable.remove(this._onDisposeObserver);
@@ -169,6 +245,9 @@
             this._onDisposeObserver = this.onDisposeObservable.add(callback);
         }
 
+        /**
+         * Define the current state of the loading sequence when in delayed load mode.
+         */
         public delayLoadState = Engine.DELAYLOADSTATE_NONE;
 
         private _scene: Nullable<Scene>;
@@ -177,10 +256,21 @@
         public _texture: Nullable<InternalTexture>;
         private _uid: Nullable<string>;
 
+        /**
+         * Define if the texture is preventinga material to render or not.
+         * If not and the texture is not ready, the engine will use a default black texture instead.
+         */
         public get isBlocking(): boolean {
             return true;
         }
 
+        /**
+         * Instantiates a new BaseTexture.
+         * Base class of all the textures in babylon.
+         * It groups all the common properties the materials, post process, lights... might need 
+         * in order to make a correct use of the texture.
+         * @param scene Define the scene the texture blongs to
+         */
         constructor(scene: Nullable<Scene>) {
             this._scene = scene || Engine.LastCreatedScene;
             if (this._scene) {
@@ -190,26 +280,50 @@
             this._uid = null;
         }
 
+        /**
+         * Get the scene the texture belongs to.
+         * @returns the scene or null if undefined
+         */
         public getScene(): Nullable<Scene> {
             return this._scene;
         }
 
+        /**
+         * Get the texture transform matrix used to offset tile the texture for istance.
+         * @returns the transformation matrix
+         */
         public getTextureMatrix(): Matrix {
             return Matrix.IdentityReadOnly;
         }
 
+        /**
+         * Get the texture reflection matrix used to rotate/transform the reflection.
+         * @returns the reflection matrix
+         */
         public getReflectionTextureMatrix(): Matrix {
             return Matrix.IdentityReadOnly;
         }
 
+        /**
+         * Get the underlying lower level texture from Babylon.
+         * @returns the insternal texture
+         */
         public getInternalTexture(): Nullable<InternalTexture> {
             return this._texture;
         }
 
+        /**
+         * Get if the texture is ready to be consumed (either it is ready or it is not blocking)
+         * @returns true if ready or not blocking
+         */
         public isReadyOrNotBlocking(): boolean {
             return !this.isBlocking || this.isReady();
         }
 
+        /**
+         * Get if the texture is ready to be used (downloaded, converted, mip mapped...).
+         * @returns true if fully ready
+         */
         public isReady(): boolean {
             if (this.delayLoadState === Engine.DELAYLOADSTATE_NOTLOADED) {
                 this.delayLoad();
@@ -224,6 +338,10 @@
         }
 
         private _cachedSize: ISize = Size.Zero();
+        /**
+         * Get the size of the texture.
+         * @returns the texture size.
+         */
         public getSize(): ISize {
             if (this._texture) {
                 if (this._texture.width) {
@@ -242,6 +360,11 @@
             return this._cachedSize;
         }
 
+        /**
+         * Get the base size of the texture.
+         * It can be different from the size if the texture has been resized for POT for instance
+         * @returns the base size
+         */
         public getBaseSize(): ISize {
             if (!this.isReady() || !this._texture)
                 return Size.Zero();
@@ -253,9 +376,16 @@
             return new Size(this._texture.baseWidth, this._texture.baseHeight);
         }
 
+        /**
+         * Scales the texture if is `canRescale()`
+         * @param ratio the resize factor we want to use to rescale
+         */
         public scale(ratio: number): void {
         }
 
+        /**
+         * Get if the texture can rescale.
+         */
         public get canRescale(): boolean {
             return false;
         }
@@ -286,13 +416,23 @@
 
         }
 
+        /**
+         * Triggers the load sequence in delayed load mode.
+         */
         public delayLoad(): void {
         }
 
+        /**
+         * Clones the texture.
+         * @returns the cloned texture
+         */
         public clone(): Nullable<BaseTexture> {
             return null;
         }
 
+        /**
+         * Get the texture underlying type (INT, FLOAT...)
+         */
         public get textureType(): number {
             if (!this._texture) {
                 return Engine.TEXTURETYPE_UNSIGNED_INT;
@@ -301,6 +441,9 @@
             return (this._texture.type !== undefined) ? this._texture.type : Engine.TEXTURETYPE_UNSIGNED_INT;
         }
 
+        /**
+         * Get the texture underlying format (RGB, RGBA...)
+         */
         public get textureFormat(): number {
             if (!this._texture) {
                 return Engine.TEXTUREFORMAT_RGBA;
@@ -349,6 +492,9 @@
             return engine._readTexturePixels(this._texture, width, height, -1, level, buffer);
         }
 
+        /**
+         * Release and destroy the underlying lower level texture aka internalTexture.
+         */
         public releaseInternalTexture(): void {
             if (this._texture) {
                 this._texture.dispose();
@@ -356,6 +502,11 @@
             }
         }
 
+        /**
+         * Get the polynomial representation of the texture data.
+         * This is mainly use as a fast way to recover IBL Diffuse irradiance data.
+         * @see https://learnopengl.com/PBR/IBL/Diffuse-irradiance
+         */
         public get sphericalPolynomial(): Nullable<SphericalPolynomial> {
             if (!this._texture || !CubeMapToSphericalPolynomialTools || !this.isReady()) {
                 return null;
@@ -375,6 +526,7 @@
             }
         }
 
+        /** @hidden */
         public get _lodTextureHigh(): Nullable<BaseTexture> {
             if (this._texture) {
                 return this._texture._lodTextureHigh;
@@ -382,6 +534,7 @@
             return null;
         }
 
+        /** @hidden */
         public get _lodTextureMid(): Nullable<BaseTexture> {
             if (this._texture) {
                 return this._texture._lodTextureMid;
@@ -389,6 +542,7 @@
             return null;
         }
 
+        /** @hidden */
         public get _lodTextureLow(): Nullable<BaseTexture> {
             if (this._texture) {
                 return this._texture._lodTextureLow;
@@ -396,6 +550,9 @@
             return null;
         }
 
+        /**
+         * Dispose the texture and release its associated resources.
+         */
         public dispose(): void {
             if (!this._scene) {
                 return;
@@ -425,6 +582,10 @@
             this.onDisposeObservable.clear();
         }
 
+        /**
+         * Serialize the texture into a JSON representation that can be parsed later on.
+         * @returns the JSON representation of the texture
+         */
         public serialize(): any {
             if (!this.name) {
                 return null;
@@ -438,6 +599,11 @@
             return serializationObject;
         }
 
+        /**
+         * Helper function to be called back once a list of texture contains only ready textures.
+         * @param textures Define the list of textures to wait for
+         * @param callback Define the callback triggered once the entire list will be ready
+         */
         public static WhenAllReady(textures: BaseTexture[], callback: () => void): void {
             let numRemaining = textures.length;
             if (numRemaining === 0) {

+ 15 - 0
src/Materials/Textures/babylon.hdrCubeTexture.ts

@@ -257,14 +257,29 @@ module BABYLON {
             }
         }
 
+        /**
+         * Get the texture reflection matrix used to rotate/transform the reflection.
+         * @returns the reflection matrix
+         */
         public getReflectionTextureMatrix(): Matrix {
             return this._textureMatrix;
         }
 
+        /**
+         * Set the texture reflection matrix used to rotate/transform the reflection.
+         * @param value Define the reflection matrix to set
+         */
         public setReflectionTextureMatrix(value: Matrix): void {
             this._textureMatrix = value;
         }
 
+        /**
+         * Parses a JSON representation of an HDR Texture in order to create the texture
+         * @param parsedTexture Define the JSON representation
+         * @param scene Define the scene the texture should be created in
+         * @param rootUrl Define the root url in case we need to load relative dependencies
+         * @returns the newly created texture after parsing
+         */
         public static Parse(parsedTexture: any, scene: Scene, rootUrl: string): Nullable<HDRCubeTexture> {
             var texture = null;
             if (parsedTexture.name && !parsedTexture.isRenderTarget) {

+ 2 - 2
src/Materials/Textures/babylon.internalTexture.ts

@@ -87,11 +87,11 @@ module BABYLON {
          */
         public samples: number;
         /**
-         * Gets the type of the texture
+         * Gets the type of the texture (int, float...)
          */
         public type: number;
         /**
-         * Gets the format of the texture 
+         * Gets the format of the texture (RGB, RGBA...)
          */
         public format: number;
         /**

+ 70 - 11
src/Materials/Textures/babylon.mirrorTexture.ts

@@ -1,18 +1,22 @@
 module BABYLON {
+    /**
+     * Mirror texture can be used to simulate the view from a mirror in a scene.
+     * It will dynamically be rendered every frame to adapt to the camera point of view.
+     * You can then easily use it as a reflectionTexture on a flat surface.
+     * In case the surface is not a plane, please consider relying on reflection probes.
+     * @see https://doc.babylonjs.com/how_to/reflect#mirrors
+     */
     export class MirrorTexture extends RenderTargetTexture {
+        /**
+         * Define the reflection plane we want to use. The mirrorPlane is usually set to the constructed reflector. 
+         * It is possible to directly set the mirrorPlane by directly using a BABYLON.Plane(a, b, c, d) where a, b and c give the plane normal vector (a, b, c) and d is a scalar displacement from the mirrorPlane to the origin. However in all but the very simplest of situations it is more straight forward to set it to the reflector as stated in the doc.
+         * @see https://doc.babylonjs.com/how_to/reflect#mirrors
+         */
         public mirrorPlane = new Plane(0, 1, 0, 1);
 
-        private _transformMatrix = Matrix.Zero();
-        private _mirrorMatrix = Matrix.Zero();
-        private _savedViewMatrix: Matrix;
-
-        private _blurX: Nullable<BlurPostProcess>;
-        private _blurY: Nullable<BlurPostProcess>;
-        private _adaptiveBlurKernel = 0;
-        private _blurKernelX = 0;
-        private _blurKernelY = 0;
-        private _blurRatio = 1.0;
-
+        /**
+         * Define the blur ratio used to blur the reflection if needed.
+         */
         public set blurRatio(value: number) {
             if (this._blurRatio === value) {
                 return;
@@ -26,16 +30,28 @@
             return this._blurRatio;
         }
 
+        /**
+         * Define the adaptive blur kernel used to blur the reflection if needed.
+         * This will autocompute the closest best match for the `blurKernel`
+         */
         public set adaptiveBlurKernel(value: number) {
             this._adaptiveBlurKernel = value;
             this._autoComputeBlurKernel();
         }
 
+        /**
+         * Define the blur kernel used to blur the reflection if needed.
+         * Please consider using `adaptiveBlurKernel` as it could find the closest best value for you.
+         */
         public set blurKernel(value: number) {
             this.blurKernelX = value;
             this.blurKernelY = value;
         }
 
+        /**
+         * Define the blur kernel on the X Axis used to blur the reflection if needed.
+         * Please consider using `adaptiveBlurKernel` as it could find the closest best value for you.
+         */
         public set blurKernelX(value: number) {
             if (this._blurKernelX === value) {
                 return;
@@ -49,6 +65,10 @@
             return this._blurKernelX;
         }
 
+        /**
+         * Define the blur kernel on the Y Axis used to blur the reflection if needed.
+         * Please consider using `adaptiveBlurKernel` as it could find the closest best value for you.
+         */
         public set blurKernelY(value: number) {
             if (this._blurKernelY === value) {
                 return;
@@ -83,11 +103,39 @@
                 this._autoComputeBlurKernel();
             }
         }
+
         private _updateGammaSpace(){
             this.gammaSpace = !this.scene.imageProcessingConfiguration.isEnabled || !this.scene.imageProcessingConfiguration.applyByPostProcess;
         }
 
         private _imageProcessingConfigChangeObserver:Nullable<Observer<ImageProcessingConfiguration>>;
+
+        private _transformMatrix = Matrix.Zero();
+        private _mirrorMatrix = Matrix.Zero();
+        private _savedViewMatrix: Matrix;
+
+        private _blurX: Nullable<BlurPostProcess>;
+        private _blurY: Nullable<BlurPostProcess>;
+        private _adaptiveBlurKernel = 0;
+        private _blurKernelX = 0;
+        private _blurKernelY = 0;
+        private _blurRatio = 1.0;
+
+        /**
+         * Instantiates a Mirror Texture.
+         * Mirror texture can be used to simulate the view from a mirror in a scene.
+         * It will dynamically be rendered every frame to adapt to the camera point of view.
+         * You can then easily use it as a reflectionTexture on a flat surface.
+         * In case the surface is not a plane, please consider relying on reflection probes.
+         * @see https://doc.babylonjs.com/how_to/reflect#mirrors
+         * @param name 
+         * @param size 
+         * @param scene 
+         * @param generateMipMaps 
+         * @param type 
+         * @param samplingMode 
+         * @param generateDepthBuffer 
+         */
         constructor(name: string, size: number | { width: number, height: number } | { ratio: number }, private scene: Scene, generateMipMaps?: boolean, type: number = Engine.TEXTURETYPE_UNSIGNED_INT, samplingMode = Texture.BILINEAR_SAMPLINGMODE, generateDepthBuffer = true) {
             super(name, size, scene, generateMipMaps, true, type, false, samplingMode, generateDepthBuffer);
 
@@ -160,6 +208,10 @@
             }
         }
 
+        /**
+         * Clone the mirror texture.
+         * @returns the cloned texture
+         */
         public clone(): MirrorTexture {
             let scene = this.getScene();
 
@@ -191,6 +243,10 @@
             return newTexture;
         }
 
+        /**
+         * Serialize the texture to a JSON representation you could use in Parse later on
+         * @returns the serialized JSON representation
+         */
         public serialize(): any {
             if (!this.name) {
                 return null;
@@ -203,6 +259,9 @@
             return serializationObject;
         }
 
+        /**
+         * Dispose the texture and release its associated resources.
+         */
         public dispose(){
             super.dispose();
             this.scene.imageProcessingConfiguration.onUpdateParameters.remove(this._imageProcessingConfigChangeObserver);

+ 81 - 2
src/Materials/Textures/babylon.multiRenderTarget.ts

@@ -1,34 +1,83 @@
 module BABYLON {
+    /**
+     * Creation options of the multi render target texture.
+     */
     export interface IMultiRenderTargetOptions {
+        /**
+         * Define if the texture needs to create mip maps after render.
+         */
         generateMipMaps?: boolean,
+        /**
+         * Define the types of all the draw buffers we want to create
+         */
         types?: number[],
+        /**
+         * Define the sampling modes of all the draw buffers we want to create
+         */
         samplingModes?: number[],
+        /**
+         * Define if a depth buffer is required
+         */
         generateDepthBuffer?: boolean,
+        /**
+         * Define if a stencil buffer is required
+         */
         generateStencilBuffer?: boolean,
+        /**
+         * Define if a depth texture is required instead of a depth buffer
+         */
         generateDepthTexture?: boolean,
+        /**
+         * Define the number of desired draw buffers
+         */
         textureCount?: number,
+        /**
+         * Define if aspect ratio should be adapted to the texture or stay the scene one
+         */
         doNotChangeAspectRatio?: boolean,
+        /**
+         * Define the default type of the buffers we are creating
+         */
         defaultType?: number
     };
+
+    /**
+     * A multi render target, like a render target provides the ability to render to a texture.
+     * Unlike the render target, it can render to several draw buffers in one draw.
+     * This is specially interesting in deferred rendering or for any effects requiring more than
+     * just one color from a single pass.
+     */
     export class MultiRenderTarget extends RenderTargetTexture {
 
         private _internalTextures: InternalTexture[];
         private _textures: Texture[];
+        private _multiRenderTargetOptions: IMultiRenderTargetOptions;
 
+        /**
+         * Get if draw buffers are currently supported by the used hardware and browser.
+         */
         public get isSupported(): boolean {
             return this._engine.webGLVersion > 1 || this._engine.getCaps().drawBuffersExtension;
         }
 
-        private _multiRenderTargetOptions: IMultiRenderTargetOptions;
-
+        /**
+         * Get the list of textures generated by the multi render target.
+         */
         public get textures(): Texture[] {
             return this._textures;
         }
 
+        /**
+         * Get the depth texture generated by the multi render target if options.generateDepthTexture has been set
+         */
         public get depthTexture(): Texture {
             return this._textures[this._textures.length - 1];
         }
 
+        /**
+         * Set the wrapping mode on U of all the textures we are rendering to.
+         * Can be any of the Texture. (CLAMP_ADDRESSMODE, MIRROR_ADDRESSMODE or WRAP_ADDRESSMODE)
+         */
         public set wrapU(wrap: number) {
             if (this._textures) {
                 for (var i = 0; i < this._textures.length; i++) {
@@ -37,6 +86,10 @@ module BABYLON {
             }
         }
 
+        /**
+         * Set the wrapping mode on V of all the textures we are rendering to.
+         * Can be any of the Texture. (CLAMP_ADDRESSMODE, MIRROR_ADDRESSMODE or WRAP_ADDRESSMODE)
+         */
         public set wrapV(wrap: number) {
             if (this._textures) {
                 for (var i = 0; i < this._textures.length; i++) {
@@ -45,6 +98,18 @@ module BABYLON {
             }
         }
 
+        /**
+         * Instantiate a new multi render target texture.
+         * A multi render target, like a render target provides the ability to render to a texture.
+         * Unlike the render target, it can render to several draw buffers in one draw.
+         * This is specially interesting in deferred rendering or for any effects requiring more than
+         * just one color from a single pass.
+         * @param name Define the name of the texture
+         * @param size Define the size of the buffers to render to
+         * @param count Define the number of target we are rendering into
+         * @param scene Define the scene the texture belongs to
+         * @param options Define the options used to create the multi render target
+         */
         constructor(name: string, size: any, count: number, scene: Scene, options?: IMultiRenderTargetOptions) {
             var generateMipMaps = options && options.generateMipMaps ? options.generateMipMaps : false;
             var generateDepthTexture = options && options.generateDepthTexture ? options.generateDepthTexture : false;
@@ -124,6 +189,9 @@ module BABYLON {
             this._texture = this._internalTextures[0];
         }
 
+        /**
+         * Define the number of samples used if MSAA is enabled.
+         */
         public get samples(): number {
             return this._samples;
         }
@@ -136,6 +204,11 @@ module BABYLON {
             this._samples = this._engine.updateMultipleRenderTargetTextureSampleCount(this._internalTextures, value);
         }
 
+        /**
+         * Resize all the textures in the multi render target.
+         * Be carrefull as it will recreate all the data in the new texture.
+         * @param size Define the new size
+         */
         public resize(size: any) {
             this.releaseInternalTextures();
             this._internalTextures = this._engine.createMultipleRenderTarget(size, this._multiRenderTargetOptions);
@@ -148,12 +221,18 @@ module BABYLON {
             });
         }
 
+        /**
+         * Dispose the render targets and their associated resources
+         */
         public dispose(): void {
             this.releaseInternalTextures();
 
             super.dispose();
         }
 
+        /**
+         * Release all the underlying texture used as draw buffers.
+         */
         public releaseInternalTextures(): void {
             if (!this._internalTextures) {
                 return;

+ 92 - 2
src/Materials/Textures/babylon.rawTexture.ts

@@ -1,6 +1,27 @@
 module BABYLON {
+    /**
+     * Raw texture can help creating a texture directly from an array of data.
+     * This can be super useful if you either get the data from an uncompressed source or
+     * if you wish to create your texture pixel by pixel.
+     */
     export class RawTexture extends Texture {
         private _engine: Engine;
+
+        /**
+         * Instantiates a new RawTexture.
+         * Raw texture can help creating a texture directly from an array of data.
+         * This can be super useful if you either get the data from an uncompressed source or
+         * if you wish to create your texture pixel by pixel.
+         * @param data define the array of data to use to create the texture
+         * @param width define the width of the texture
+         * @param height define the height of the texture
+         * @param format define the format of the data (RGB, RGBA... Engine.TEXTUREFORMAT_xxx)
+         * @param scene  define the scene the texture belongs to
+         * @param generateMipMaps define whether mip maps should be generated or not
+         * @param invertY define if the data should be flipped on Y when uploaded to the GPU
+         * @param samplingMode define the texture sampling mode (Texture.xxx_SAMPLINGMODE)
+         * @param type define the format of the data (int, float... Engine.TEXTURETYPE_xxx)
+         */
         constructor(data: ArrayBufferView, width: number, height: number, public format: number, scene: Scene, generateMipMaps: boolean = true, invertY: boolean = false, samplingMode: number = Texture.TRILINEAR_SAMPLINGMODE, type: number = Engine.TEXTURETYPE_UNSIGNED_INT) {
             super(null, scene, !generateMipMaps, invertY);
             this._engine = scene.getEngine();
@@ -10,33 +31,102 @@
             this.wrapV = Texture.CLAMP_ADDRESSMODE;
         }
 
+        /**
+         * Updates the texture underlying data.
+         * @param data Define the new data of the texture
+         */
         public update(data: ArrayBufferView): void {
             this._engine.updateRawTexture(this._texture, data, this._texture!.format, this._texture!.invertY, undefined, this._texture!.type);
         }
 
-        // Statics
+        /**
+         * Creates a luminance texture from some data.
+         * @param data Define the texture data
+         * @param width Define the width of the texture
+         * @param height Define the height of the texture
+         * @param scene Define the scene the texture belongs to
+         * @param generateMipMaps Define whether or not to create mip maps for the texture
+         * @param invertY define if the data should be flipped on Y when uploaded to the GPU
+         * @param samplingMode define the texture sampling mode (Texture.xxx_SAMPLINGMODE)
+         * @returns the luminance texture
+         */
         public static CreateLuminanceTexture(data: ArrayBufferView, width: number, height: number, scene: Scene, generateMipMaps: boolean = true, invertY: boolean = false, samplingMode: number = Texture.TRILINEAR_SAMPLINGMODE): RawTexture {
             return new RawTexture(data, width, height, Engine.TEXTUREFORMAT_LUMINANCE, scene, generateMipMaps, invertY, samplingMode);
         }
 
+        /**
+         * Creates a luminance alpha texture from some data.
+         * @param data Define the texture data
+         * @param width Define the width of the texture
+         * @param height Define the height of the texture
+         * @param scene Define the scene the texture belongs to
+         * @param generateMipMaps Define whether or not to create mip maps for the texture
+         * @param invertY define if the data should be flipped on Y when uploaded to the GPU
+         * @param samplingMode define the texture sampling mode (Texture.xxx_SAMPLINGMODE)
+         * @returns the luminance alpha texture
+         */
         public static CreateLuminanceAlphaTexture(data: ArrayBufferView, width: number, height: number, scene: Scene, generateMipMaps: boolean = true, invertY: boolean = false, samplingMode: number = Texture.TRILINEAR_SAMPLINGMODE): RawTexture {
             return new RawTexture(data, width, height, Engine.TEXTUREFORMAT_LUMINANCE_ALPHA, scene, generateMipMaps, invertY, samplingMode);
         }
 
+        /**
+         * Creates an alpha texture from some data.
+         * @param data Define the texture data
+         * @param width Define the width of the texture
+         * @param height Define the height of the texture
+         * @param scene Define the scene the texture belongs to
+         * @param generateMipMaps Define whether or not to create mip maps for the texture
+         * @param invertY define if the data should be flipped on Y when uploaded to the GPU
+         * @param samplingMode define the texture sampling mode (Texture.xxx_SAMPLINGMODE)
+         * @returns the alpha texture
+         */
         public static CreateAlphaTexture(data: ArrayBufferView, width: number, height: number, scene: Scene, generateMipMaps: boolean = true, invertY: boolean = false, samplingMode: number = Texture.TRILINEAR_SAMPLINGMODE): RawTexture {
             return new RawTexture(data, width, height, Engine.TEXTUREFORMAT_ALPHA, scene, generateMipMaps, invertY, samplingMode);
         }
 
+        /**
+         * Creates a RGB texture from some data.
+         * @param data Define the texture data
+         * @param width Define the width of the texture
+         * @param height Define the height of the texture
+         * @param scene Define the scene the texture belongs to
+         * @param generateMipMaps Define whether or not to create mip maps for the texture
+         * @param invertY define if the data should be flipped on Y when uploaded to the GPU
+         * @param samplingMode define the texture sampling mode (Texture.xxx_SAMPLINGMODE)
+         * @returns the RGB alpha texture
+         */
         public static CreateRGBTexture(data: ArrayBufferView, width: number, height: number, scene: Scene, generateMipMaps: boolean = true, invertY: boolean = false, samplingMode: number = Texture.TRILINEAR_SAMPLINGMODE, type: number = Engine.TEXTURETYPE_UNSIGNED_INT): RawTexture {
             return new RawTexture(data, width, height, Engine.TEXTUREFORMAT_RGB, scene, generateMipMaps, invertY, samplingMode, type);
         }
 
+        /**
+         * Creates a RGBA texture from some data.
+         * @param data Define the texture data
+         * @param width Define the width of the texture
+         * @param height Define the height of the texture
+         * @param scene Define the scene the texture belongs to
+         * @param generateMipMaps Define whether or not to create mip maps for the texture
+         * @param invertY define if the data should be flipped on Y when uploaded to the GPU
+         * @param samplingMode define the texture sampling mode (Texture.xxx_SAMPLINGMODE)
+         * @returns the RGBA texture
+         */
         public static CreateRGBATexture(data: ArrayBufferView, width: number, height: number, scene: Scene, generateMipMaps: boolean = true, invertY: boolean = false, samplingMode: number = Texture.TRILINEAR_SAMPLINGMODE, type: number = Engine.TEXTURETYPE_UNSIGNED_INT): RawTexture {
             return new RawTexture(data, width, height, Engine.TEXTUREFORMAT_RGBA, scene, generateMipMaps, invertY, samplingMode, type);
         }
 
+        /**
+         * Creates a R texture from some data.
+         * @param data Define the texture data
+         * @param width Define the width of the texture
+         * @param height Define the height of the texture
+         * @param scene Define the scene the texture belongs to
+         * @param generateMipMaps Define whether or not to create mip maps for the texture
+         * @param invertY define if the data should be flipped on Y when uploaded to the GPU
+         * @param samplingMode define the texture sampling mode (Texture.xxx_SAMPLINGMODE)
+         * @returns the R texture
+         */
         public static CreateRTexture(data: ArrayBufferView, width: number, height: number, scene: Scene, generateMipMaps: boolean = true, invertY: boolean = false, samplingMode: number = Texture.TRILINEAR_SAMPLINGMODE, type: number = Engine.TEXTURETYPE_FLOAT): RawTexture {
             return new RawTexture(data, width, height, Engine.TEXTUREFORMAT_R, scene, generateMipMaps, invertY, samplingMode, type);
-        }        
+        }
     }
 }

+ 30 - 5
src/Materials/Textures/babylon.refractionTexture.ts

@@ -1,14 +1,31 @@
 module BABYLON {
     /**
-    * Creates a refraction texture used by refraction channel of the standard material.
-    * @param name the texture name
-    * @param size size of the underlying texture
-    * @param scene root scene
-    */
+     * Creates a refraction texture used by refraction channel of the standard material.
+     * It is like a mirror but to see through a material.
+     * @see https://doc.babylonjs.com/how_to/reflect#refraction
+     */
     export class RefractionTexture extends RenderTargetTexture {
+        /**
+         * Define the reflection plane we want to use. The refractionPlane is usually set to the constructed refractor. 
+         * It is possible to directly set the refractionPlane by directly using a BABYLON.Plane(a, b, c, d) where a, b and c give the plane normal vector (a, b, c) and d is a scalar displacement from the refractionPlane to the origin. However in all but the very simplest of situations it is more straight forward to set it to the refractor as stated in the doc.
+         * @see https://doc.babylonjs.com/how_to/reflect#refraction
+         */
         public refractionPlane = new Plane(0, 1, 0, 1);
+
+        /**
+         * Define how deep under the surface we should see.
+         */
         public depth = 2.0;
 
+        /**
+         * Creates a refraction texture used by refraction channel of the standard material.
+         * It is like a mirror but to see through a material.
+         * @see https://doc.babylonjs.com/how_to/reflect#refraction
+         * @param name Define the texture name
+         * @param size Define the size of the underlying texture
+         * @param scene Define the scene the refraction belongs to
+         * @param generateMipMaps Define if we need to generate mips level for the refraction
+         */
         constructor(name: string, size: number, scene: Scene, generateMipMaps?: boolean) {
             super(name, size, scene, generateMipMaps, true);
 
@@ -21,6 +38,10 @@
             });
         }
 
+        /**
+         * Clone the refraction texture.
+         * @returns the cloned texture
+         */
         public clone(): RefractionTexture {
             let scene = this.getScene();
 
@@ -45,6 +66,10 @@
             return newTexture;
         }
 
+        /**
+         * Serialize the texture to a JSON representation you could use in Parse later on
+         * @returns the serialized JSON representation
+         */
         public serialize(): any {
             if (!this.name) {
                 return null;

+ 8 - 2
src/Materials/Textures/babylon.renderTargetTexture.ts

@@ -324,15 +324,21 @@
             this._samples = scene.getEngine().updateRenderTargetTextureSampleCount(this._texture, value);
         }
 
+        /**
+         * Resets the refresh counter of the texture and start bak from scratch.
+         * Could be usefull to regenerate the texture if it is setup to render only once.
+         */
         public resetRefreshCounter(): void {
             this._currentRefreshId = -1;
         }
 
+        /**
+         * Define the refresh rate of the texture or the rendering frequency.
+         * Use 0 to render just once, 1 to render on every frame, 2 to render every two frames and so on...
+         */
         public get refreshRate(): number {
             return this._refreshRate;
         }
-
-        // Use 0 to render just once, 1 to render on every frame, 2 to render every two frames and so on...
         public set refreshRate(value: number) {
             this._refreshRate = value;
             this.resetRefreshCounter();

+ 21 - 1
src/Materials/Textures/babylon.videoTexture.ts

@@ -24,6 +24,11 @@
         poster?: string;
     }
 
+    /**
+     * If you want to display a video in your scene, this is the special texture for that. 
+     * This special texture works similar to other textures, with the exception of a few parameters.
+     * @see https://doc.babylonjs.com/how_to/video_texture
+     */
     export class VideoTexture extends Texture {
         /**
          * Tells whether textures will be updated automatically or user is required to call `updateTexture` manually
@@ -37,6 +42,10 @@
 
         private _onUserActionRequestedObservable: Nullable<Observable<Texture>> = null;
 
+        /**
+         * Event triggerd when a dom action is required by the user to play the video.
+         * This happens due to recent changes in browser policies preventing video to auto start.
+         */
         public get onUserActionRequestedObservable(): Observable<Texture> {
             if (!this._onUserActionRequestedObservable) {
                 this._onUserActionRequestedObservable = new Observable<Texture>();
@@ -51,7 +60,9 @@
 
         /**
          * Creates a video texture.
-         * Sample : https://doc.babylonjs.com/how_to/video_texture
+         * If you want to display a video in your scene, this is the special texture for that. 
+         * This special texture works similar to other textures, with the exception of a few parameters.
+         * @see https://doc.babylonjs.com/how_to/video_texture
          * @param {string | null} name optional name, will detect from video source, if not defined
          * @param {(string | string[] | HTMLVideoElement)} src can be used to provide an url, array of urls or an already setup HTML video element.
          * @param {BABYLON.Scene} scene is obviously the current scene.
@@ -279,6 +290,9 @@
             this.video.src = url;
         }
 
+        /**
+         * Dispose the texture and release its associated resources.
+         */
         public dispose(): void {
             super.dispose();
 
@@ -294,6 +308,12 @@
             this.video.pause();
         }
 
+        /**
+         * Creates a video texture straight from your WebCam video feed.
+         * @param scene Define the scene the texture should be created in
+         * @param onReady Define a callback to triggered once the texture will be ready
+         * @param constraints Define the constraints to use to create the web cam feed from WebRTC
+         */
         public static CreateFromWebCam(
             scene: Scene,
             onReady: (videoTexture: VideoTexture) => void,