Преглед изворни кода

Finished postprocesslibrary

David Catuhe пре 6 година
родитељ
комит
c8ac59b459
24 измењених фајлова са 24821 додато и 24322 уклоњено
  1. 15793 15623
      Playground/babylon.d.txt
  2. 25 24
      Tools/DevLoader/BabylonLoader.js
  3. 21 1
      Tools/Gulp/config.json
  4. 4 2
      Tools/Gulp/gulpfile.js
  5. 8479 8479
      dist/preview release/babylon.d.ts
  6. 0 171
      dist/preview release/postProcessLibrary/babylon.postProcessLibrary.module.d.ts
  7. 2 0
      dist/preview release/postProcessesLibrary/babylon.asciiArtpostProcess.js
  8. 2 0
      dist/preview release/postProcessesLibrary/babylon.asciiArtpostProcess.min.js
  9. 1 0
      dist/preview release/postProcessesLibrary/babylon.asciiArtpostProcess.min.js.map
  10. 2 0
      dist/preview release/postProcessesLibrary/babylon.digitalRainPostProcess.js
  11. 2 0
      dist/preview release/postProcessesLibrary/babylon.digitalRainPostProcess.min.js
  12. 1 0
      dist/preview release/postProcessesLibrary/babylon.digitalRainPostProcess.min.js.map
  13. 1 1
      dist/preview release/postProcessesLibrary/babylon.postProcesses.d.ts
  14. 1 1
      dist/preview release/postProcessesLibrary/babylon.postProcesses.min.js.map
  15. 2 2
      dist/preview release/postProcessesLibrary/babylon.postProcesses.module.d.ts
  16. 159 2
      dist/preview release/viewer/babylon.viewer.d.ts
  17. 163 1
      dist/preview release/viewer/babylon.viewer.module.d.ts
  18. 15 0
      postProcessLibrary/legacy/legacy-asciiArt.ts
  19. 15 0
      postProcessLibrary/legacy/legacy-digitalRain.ts
  20. 58 0
      postProcessLibrary/legacy/webpack.asciiArt.config.js
  21. 58 0
      postProcessLibrary/legacy/webpack.digitalRain.config.js
  22. 0 1
      postProcessLibrary/src/legacy.ts
  23. 1 1
      postProcessLibrary/tsconfig.json
  24. 16 13
      tests/validation/validate.html

Разлика између датотеке није приказан због своје велике величине
+ 15793 - 15623
Playground/babylon.d.txt


+ 25 - 24
Tools/DevLoader/BabylonLoader.js

@@ -1,12 +1,12 @@
 // Old Fashion Way for IE 11 Devs. Yes, that still exists ;-)
 
 var BABYLONDEVTOOLS;
-(function (BABYLONDEVTOOLS) {
+(function(BABYLONDEVTOOLS) {
 
-    var getJson = function (url, callback, errorCallback) {
+    var getJson = function(url, callback, errorCallback) {
         var xhr = new XMLHttpRequest();
         xhr.open('GET', url);
-        xhr.onload = function () {
+        xhr.onload = function() {
             if (this.status >= 200 && this.status < 300) {
                 var data = JSON.parse(xhr.response);
                 callback(data)
@@ -17,7 +17,7 @@ var BABYLONDEVTOOLS;
                 });
             }
         };
-        xhr.onerror = function () {
+        xhr.onerror = function() {
             errorCallback({
                 status: this.status,
                 statusText: xhr.statusText
@@ -26,7 +26,7 @@ var BABYLONDEVTOOLS;
         xhr.send();
     }
 
-    var Loader = (function () {
+    var Loader = (function() {
         var queue;
         var callback;
         var dependencies;
@@ -43,10 +43,10 @@ var BABYLONDEVTOOLS;
             babylonJSPath = '';
         }
 
-        Loader.prototype.debugShortcut = function (engine) {
+        Loader.prototype.debugShortcut = function(engine) {
             // Add inspector shortcut
             var map = {};
-            var onkey = function (e) {
+            var onkey = function(e) {
                 e = e || event; // to deal with IE
                 map[e.keyCode] = e.type == 'keydown';
                 if (map[17] && map[16] && map[18] && map[73]) {
@@ -69,12 +69,12 @@ var BABYLONDEVTOOLS;
             document.addEventListener("keyup", onkey);
         }
 
-        Loader.prototype.root = function (newBabylonJSPath) {
+        Loader.prototype.root = function(newBabylonJSPath) {
             babylonJSPath = newBabylonJSPath;
             return this;
         }
 
-        Loader.prototype.require = function (newDependencies) {
+        Loader.prototype.require = function(newDependencies) {
             if (typeof newDependencies === 'string') {
                 dependencies.push(newDependencies);
             }
@@ -86,17 +86,17 @@ var BABYLONDEVTOOLS;
             return this;
         }
 
-        Loader.prototype.onReady = function (newCallback) {
+        Loader.prototype.onReady = function(newCallback) {
             callback = newCallback;
             return this;
         }
 
-        Loader.prototype.useDist = function () {
+        Loader.prototype.useDist = function() {
             useDist = true;
             return this;
         }
 
-        Loader.prototype.dequeue = function () {
+        Loader.prototype.dequeue = function() {
             if (queue.length == 0) {
                 console.log('Scripts loaded');
                 BABYLON.Engine.ShadersRepository = "/src/Shaders/";
@@ -114,17 +114,17 @@ var BABYLONDEVTOOLS;
             script.src = url;
 
             var self = this;
-            script.onload = function () {
+            script.onload = function() {
                 self.dequeue();
             };
             head.appendChild(script);
         }
 
-        Loader.prototype.loadScript = function (url) {
+        Loader.prototype.loadScript = function(url) {
             queue.push(url);
         }
 
-        Loader.prototype.loadCss = function (url) {
+        Loader.prototype.loadCss = function(url) {
             var head = document.getElementsByTagName('head')[0];
 
             var style = document.createElement('link');
@@ -134,20 +134,21 @@ var BABYLONDEVTOOLS;
             document.head.appendChild(style);
         }
 
-        Loader.prototype.loadScripts = function (urls) {
+        Loader.prototype.loadScripts = function(urls) {
             for (var i = 0; i < urls.length; i++) {
                 this.loadScript(urls[i]);
             }
         }
 
-        Loader.prototype.loadLibrary = function (library, module) {
+        Loader.prototype.loadLibrary = function(library, module) {
             if (library.preventLoadLibrary) {
                 return;
             }
 
             if (!useDist) {
                 if (library.useOutputForDebugging) {
-                    this.loadScript(babylonJSPath + '/.temp' + module.build.distOutputDirectory + library.output);
+                    var tempDirectory = '/.temp' + module.build.distOutputDirectory;
+                    this.loadScript(babylonJSPath + tempDirectory + library.output);
                 } else {
                     var i = 0;
                     for (; i < library.files.length; i++) {
@@ -201,13 +202,13 @@ var BABYLONDEVTOOLS;
             }
         }
 
-        Loader.prototype.loadModule = function (module) {
+        Loader.prototype.loadModule = function(module) {
             for (var i = 0; i < module.libraries.length; i++) {
                 this.loadLibrary(module.libraries[i], module);
             }
         }
 
-        Loader.prototype.processDependency = function (settings, dependency, filesToLoad) {
+        Loader.prototype.processDependency = function(settings, dependency, filesToLoad) {
             if (dependency.dependUpon) {
                 for (var i = 0; i < dependency.dependUpon.length; i++) {
                     var dependencyName = dependency.dependUpon[i];
@@ -225,7 +226,7 @@ var BABYLONDEVTOOLS;
             }
         }
 
-        Loader.prototype.loadBJSScripts = function (settings) {
+        Loader.prototype.loadBJSScripts = function(settings) {
             var loadModules = true;
 
             // Main bjs files
@@ -262,13 +263,13 @@ var BABYLONDEVTOOLS;
             }
         }
 
-        Loader.prototype.load = function (newCallback) {
+        Loader.prototype.load = function(newCallback) {
             var self = this;
             if (newCallback) {
                 callback = newCallback;
             }
             getJson('/Tools/Gulp/config.json',
-                function (data) {
+                function(data) {
                     if (!min) {
                         self.loadScript('/dist/preview release/split.js');
                     }
@@ -280,7 +281,7 @@ var BABYLONDEVTOOLS;
 
                     self.dequeue();
                 },
-                function (reason) {
+                function(reason) {
                     console.error(reason);
                 }
             );

+ 21 - 1
Tools/Gulp/config.json

@@ -15,7 +15,8 @@
             "../../dist/preview release/gui/babylon.gui.d.ts",
             "../../dist/preview release/loaders/babylon.glTF2FileLoader.d.ts",
             "../../dist/preview release/serializers/babylon.glTF2Serializer.d.ts",
-            "../../dist/preview release/glTF2Interface/babylon.glTF2Interface.d.ts"
+            "../../dist/preview release/glTF2Interface/babylon.glTF2Interface.d.ts",
+            "../../dist/preview release/postProcessesLibrary/babylon.postProcesses.d.ts"
         ],
         "outputCustomConfigurationsDirectory": "../../dist/preview release/customConfigurations",
         "srcOutputDirectory": "../../src/",
@@ -1641,6 +1642,25 @@
                 "webpack": "../../postProcessLibrary/webpack.config.js",
                 "bundle": "true",
                 "babylonIncluded": false,
+                "useOutputForDebugging": true,
+                "preventLoadLibrary": true
+            },
+            {
+                "files": [],
+                "noBundleInName": true,
+                "output": "babylon.asciiArtPostProcess.min.js",
+                "webpack": "../../postProcessLibrary/legacy/webpack.asciiArt.config.js",
+                "bundle": "true",
+                "babylonIncluded": false,
+                "useOutputForDebugging": true
+            },
+            {
+                "files": [],
+                "noBundleInName": true,
+                "output": "babylon.digitalRainPostProcess.min.js",
+                "webpack": "../../postProcessLibrary/legacy/webpack.digitalRain.config.js",
+                "bundle": "true",
+                "babylonIncluded": false,
                 "useOutputForDebugging": true
             }
         ],

+ 4 - 2
Tools/Gulp/gulpfile.js

@@ -599,6 +599,7 @@ var buildExternalLibrary = function(library, settings, watch) {
                     if (!out.minified) {
                         wpConfig.mode = "development";
                     }
+
                     let wpBuild = webpackStream(wpConfig, require("webpack"));
 
                     //shoud dtsBundle create the declaration?
@@ -669,8 +670,9 @@ var buildExternalLibrary = function(library, settings, watch) {
 
                 });
             } else {
+                var wpConfig = require(library.webpack);
 
-                let wpBuild = webpackStream(require(library.webpack), webpack);
+                let wpBuild = webpackStream(wpConfig, webpack);
 
                 let buildEvent = wpBuild
                     .pipe(gulp.dest(outputDirectory))
@@ -698,7 +700,7 @@ var buildExternalLibrary = function(library, settings, watch) {
                             fs.readFile(fileLocation, function(err, data) {
                                 if (err) throw err;
 
-                                // For Raanan,litera litteral import hack TO BETTER INTEGRATE
+                                // For Raanan, litteral import hack TO BETTER INTEGRATE
                                 data = data + "";
                                 data = data.replace('import "../sass/main.scss";', "");
 

Разлика између датотеке није приказан због своје велике величине
+ 8479 - 8479
dist/preview release/babylon.d.ts


+ 0 - 171
dist/preview release/postProcessLibrary/babylon.postProcessLibrary.module.d.ts

@@ -1,171 +0,0 @@
-/*BabylonJS Postprocess library*/
-// Dependencies for this module:
-//   ../../../../tools/gulp/babylonjs
-
-export * from "babylonjs-postProcessLibrary/--/--/postProcessesLibrary/build/asciiArt";
-export * from "babylonjs-postProcessLibrary/--/--/postProcessesLibrary/build/digitalRain";
-
-export * from "babylonjs-postProcessLibrary/--/--/postProcessesLibrary/build/asciiArt/asciiArtPostProcess";
-
-export * from "babylonjs-postProcessLibrary/--/--/postProcessesLibrary/build/digitalRain/digitalRainPostProcess";
-
-import { BaseTexture, Nullable, Scene, PostProcess, Camera } from "babylonjs";
-/**
-    * AsciiArtFontTexture is the helper class used to easily create your ascii art font texture.
-    *
-    * It basically takes care rendering the font front the given font size to a texture.
-    * This is used later on in the postprocess.
-    */
-export declare class AsciiArtFontTexture extends BaseTexture {
-        /**
-            * Gets the size of one char in the texture (each char fits in size * size space in the texture).
-            */
-        readonly charSize: number;
-        /**
-            * Create a new instance of the Ascii Art FontTexture class
-            * @param name the name of the texture
-            * @param font the font to use, use the W3C CSS notation
-            * @param text the caracter set to use in the rendering.
-            * @param scene the scene that owns the texture
-            */
-        constructor(name: string, font: string, text: string, scene?: Nullable<Scene>);
-        /**
-            * Clones the current AsciiArtTexture.
-            * @return the clone of the texture.
-            */
-        clone(): AsciiArtFontTexture;
-        /**
-            * Parses a json object representing the texture and returns an instance of it.
-            * @param source the source JSON representation
-            * @param scene the scene to create the texture for
-            * @return the parsed texture
-            */
-        static Parse(source: any, scene: Scene): AsciiArtFontTexture;
-}
-/**
-    * Option available in the Ascii Art Post Process.
-    */
-export interface IAsciiArtPostProcessOptions {
-        /**
-            * The font to use following the w3c font definition.
-            */
-        font?: string;
-        /**
-            * The character set to use in the postprocess.
-            */
-        characterSet?: string;
-        /**
-            * This defines the amount you want to mix the "tile" or caracter space colored in the ascii art.
-            * This number is defined between 0 and 1;
-            */
-        mixToTile?: number;
-        /**
-            * This defines the amount you want to mix the normal rendering pass in the ascii art.
-            * This number is defined between 0 and 1;
-            */
-        mixToNormal?: number;
-}
-/**
-    * AsciiArtPostProcess helps rendering everithing in Ascii Art.
-    *
-    * Simmply add it to your scene and let the nerd that lives in you have fun.
-    * Example usage: var pp = new AsciiArtPostProcess("myAscii", "20px Monospace", camera);
-    */
-export declare class AsciiArtPostProcess extends PostProcess {
-        /**
-            * This defines the amount you want to mix the "tile" or caracter space colored in the ascii art.
-            * This number is defined between 0 and 1;
-            */
-        mixToTile: number;
-        /**
-            * This defines the amount you want to mix the normal rendering pass in the ascii art.
-            * This number is defined between 0 and 1;
-            */
-        mixToNormal: number;
-        /**
-            * Instantiates a new Ascii Art Post Process.
-            * @param name the name to give to the postprocess
-            * @camera the camera to apply the post process to.
-            * @param options can either be the font name or an option object following the IAsciiArtPostProcessOptions format
-            */
-        constructor(name: string, camera: Camera, options?: string | IAsciiArtPostProcessOptions);
-}
-
-import { BaseTexture, Nullable, Scene, PostProcess, Camera } from "babylonjs";
-/**
-    * DigitalRainFontTexture is the helper class used to easily create your digital rain font texture.
-    *
-    * It basically takes care rendering the font front the given font size to a texture.
-    * This is used later on in the postprocess.
-    */
-export declare class DigitalRainFontTexture extends BaseTexture {
-        /**
-            * Gets the size of one char in the texture (each char fits in size * size space in the texture).
-            */
-        readonly charSize: number;
-        /**
-            * Create a new instance of the Digital Rain FontTexture class
-            * @param name the name of the texture
-            * @param font the font to use, use the W3C CSS notation
-            * @param text the caracter set to use in the rendering.
-            * @param scene the scene that owns the texture
-            */
-        constructor(name: string, font: string, text: string, scene?: Nullable<Scene>);
-        /**
-            * Clones the current DigitalRainFontTexture.
-            * @return the clone of the texture.
-            */
-        clone(): DigitalRainFontTexture;
-        /**
-            * Parses a json object representing the texture and returns an instance of it.
-            * @param source the source JSON representation
-            * @param scene the scene to create the texture for
-            * @return the parsed texture
-            */
-        static Parse(source: any, scene: Scene): DigitalRainFontTexture;
-}
-/**
-    * Option available in the Digital Rain Post Process.
-    */
-export interface IDigitalRainPostProcessOptions {
-        /**
-            * The font to use following the w3c font definition.
-            */
-        font?: string;
-        /**
-            * This defines the amount you want to mix the "tile" or caracter space colored in the digital rain.
-            * This number is defined between 0 and 1;
-            */
-        mixToTile?: number;
-        /**
-            * This defines the amount you want to mix the normal rendering pass in the digital rain.
-            * This number is defined between 0 and 1;
-            */
-        mixToNormal?: number;
-}
-/**
-    * DigitalRainPostProcess helps rendering everithing in digital rain.
-    *
-    * Simmply add it to your scene and let the nerd that lives in you have fun.
-    * Example usage: var pp = new DigitalRainPostProcess("digitalRain", "20px Monospace", camera);
-    */
-export declare class DigitalRainPostProcess extends PostProcess {
-        /**
-            * This defines the amount you want to mix the "tile" or caracter space colored in the digital rain.
-            * This number is defined between 0 and 1;
-            */
-        mixToTile: number;
-        /**
-            * This defines the amount you want to mix the normal rendering pass in the digital rain.
-            * This number is defined between 0 and 1;
-            */
-        mixToNormal: number;
-        /**
-            * Instantiates a new Digital Rain Post Process.
-            * @param name the name to give to the postprocess
-            * @camera the camera to apply the post process to.
-            * @param options can either be the font name or an option object following the IDigitalRainPostProcessOptions format
-            */
-        constructor(name: string, camera: Camera, options?: string | IDigitalRainPostProcessOptions);
-}
-

Разлика између датотеке није приказан због своје велике величине
+ 2 - 0
dist/preview release/postProcessesLibrary/babylon.asciiArtpostProcess.js


Разлика између датотеке није приказан због своје велике величине
+ 2 - 0
dist/preview release/postProcessesLibrary/babylon.asciiArtpostProcess.min.js


Разлика између датотеке није приказан због своје велике величине
+ 1 - 0
dist/preview release/postProcessesLibrary/babylon.asciiArtpostProcess.min.js.map


Разлика између датотеке није приказан због своје велике величине
+ 2 - 0
dist/preview release/postProcessesLibrary/babylon.digitalRainPostProcess.js


Разлика између датотеке није приказан због своје велике величине
+ 2 - 0
dist/preview release/postProcessesLibrary/babylon.digitalRainPostProcess.min.js


Разлика између датотеке није приказан због своје велике величине
+ 1 - 0
dist/preview release/postProcessesLibrary/babylon.digitalRainPostProcess.min.js.map


+ 1 - 1
dist/preview release/postProcessesLibrary/babylon.postProcesses.d.ts

@@ -1,6 +1,6 @@
 /*BabylonJS Postprocess library*/
 // Dependencies for this module:
-//   ../../../../tools/gulp/babylonjs
+//   ../../../../Tools/Gulp/babylonjs
 declare module BABYLON {
 }
 declare module BABYLON {

Разлика између датотеке није приказан због своје велике величине
+ 1 - 1
dist/preview release/postProcessesLibrary/babylon.postProcesses.min.js.map


+ 2 - 2
dist/preview release/postProcessesLibrary/babylon.postProcesses.module.d.ts

@@ -1,6 +1,6 @@
 /*BabylonJS Postprocess library*/
 // Dependencies for this module:
-//   ../../../../tools/gulp/babylonjs
+//   ../../../../Tools/Gulp/babylonjs
 
 declare module 'babylonjs-postProcessLibrary' {
     export * from "babylonjs-postProcessLibrary/asciiArt";
@@ -182,7 +182,7 @@ declare module 'babylonjs-postProcessLibrary/digitalRain/digitalRainPostProcess'
 
 /*BabylonJS Postprocess library*/
 // Dependencies for this module:
-//   ../../../../tools/gulp/babylonjs
+//   ../../../../Tools/Gulp/babylonjs
 declare module BABYLON {
 }
 declare module BABYLON {

+ 159 - 2
dist/preview release/viewer/babylon.viewer.d.ts

@@ -515,10 +515,167 @@ declare module BabylonViewer {
     }
 }
 declare module BabylonViewer {
+    /**
+        * The current state of the model
+        */
+    export enum ModelState {
+            INIT = 0,
+            LOADING = 1,
+            LOADED = 2,
+            ENTRY = 3,
+            ENTRYDONE = 4,
+            COMPLETE = 5,
+            CANCELED = 6,
+            ERROR = 7
+    }
+    /**
+        * The viewer model is a container for all assets representing a sngle loaded model.
+        */
+    export class ViewerModel implements BABYLON.IDisposable {
+            /**
+                * The loader used to load this model.
+                */
+            loader: BABYLON.ISceneLoaderPlugin | BABYLON.ISceneLoaderPluginAsync;
+            /**
+                * This model's root mesh (the parent of all other meshes).
+                * This mesh does not(!) exist in the meshes array.
+                */
+            rootMesh: BABYLON.AbstractMesh;
+            /**
+                * ParticleSystems connected to this model
+                */
+            particleSystems: Array<BABYLON.IParticleSystem>;
+            /**
+                * Skeletons defined in this model
+                */
+            skeletons: Array<BABYLON.Skeleton>;
+            /**
+                * The current model animation.
+                * On init, this will be undefined.
+                */
+            currentAnimation: IModelAnimation;
+            /**
+                * Observers registered here will be executed when the model is done loading
+                */
+            onLoadedObservable: BABYLON.Observable<ViewerModel>;
+            /**
+                * Observers registered here will be executed when the loader notified of a progress event
+                */
+            onLoadProgressObservable: BABYLON.Observable<BABYLON.SceneLoaderProgressEvent>;
+            /**
+                * Observers registered here will be executed when the loader notified of an error.
+                */
+            onLoadErrorObservable: BABYLON.Observable<{
+                    message: string;
+                    exception: any;
+            }>;
+            /**
+                * Will be executed after the model finished loading and complete, including entry animation and lod
+                */
+            onCompleteObservable: BABYLON.Observable<ViewerModel>;
+            /**
+                * Observers registered here will be executed every time the model is being configured.
+                * This can be used to extend the model's configuration without extending the class itself
+                */
+            onAfterConfigure: BABYLON.Observable<ViewerModel>;
+            /**
+                * The current model state (loaded, error, etc)
+                */
+            state: ModelState;
+            /**
+                * A loadID provided by the modelLoader, unique to ths (Abstract)Viewer instance.
+                */
+            loadId: number;
+            loadInfo: BABYLON.GLTF2.IAsset;
+            constructor(_observablesManager: ObservablesManager, modelConfiguration: IModelConfiguration, _configurationContainer?: ConfigurationContainer | undefined);
+            shadowsRenderedAfterLoad: boolean;
+            getViewerId(): string | undefined;
+            /**
+             * Set whether this model is enabled or not.
+             */
+            enabled: boolean;
+            loaderDone: boolean;
+            /**
+                * Add a mesh to this model.
+                * Any mesh that has no parent will be provided with the root mesh as its new parent.
+                *
+                * @param mesh the new mesh to add
+                * @param triggerLoaded should this mesh trigger the onLoaded observable. Used when adding meshes manually.
+                */
+            addMesh(mesh: BABYLON.AbstractMesh, triggerLoaded?: boolean): Promise<ViewerModel> | undefined;
+            /**
+                * get the list of meshes (excluding the root mesh)
+                */
+            readonly meshes: BABYLON.AbstractMesh[];
+            /**
+             * (Re-)set the model's entire configuration
+             * @param newConfiguration the new configuration to replace the new one
+             */
+            configuration: IModelConfiguration;
+            /**
+                * Update the current configuration with new values.
+                * Configuration will not be overwritten, but merged with the new configuration.
+                * Priority is to the new configuration
+                * @param newConfiguration the configuration to be merged into the current configuration;
+                */
+            updateConfiguration(newConfiguration: Partial<IModelConfiguration>): void;
+            /**
+                * Add a new animation group to this model.
+                * @param animationGroup the new animation group to be added
+                */
+            addAnimationGroup(animationGroup: BABYLON.AnimationGroup): void;
+            /**
+                * Get the ModelAnimation array
+                */
+            getAnimations(): Array<IModelAnimation>;
+            /**
+                * Get the animations' names. Using the names you can play a specific animation.
+                */
+            getAnimationNames(): Array<string>;
+            /**
+                * Get an animation by the provided name. Used mainly when playing n animation.
+                * @param name the name of the animation to find
+                */
+            protected _getAnimationByName(name: string): BABYLON.Nullable<IModelAnimation>;
+            /**
+                * Choose an initialized animation using its name and start playing it
+                * @param name the name of the animation to play
+                * @returns The model aniamtion to be played.
+                */
+            playAnimation(name: string): IModelAnimation;
+            setCurrentAnimationByName(name: string): IModelAnimation;
+            /**
+                * Apply a material configuration to a material
+                * @param material BABYLON.Material to apply configuration to
+                * @hidden
+                */
+            _applyModelMaterialConfiguration(material: BABYLON.Material): void;
+            /**
+             * Begin @animations with the specified @easingFunction
+             * @param animations The BABYLON Animations to begin
+             * @param duration of transition, in seconds
+             * @param easingFunction An easing function to apply
+             * @param easingMode A easing mode to apply to the easingFunction
+             * @param onAnimationEnd Call back trigger at the end of the animation.
+             */
+            transitionTo(animations: BABYLON.Animation[], duration: number, easingFunction: any, easingMode: number | undefined, onAnimationEnd: () => void): void;
+            /**
+                * Stops and removes all animations that have been applied to the model
+                */
+            stopAllAnimations(): void;
+            /**
+                * Will remove this model from the viewer (but NOT dispose it).
+                */
+            remove(): void;
+            /**
+                * Dispose this model, including all of its associated assets.
+                */
+            dispose(): void;
+    }
 }
 declare module BabylonViewer {
     /**
-        * Animation play mode enum - is the animation looping or playing once
+        * BABYLON.Animation play mode enum - is the animation looping or playing once
         */
     export const enum AnimationPlayMode {
             ONCE = 0,
@@ -600,7 +757,7 @@ declare module BabylonViewer {
                 */
             readonly currentFrame: number;
             /**
-                * Animation's FPS value
+                * BABYLON.Animation's FPS value
                 */
             readonly fps: number;
             /**

+ 163 - 1
dist/preview release/viewer/babylon.viewer.module.d.ts

@@ -566,7 +566,169 @@ declare module 'babylonjs-viewer/loader/modelLoader' {
 }
 
 declare module 'babylonjs-viewer/model/viewerModel' {
-    
+    import { ISceneLoaderPlugin, ISceneLoaderPluginAsync, AnimationGroup, AbstractMesh, Observable, SceneLoaderProgressEvent, IParticleSystem, Skeleton, IDisposable, Nullable, Animation, Material } from "babylonjs";
+    import { GLTF2 } from "babylonjs-loaders";
+    import { IModelConfiguration } from "babylonjs-viewer/configuration/interfaces/modelConfiguration";
+    import { IModelAnimation } from "babylonjs-viewer/model/modelAnimation";
+    import { ObservablesManager } from "babylonjs-viewer/managers/observablesManager";
+    import { ConfigurationContainer } from "babylonjs-viewer/configuration/configurationContainer";
+    /**
+        * The current state of the model
+        */
+    export enum ModelState {
+            INIT = 0,
+            LOADING = 1,
+            LOADED = 2,
+            ENTRY = 3,
+            ENTRYDONE = 4,
+            COMPLETE = 5,
+            CANCELED = 6,
+            ERROR = 7
+    }
+    /**
+        * The viewer model is a container for all assets representing a sngle loaded model.
+        */
+    export class ViewerModel implements IDisposable {
+            /**
+                * The loader used to load this model.
+                */
+            loader: ISceneLoaderPlugin | ISceneLoaderPluginAsync;
+            /**
+                * This model's root mesh (the parent of all other meshes).
+                * This mesh does not(!) exist in the meshes array.
+                */
+            rootMesh: AbstractMesh;
+            /**
+                * ParticleSystems connected to this model
+                */
+            particleSystems: Array<IParticleSystem>;
+            /**
+                * Skeletons defined in this model
+                */
+            skeletons: Array<Skeleton>;
+            /**
+                * The current model animation.
+                * On init, this will be undefined.
+                */
+            currentAnimation: IModelAnimation;
+            /**
+                * Observers registered here will be executed when the model is done loading
+                */
+            onLoadedObservable: Observable<ViewerModel>;
+            /**
+                * Observers registered here will be executed when the loader notified of a progress event
+                */
+            onLoadProgressObservable: Observable<SceneLoaderProgressEvent>;
+            /**
+                * Observers registered here will be executed when the loader notified of an error.
+                */
+            onLoadErrorObservable: Observable<{
+                    message: string;
+                    exception: any;
+            }>;
+            /**
+                * Will be executed after the model finished loading and complete, including entry animation and lod
+                */
+            onCompleteObservable: Observable<ViewerModel>;
+            /**
+                * Observers registered here will be executed every time the model is being configured.
+                * This can be used to extend the model's configuration without extending the class itself
+                */
+            onAfterConfigure: Observable<ViewerModel>;
+            /**
+                * The current model state (loaded, error, etc)
+                */
+            state: ModelState;
+            /**
+                * A loadID provided by the modelLoader, unique to ths (Abstract)Viewer instance.
+                */
+            loadId: number;
+            loadInfo: GLTF2.IAsset;
+            constructor(_observablesManager: ObservablesManager, modelConfiguration: IModelConfiguration, _configurationContainer?: ConfigurationContainer | undefined);
+            shadowsRenderedAfterLoad: boolean;
+            getViewerId(): string | undefined;
+            /**
+             * Set whether this model is enabled or not.
+             */
+            enabled: boolean;
+            loaderDone: boolean;
+            /**
+                * Add a mesh to this model.
+                * Any mesh that has no parent will be provided with the root mesh as its new parent.
+                *
+                * @param mesh the new mesh to add
+                * @param triggerLoaded should this mesh trigger the onLoaded observable. Used when adding meshes manually.
+                */
+            addMesh(mesh: AbstractMesh, triggerLoaded?: boolean): Promise<ViewerModel> | undefined;
+            /**
+                * get the list of meshes (excluding the root mesh)
+                */
+            readonly meshes: AbstractMesh[];
+            /**
+             * (Re-)set the model's entire configuration
+             * @param newConfiguration the new configuration to replace the new one
+             */
+            configuration: IModelConfiguration;
+            /**
+                * Update the current configuration with new values.
+                * Configuration will not be overwritten, but merged with the new configuration.
+                * Priority is to the new configuration
+                * @param newConfiguration the configuration to be merged into the current configuration;
+                */
+            updateConfiguration(newConfiguration: Partial<IModelConfiguration>): void;
+            /**
+                * Add a new animation group to this model.
+                * @param animationGroup the new animation group to be added
+                */
+            addAnimationGroup(animationGroup: AnimationGroup): void;
+            /**
+                * Get the ModelAnimation array
+                */
+            getAnimations(): Array<IModelAnimation>;
+            /**
+                * Get the animations' names. Using the names you can play a specific animation.
+                */
+            getAnimationNames(): Array<string>;
+            /**
+                * Get an animation by the provided name. Used mainly when playing n animation.
+                * @param name the name of the animation to find
+                */
+            protected _getAnimationByName(name: string): Nullable<IModelAnimation>;
+            /**
+                * Choose an initialized animation using its name and start playing it
+                * @param name the name of the animation to play
+                * @returns The model aniamtion to be played.
+                */
+            playAnimation(name: string): IModelAnimation;
+            setCurrentAnimationByName(name: string): IModelAnimation;
+            /**
+                * Apply a material configuration to a material
+                * @param material Material to apply configuration to
+                * @hidden
+                */
+            _applyModelMaterialConfiguration(material: Material): void;
+            /**
+             * Begin @animations with the specified @easingFunction
+             * @param animations The BABYLON Animations to begin
+             * @param duration of transition, in seconds
+             * @param easingFunction An easing function to apply
+             * @param easingMode A easing mode to apply to the easingFunction
+             * @param onAnimationEnd Call back trigger at the end of the animation.
+             */
+            transitionTo(animations: Animation[], duration: number, easingFunction: any, easingMode: number | undefined, onAnimationEnd: () => void): void;
+            /**
+                * Stops and removes all animations that have been applied to the model
+                */
+            stopAllAnimations(): void;
+            /**
+                * Will remove this model from the viewer (but NOT dispose it).
+                */
+            remove(): void;
+            /**
+                * Dispose this model, including all of its associated assets.
+                */
+            dispose(): void;
+    }
 }
 
 declare module 'babylonjs-viewer/model/modelAnimation' {

+ 15 - 0
postProcessLibrary/legacy/legacy-asciiArt.ts

@@ -0,0 +1,15 @@
+import * as postProcessLibrary from "../src/asciiArt/index";
+
+/**
+ *
+ * This is the entry point for the UMD module.
+ * The entry point for a future ESM package should be index.ts
+ */
+var globalObject = (typeof global !== 'undefined') ? global : ((typeof window !== 'undefined') ? window : undefined);
+if (typeof globalObject !== "undefined") {
+    for (var key in postProcessLibrary) {
+        (<any>globalObject).BABYLON[key] = (<any>postProcessLibrary)[key];
+    }
+}
+
+export * from "../src/asciiArt/index";

+ 15 - 0
postProcessLibrary/legacy/legacy-digitalRain.ts

@@ -0,0 +1,15 @@
+import * as postProcessLibrary from "../src/digitalRain/index"
+
+/**
+ *
+ * This is the entry point for the UMD module.
+ * The entry point for a future ESM package should be index.ts
+ */
+var globalObject = (typeof global !== 'undefined') ? global : ((typeof window !== 'undefined') ? window : undefined);
+if (typeof globalObject !== "undefined") {
+    for (var key in postProcessLibrary) {
+        (<any>globalObject).BABYLON[key] = (<any>postProcessLibrary)[key];
+    }
+}
+
+export * from "../src/digitalRain/index";

+ 58 - 0
postProcessLibrary/legacy/webpack.asciiArt.config.js

@@ -0,0 +1,58 @@
+const path = require('path');
+const webpack = require('webpack');
+const DtsBundleWebpack = require('dts-bundle-webpack');
+const CleanWebpackPlugin = require('clean-webpack-plugin');
+
+module.exports = {
+    context: __dirname,
+    entry: {
+        'babylonjs-postProcessesLibrary': path.resolve(__dirname, './legacy-asciiArt.ts'),
+    },
+    output: {
+        path: path.resolve(__dirname, '../dist/preview release/postProcessesLibrary'),
+        filename: 'babylon.asciiArtPostProcess.min.js',
+        libraryTarget: 'umd',
+        library: {
+            root: ["POSTPROCESSLIBRARY"],
+            amd: "babylonjs-postProcessesLibrary",
+            commonjs: "babylonjs-postProcessesLibrary"
+        },
+        umdNamedDefine: true
+    },
+    resolve: {
+        extensions: [".js", '.ts']
+    },
+    externals: {
+        babylonjs: {
+            root: "BABYLON",
+            commonjs: "babylonjs",
+            commonjs2: "babylonjs",
+            amd: "babylonjs"
+        }
+    },
+    devtool: "source-map",
+    module: {
+        rules: [{
+            test: /\.tsx?$/,
+            loader: "ts-loader",
+            exclude: /node_modules/
+        },
+        {
+            test: /\.fx$/,
+            use: [{
+                loader: path.resolve(__dirname, '../../Tools/WebpackShaderLoader/index.js')
+            }]
+        }]
+    },
+    mode: "production",
+    plugins: [
+        new CleanWebpackPlugin([
+            path.resolve(__dirname, './src/**/*.js'),
+            path.resolve(__dirname, './src/**/*.map')
+        ]),
+        new webpack.WatchIgnorePlugin([
+            /\.js$/,
+            /\.d\.ts$/
+        ])
+    ]
+}

+ 58 - 0
postProcessLibrary/legacy/webpack.digitalRain.config.js

@@ -0,0 +1,58 @@
+const path = require('path');
+const webpack = require('webpack');
+const DtsBundleWebpack = require('dts-bundle-webpack');
+const CleanWebpackPlugin = require('clean-webpack-plugin');
+
+module.exports = {
+    context: __dirname,
+    entry: {
+        'babylonjs-postProcessesLibrary': path.resolve(__dirname, './legacy-digitalRain.ts'),
+    },
+    output: {
+        path: path.resolve(__dirname, '../dist/preview release/postProcessesLibrary'),
+        filename: 'babylon.digitalRainPostProcess.min.js',
+        libraryTarget: 'umd',
+        library: {
+            root: ["POSTPROCESSLIBRARY"],
+            amd: "babylonjs-postProcessesLibrary",
+            commonjs: "babylonjs-postProcessesLibrary"
+        },
+        umdNamedDefine: true
+    },
+    resolve: {
+        extensions: [".js", '.ts']
+    },
+    externals: {
+        babylonjs: {
+            root: "BABYLON",
+            commonjs: "babylonjs",
+            commonjs2: "babylonjs",
+            amd: "babylonjs"
+        }
+    },
+    devtool: "source-map",
+    module: {
+        rules: [{
+            test: /\.tsx?$/,
+            loader: "ts-loader",
+            exclude: /node_modules/
+        },
+        {
+            test: /\.fx$/,
+            use: [{
+                loader: path.resolve(__dirname, '../../Tools/WebpackShaderLoader/index.js')
+            }]
+        }]
+    },
+    mode: "production",
+    plugins: [
+        new CleanWebpackPlugin([
+            path.resolve(__dirname, './src/**/*.js'),
+            path.resolve(__dirname, './src/**/*.map')
+        ]),
+        new webpack.WatchIgnorePlugin([
+            /\.js$/,
+            /\.d\.ts$/
+        ])
+    ]
+}

+ 0 - 1
postProcessLibrary/src/legacy.ts

@@ -1,7 +1,6 @@
 import * as postProcessLibrary from "./index";
 
 /**
- * Legacy support, defining window.BABYLON.GUI (global variable).
  *
  * This is the entry point for the UMD module.
  * The entry point for a future ESM package should be index.ts

+ 1 - 1
postProcessLibrary/tsconfig.json

@@ -20,7 +20,7 @@
     "skipDefaultLibCheck": true,
     "skipLibCheck": true,
     "baseUrl": "./src/",
-    "rootDir": "./src/",
+    "rootDir": "./",
     "paths": {
       "babylonjs": [
         "../../dist/preview release/babylon.d.ts"

+ 16 - 13
tests/validation/validate.html

@@ -1,21 +1,23 @@
 <!DOCTYPE html>
 <html>
+
 <head>
 	<title>BabylonJS - Build validation page</title>
 	<link href="index.css" rel="stylesheet" />
-    <script src="https://preview.babylonjs.com/draco_decoder.js"></script>
-    <script src="https://preview.babylonjs.com/cannon.js"></script>
-    <script src="https://preview.babylonjs.com/Oimo.js"></script>
-    <script src="https://preview.babylonjs.com/gltf_validator.js"></script>
-    <script src="https://preview.babylonjs.com/babylon.js"></script>
-    <script src="https://preview.babylonjs.com/inspector/babylon.inspector.bundle.js"></script>
-
-    <script src="https://preview.babylonjs.com/loaders/babylonjs.loaders.min.js"></script>
+	<script src="https://preview.babylonjs.com/draco_decoder.js"></script>
+	<script src="https://preview.babylonjs.com/cannon.js"></script>
+	<script src="https://preview.babylonjs.com/Oimo.js"></script>
+	<script src="https://preview.babylonjs.com/gltf_validator.js"></script>
+	<script src="https://preview.babylonjs.com/babylon.js"></script>
+	<script src="https://preview.babylonjs.com/inspector/babylon.inspector.bundle.js"></script>
+
+	<script src="https://preview.babylonjs.com/loaders/babylonjs.loaders.min.js"></script>
 	<script src="https://preview.babylonjs.com/materialsLibrary/babylonjs.materials.min.js"></script>
-    <script src="https://preview.babylonjs.com/proceduralTexturesLibrary/babylonjs.proceduralTextures.min.js"></script>
-	<script src="https://preview.babylonjs.com/postProcessesLibrary/babylonjs.postProcess.min.js"></script>
-    <script src="https://preview.babylonjs.com/gui/babylon.gui.min.js"></script>	
+	<script src="https://preview.babylonjs.com/proceduralTexturesLibrary/babylonjs.proceduralTextures.min.js"></script>
+	<script src="https://preview.babylonjs.com/postProcessesLibrary/babylonjs.postProcesses.min.js"></script>
+	<script src="https://preview.babylonjs.com/gui/babylon.gui.min.js"></script>
 </head>
+
 <body>
 	<script src="validation.js"></script>
 	<script>
@@ -24,7 +26,7 @@
 
 		xhr.open("GET", "config.json", true);
 
-		xhr.addEventListener("load", function () {
+		xhr.addEventListener("load", function() {
 			if (xhr.status === 200) {
 
 				config = JSON.parse(xhr.responseText);
@@ -56,6 +58,7 @@
 		}, false);
 
 		xhr.send();
-    </script>	
+	</script>
 </body>
+
 </html>