Browse Source

Merge pull request #1562 from sebavan/Development

Canvas2D to new gulp
David Catuhe 8 years ago
parent
commit
7009535db8
44 changed files with 4918 additions and 3808 deletions
  1. 4 0
      .gitignore
  2. 0 3
      .vscode/settings.json
  3. 5 4
      Tools/DevLoader/BabylonLoader.js
  4. 45 2
      Tools/Gulp/config.json
  5. 36 27
      Tools/Gulp/gulpfile.js
  6. 0 50
      canvas2D/config.json
  7. 0 53
      canvas2D/gulp-addModuleExports.js
  8. 0 97
      canvas2D/gulp-removeShaderComments.js
  9. 0 68
      canvas2D/gulp-srcToVariable.js
  10. 0 124
      canvas2D/gulpfile.js
  11. 0 28
      canvas2D/package.json
  12. 11 27
      canvas2D/readme.md
  13. 1 0
      canvas2D/src/lib.d.ts
  14. 7 0
      canvas2D/src/tsconfig.json
  15. 0 10
      dist/preview release/babylon.canvas2d.js
  16. 605 605
      dist/preview release/babylon.d.ts
  17. 2565 2565
      dist/preview release/canvas2D/babylon.canvas2d.d.ts
  18. 279 145
      dist/preview release/babylon.canvas2d.max.js
  19. 10 0
      dist/preview release/canvas2D/babylon.canvas2d.min.js
  20. 487 0
      dist/preview release/loaders/babylon.glTFFileLoader.d.ts
  21. 74 0
      dist/preview release/loaders/babylon.objFileLoader.d.ts
  22. 13 0
      dist/preview release/loaders/babylon.stlFileLoader.d.ts
  23. 28 0
      dist/preview release/materialsLibrary/babylon.fireMaterial.d.ts
  24. 43 0
      dist/preview release/materialsLibrary/babylon.furMaterial.d.ts
  25. 30 0
      dist/preview release/materialsLibrary/babylon.gradientMaterial.d.ts
  26. 55 0
      dist/preview release/materialsLibrary/babylon.gridMaterial.d.ts
  27. 34 0
      dist/preview release/materialsLibrary/babylon.lavaMaterial.d.ts
  28. 26 0
      dist/preview release/materialsLibrary/babylon.normalMaterial.d.ts
  29. 27 0
      dist/preview release/materialsLibrary/babylon.simpleMaterial.d.ts
  30. 32 0
      dist/preview release/materialsLibrary/babylon.skyMaterial.d.ts
  31. 34 0
      dist/preview release/materialsLibrary/babylon.terrainMaterial.d.ts
  32. 35 0
      dist/preview release/materialsLibrary/babylon.triPlanarMaterial.d.ts
  33. 100 0
      dist/preview release/materialsLibrary/babylon.waterMaterial.d.ts
  34. 102 0
      dist/preview release/postProcessesLibrary/babylon.asciiArtPostProcess.d.ts
  35. 98 0
      dist/preview release/postProcessesLibrary/babylon.digitalRainPostProcess.d.ts
  36. 15 0
      dist/preview release/proceduralTexturesLibrary/babylon.brickProceduralTexture.d.ts
  37. 11 0
      dist/preview release/proceduralTexturesLibrary/babylon.cloudProceduralTexture.d.ts
  38. 21 0
      dist/preview release/proceduralTexturesLibrary/babylon.fireProceduralTexture.d.ts
  39. 14 0
      dist/preview release/proceduralTexturesLibrary/babylon.grassProceduralTexture.d.ts
  40. 15 0
      dist/preview release/proceduralTexturesLibrary/babylon.marbleProceduralTexture.d.ts
  41. 9 0
      dist/preview release/proceduralTexturesLibrary/babylon.roadProceduralTexture.d.ts
  42. 29 0
      dist/preview release/proceduralTexturesLibrary/babylon.starfieldProceduralTexture.d.ts
  43. 11 0
      dist/preview release/proceduralTexturesLibrary/babylon.woodProceduralTexture.d.ts
  44. 7 0
      dist/preview release/serializers/babylon.objSerializer.d.ts

+ 4 - 0
.gitignore

@@ -21,6 +21,7 @@ loaders/src/**/*.js
 materialsLibrary/src/**/*.js
 proceduralTexturesLibrary/src/**/*.js
 postProcessLibrary/src/**/*.js
+canvas2D/src/**/*.js
 
 # Build results
 [Dd]ebug/
@@ -154,6 +155,9 @@ node_modules
 .temp
 *.js.map
 *.js.fx
+*.d.ts
+!dist/**/*.d.ts
+!lib.d.ts
 
 # local dev
 localDev/src/*

+ 0 - 3
.vscode/settings.json

@@ -15,9 +15,6 @@
         "**/*.js.fx": true,
         "**/*.js": { 
             "when":"$(basename).ts"
-        },
-        "**/*.d.ts": { 
-            "when":"$(basename).ts"
         }
     },
     "files.associations": {

+ 5 - 4
Tools/DevLoader/BabylonLoader.js

@@ -104,6 +104,10 @@ var BABYLONDEVTOOLS;
                 var i = 0;
                 for (; i < library.files.length; i++) {
                     var file = library.files[i];
+                    if (file == 'lib.d.ts') {
+                        continue;
+                    }
+
                     file = file.replace('.ts', '.js');
                     file = file.replace('../', '');
                     file = babylonJSPath + '/' + file;
@@ -138,16 +142,13 @@ var BABYLONDEVTOOLS;
 
             if (!useDist) {
                 this.loadScripts(settings.core.files);
-                this.loadScripts(settings.extras.files);                
-                this.loadScript('/dist/preview release/babylon.canvas2d.max.js');
+                this.loadScripts(settings.extras.files);
             }
             else if (min) {
                 this.loadScript('/dist/preview release/babylon.js');
-                this.loadScript('/dist/preview release/babylon.canvas2d.js');
             }
             else {
                 this.loadScript('/dist/preview release/babylon.max.js');
-                this.loadScript('/dist/preview release/babylon.canvas2d.max.js');
             }
 
             for (var i = 0; i< settings.modules.length; i++) {

+ 45 - 2
Tools/Gulp/config.json

@@ -228,7 +228,7 @@
     ]
   },
 
-  "modules": ["materialsLibrary", "postProcessesLibrary", "proceduralTexturesLibrary", "loaders", "serializers"],
+  "modules": ["materialsLibrary", "postProcessesLibrary", "proceduralTexturesLibrary", "loaders", "serializers", "canvas2D"],
 
   "materialsLibrary": {
     "libraries": [
@@ -457,5 +457,48 @@
       "srcOutputDirectory": "../../serializers/",
       "distOutputDirectory": "/serializers/"
     }
-  }
+  },
+
+  "canvas2D": {
+    "libraries": [  
+    {
+      "files": [
+        "../../canvas2D/src/Tools/babylon.iPropertyChanged.ts",
+        "../../canvas2D/src/Tools/babylon.observableArray.ts",
+        "../../canvas2D/src/Tools/babylon.observableStringDictionary.ts",
+        "../../canvas2D/src/Engine/babylon.bounding2d.ts",
+        "../../canvas2D/src/Engine/babylon.canvas2dLayoutEngine.ts",
+        "../../canvas2D/src/Engine/babylon.brushes2d.ts",
+        "../../canvas2D/src/Engine/babylon.smartPropertyPrim.ts",
+        "../../canvas2D/src/Engine/babylon.prim2dBase.ts",
+        "../../canvas2D/src/Engine/babylon.modelRenderCache.ts",
+        "../../canvas2D/src/Engine/babylon.renderablePrim2d.ts",
+        "../../canvas2D/src/Engine/babylon.shape2d.ts",
+        "../../canvas2D/src/Engine/babylon.group2d.ts",
+        "../../canvas2D/src/Engine/babylon.rectangle2d.ts",
+        "../../canvas2D/src/Engine/babylon.ellipse2d.ts",
+        "../../canvas2D/src/Engine/babylon.sprite2d.ts",
+        "../../canvas2D/src/Engine/babylon.text2d.ts",
+        "../../canvas2D/src/Engine/babylon.lines2d.ts",
+        "../../canvas2D/src/Engine/babylon.canvas2d.ts",
+        "../../canvas2D/src/Engine/babylon.worldSpaceCanvas2dNode.ts",
+        "../../canvas2D/src/GUI/babylon.gui.UIElement.ts",
+        "../../canvas2D/src/GUI/Layouts/babylon.gui.stackPanel.ts",
+        "../../canvas2D/src/GUI/babylon.gui.control.ts",
+        "../../canvas2D/src/GUI/babylon.gui.contentControl.ts",
+        "../../canvas2D/src/GUI/babylon.gui.window.ts",
+        "../../canvas2D/src/GUI/babylon.gui.label.ts",
+        "../../canvas2D/src/GUI/babylon.gui.button.ts",
+        "../../canvas2D/src/lib.d.ts"
+        ],
+      "shaderFiles": [
+          "../../canvas2D/src/shaders/**.fx", "!../../canvas2D/src/shaders/**.js.fx"
+      ],
+      "output": "babylon.canvas2d.js"
+    }],
+    "build": {
+      "srcOutputDirectory": "../../canvas2D/",      
+      "distOutputDirectory": "/canvas2D/"
+    }
+  } 
 }

+ 36 - 27
Tools/Gulp/gulpfile.js

@@ -229,13 +229,13 @@ gulp.task('typescript-compile', function () {
  */
 var buildExternalLibraries = function(settings) {
     var tasks = settings.libraries.map(function (library) {
-        return buildExternalLibrary(library, settings); 
+        return buildExternalLibrary(library, settings, false); 
     });
 
     return merge2(tasks);
 }
 
-var buildExternalLibrary= function(library, settings) {
+var buildExternalLibrary= function(library, settings, watch) {
     var tsProcess = gulp.src(library.files, {base: settings.build.srcOutputDirectory})
         .pipe(sourcemaps.init())
         .pipe(typescript(externalTsConfig));
@@ -244,28 +244,38 @@ var buildExternalLibrary= function(library, settings) {
             .pipe(uncommentShader())            
             .pipe(appendSrcToVariable("BABYLON.Effect.ShadersStore", shadersName, library.output + '.fx'))
             .pipe(gulp.dest(settings.build.srcOutputDirectory));
-
+    
     var dev = tsProcess.js.pipe(sourcemaps.write("./", {
-                includeContent:false, 
-                sourceRoot: (filePath) => {
-                    return ''; 
-                }
-            }))
-            .pipe(gulp.dest(settings.build.srcOutputDirectory));
-
-    var outputDirectory = config.build.outputDirectory + settings.build.distOutputDirectory;
-    var dist = merge2(tsProcess.js, shader)
-        .pipe(concat(library.output))
-        .pipe(gulp.dest(outputDirectory))
-        .pipe(cleants())
-        .pipe(replace(extendsSearchRegex, ""))
-        .pipe(replace(decorateSearchRegex, ""))
-        .pipe(rename({extname: ".min.js"}))
-        .pipe(uglify())
-        .pipe(optimisejs())
-        .pipe(gulp.dest(outputDirectory));
-
-    return merge2(dev, dist);
+        includeContent:false, 
+        sourceRoot: (filePath) => {
+            return ''; 
+        }
+    }));
+
+    if (watch) {
+        return merge2([shader, dev]);    
+    }
+    else {
+        var outputDirectory = config.build.outputDirectory + settings.build.distOutputDirectory;
+        
+        var dist = merge2(dev, [
+            merge2([tsProcess.js, shader])
+                .pipe(concat(library.output))
+                .pipe(gulp.dest(outputDirectory))
+                .pipe(cleants())
+                .pipe(replace(extendsSearchRegex, ""))
+                .pipe(replace(decorateSearchRegex, ""))
+                .pipe(rename({extname: ".min.js"}))
+                .pipe(uglify())
+                .pipe(optimisejs())
+                .pipe(gulp.dest(outputDirectory)), 
+            tsProcess.dts
+                .pipe(concat(library.output))
+                .pipe(rename({extname: ".d.ts"}))
+                .pipe(gulp.dest(outputDirectory))]);
+
+        return dist;   
+    }
 }
 
 /**
@@ -308,16 +318,15 @@ gulp.task('watch', [], function () {
     var tasks = [gulp.watch(config.core.typescript, ['typescript-compile'])];
 
     config.modules.map(function (module) { 
-        config[module].libraries.map(function (library) {
-            
+        config[module].libraries.map(function (library) {            
             tasks.push(gulp.watch(library.files, function() { 
                 console.log(library.output);
-                return buildExternalLibrary(library, config[module])
+                return buildExternalLibrary(library, config[module], true)
                 .pipe(debug()); 
             }));
             tasks.push(gulp.watch(library.shaderFiles, function() { 
                 console.log(library.output);
-                return buildExternalLibrary(library, config[module])
+                return buildExternalLibrary(library, config[module], true)
                 .pipe(debug()) 
             }));
         }); 

+ 0 - 50
canvas2D/config.json

@@ -1,50 +0,0 @@
-{
-  "build": {
-    "filename": "babylon.canvas2d.max.js",
-    "minFilename": "babylon.canvas2d.js",
-    "declarationFilename": "babylon.canvas2d.d.ts",
-    "outputDirectory": "../dist/preview release",
-    "srcOutputDirectory": "src/"
-  },
-  "core": {
-    "typescript": [
-      "src/**/*.ts",
-      "../dist/preview release/babylon.d.ts", 
-      "!src/**/*.d.ts"
-    ],
-    "files": [   
-      "src/Tools/babylon.iPropertyChanged.js",
-      "src/Tools/babylon.observableArray.js",
-      "src/Tools/babylon.observableStringDictionary.js",
-      "src/Engine/babylon.bounding2d.js",
-      "src/Engine/babylon.canvas2dLayoutEngine.js",
-      "src/Engine/babylon.brushes2d.js",
-      "src/Engine/babylon.smartPropertyPrim.js",
-      "src/Engine/babylon.prim2dBase.js",
-      "src/Engine/babylon.modelRenderCache.js",
-      "src/Engine/babylon.renderablePrim2d.js",
-      "src/Engine/babylon.shape2d.js",
-      "src/Engine/babylon.group2d.js",
-      "src/Engine/babylon.rectangle2d.js",
-      "src/Engine/babylon.ellipse2d.js",
-      "src/Engine/babylon.sprite2d.js",
-      "src/Engine/babylon.text2d.js",
-      "src/Engine/babylon.lines2d.js",
-      "src/Engine/babylon.canvas2d.js",
-      "src/Engine/babylon.worldSpaceCanvas2dNode.js",
-      "src/GUI/babylon.gui.UIElement.js",
-      "src/GUI/Layouts/babylon.gui.stackPanel.js",
-      "src/GUI/babylon.gui.control.js",
-      "src/GUI/babylon.gui.contentControl.js",
-      "src/GUI/babylon.gui.window.js",
-      "src/GUI/babylon.gui.label.js",
-      "src/GUI/babylon.gui.button.js"
-    ]
-  },
-  "shadersDirectories": [
-    {
-      "variable": "BABYLON.Effect.ShadersStore",
-      "files": "src/Shaders/*.fx"
-    }
-  ]
-}

+ 0 - 53
canvas2D/gulp-addModuleExports.js

@@ -1,53 +0,0 @@
-var gutil = require('gulp-util');
-var through = require('through2');
-
-module.exports = function (varName) {
-    return through.obj(function (file, enc, cb) {
-
-        var moduleExportsAddition =
-          '\nif (((typeof window != "undefined" && window.module) || (typeof module != "undefined")) && typeof module.exports != "undefined") {\n' +
-          '    module.exports = ' + varName + ';\n' +
-          '};\n';
-
-        var extendsAddition =
-        'var __extends = (this && this.__extends) || function (d, b) {\n' +
-          'for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];\n' +
-          'function __() { this.constructor = d; }\n' +
-          '__.prototype = b.prototype;\n' +
-          'd.prototype = new __();\n' +
-        '};\n';
-
-        var decorateAddition =
-        'var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {\n' +
-            'var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n' +
-            'if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);\n' +
-            'else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n' +
-            'return c > 3 && r && Object.defineProperty(target, key, r), r;\n' +
-        '};\n';
-
-        var dependencyAddition =
-        'if (typeof BABYLON === "undefined") {\n' +
-            'throw "BabylonJS is a required dependency, please include it first!"\n' +
-        '};\n';
-
-        if (file.isNull()) {
-            cb(null, file);
-            return;
-        }
-
-        if (file.isStream()) {
-            //streams not supported, no need for now.
-            return;
-        }
-
-        try {
-            file.contents = new Buffer(decorateAddition.concat(new Buffer(extendsAddition.concat(dependencyAddition).concat(String(file.contents)).concat(moduleExportsAddition))));
-            this.push(file);
-
-        } catch (err) {
-            this.emit('error', new gutil.PluginError('gulp-add-module-exports', err, { fileName: file.path }));
-        }
-        cb();
-    });
-};
-

+ 0 - 97
canvas2D/gulp-removeShaderComments.js

@@ -1,97 +0,0 @@
-'use strict';
-
-var through = require('through2');
-var PluginError = require('gulp-util').PluginError;
-var singleComment = 1;
-var multiComment = 2;
-
-function uncomment(str, opts) {
-    opts = opts || {};
-
-	var currentChar;
-	var nextChar;
-	var insideString = false;
-	var insideComment = 0;
-	var offset = 0;
-	var ret = '';
-
-    str = str.replace(/\r\n/g, '\n');
-    str = str.replace(/[ \f\t\v]+/g, ' ');
-    str = str.replace(/^\s*\n/gm, '');
-    str = str.replace(/ \+ /g, '+');
-    str = str.replace(/ \- /g, '-');
-    str = str.replace(/ \/ /g, '/');
-    str = str.replace(/ \* /g, '*');
-    str = str.replace(/ > /g, '>');
-    str = str.replace(/ < /g, '<');
-    str = str.replace(/ >= /g, '>=');
-    str = str.replace(/ <= /g, '<=');
-    str = str.replace(/ \+= /g, '+=');
-    str = str.replace(/ \-= /g, '-=');
-    str = str.replace(/ \/= /g, '/=');
-    str = str.replace(/ \*= /g, '*=');
-    str = str.replace(/ = /g, '=');
-    str = str.replace(/, /g, ',');
-    str = str.replace(/\n\n/g, '\n');
-    str = str.replace(/\n /g, '\n');
-    
-	for (var i = 0; i < str.length; i++) {
-		currentChar = str[i];
-		nextChar = str[i + 1];
-
-		if (!insideComment && currentChar === '"') {
-			var escaped = str[i - 1] === '\\' && str[i - 2] !== '\\';
-			if (!escaped) {
-				insideString = !insideString;
-			}
-		}
-
-		if (insideString) {
-			continue;
-		}
-
-		if (!insideComment && currentChar + nextChar === '//') {
-			ret += str.slice(offset, i);
-			offset = i;
-			insideComment = singleComment;
-			i++;
-		} else if (insideComment === singleComment && currentChar === '\n') {
-			insideComment = 0;
-			offset = i;
-		} else if (!insideComment && currentChar + nextChar === '/*') {
-			ret += str.slice(offset, i);
-			offset = i;
-			insideComment = multiComment;
-			i++;
-			continue;
-		} else if (insideComment === multiComment && currentChar + nextChar === '*/') {
-			i++;
-			insideComment = 0;
-			offset = i + 1;
-			continue;
-		}
-	}
-
-	return ret + (insideComment ? '' : str.substr(offset));
-}
-
-function gulpUncomment(options) {
-    return main(options, uncomment);
-}
-
-function main(options, func) {
-    return through.obj(function (file, enc, cb) {
-        if (file.isNull()) {
-            cb(null, file);
-            return;
-        }
-        if (file.isStream()) {
-            cb(new PluginError("Remove Shader Comments", "Streaming not supported."));
-        }
-        file.contents = new Buffer(func(file.contents.toString(), options));
-        this.push(file);
-        return cb();
-    });
-}
-
-module.exports = gulpUncomment;

+ 0 - 68
canvas2D/gulp-srcToVariable.js

@@ -1,68 +0,0 @@
-var through = require('through2');
-var gutil = require('gulp-util');
-var PluginError = gutil.PluginError;
-var path = require('path');
-var File = gutil.File;
-
-// Consts
-const PLUGIN_NAME = 'gulp-srcToVariable';
-
-var srcToVariable = function srcToVariable(varName, asMap, namingCallback) {
-
-    var content;
-    var firstFile;
-
-    namingCallback = namingCallback || function (filename) { return filename; };
-
-    function bufferContents(file, enc, cb) {
-        // ignore empty files
-        if (file.isNull()) {
-            cb();
-            return;
-        }
-
-        // no stream support, only files.
-        if (file.isStream()) {
-            this.emit('error', new PluginError('gulp-concat', 'Streaming not supported'));
-            cb();
-            return;
-        }
-
-        // set first file if not already set
-        if (!firstFile) {
-            firstFile = file;
-        }
-
-        // construct concat instance
-        if (!content) {
-            content = "";
-        }
-        var name = namingCallback(file.relative);
-        content += varName + "['" + name + "'] = " + JSON.stringify(file.contents.toString()) + ";\r\n";
-        cb();
-    }
-
-    function endStream(cb) {
-        if (!firstFile || !content) {
-            cb();
-            return;
-        }
-
-        var joinedPath = path.join(firstFile.base, varName);
-
-        var joinedFile = new File({
-            cwd: firstFile.cwd,
-            base: firstFile.base,
-            path: joinedPath,
-            contents: new Buffer(content)
-        });
-
-        this.push(joinedFile);
-
-        cb();
-    }
-
-    return through.obj(bufferContents, endStream);
-}
-
-module.exports = srcToVariable;

+ 0 - 124
canvas2D/gulpfile.js

@@ -1,124 +0,0 @@
-var gulp = require("gulp");
-var uglify = require("gulp-uglify");
-var typescript = require("gulp-typescript");
-var sourcemaps = require("gulp-sourcemaps");
-var srcToVariable = require("./gulp-srcToVariable");
-var addModuleExports = require("./gulp-addModuleExports");
-var merge2 = require("merge2");
-var concat = require("gulp-concat");
-var rename = require("gulp-rename");
-var cleants = require('gulp-clean-ts-extends');
-var changed = require('gulp-changed');
-var runSequence = require('run-sequence');
-var replace = require("gulp-replace");
-var uncommentShader = require("./gulp-removeShaderComments");
-var expect = require('gulp-expect-file');
-var optimisejs = require('gulp-optimize-js');
-
-var config = require("./config.json");
-
-var shadersStream;
-
-var extendsSearchRegex = /var\s__extends[\s\S]+?\};/g;
-var decorateSearchRegex = /var\s__decorate[\s\S]+?\};/g;
-
-//function to convert the shaders' filenames to variable names.
-function shadersName(filename) {
-    return filename.replace('.fragment', 'Pixel')
-        .replace('.vertex', 'Vertex')
-        .replace('.fx', 'Shader');
-}
-
-gulp.task("shaders", function (cb) {
-    shadersStream = config.shadersDirectories.map(function (shadersDef) {
-        return gulp.src(shadersDef.files).
-            pipe(expect.real({ errorOnFailure: true }, shadersDef.files)).
-            pipe(uncommentShader()).
-            pipe(srcToVariable("BABYLON.Effect.ShadersStore", true, shadersName)
-            );
-    });
-    cb();
-});
-
-/*
-Compiles all typescript files and creating a declaration file.
-*/
-gulp.task('typescript-compile', function () {
-    var tsResult = gulp.src(config.core.typescript).
-        pipe(typescript({
-            noExternalResolve: true,
-            target: 'ES5',
-            declarationFiles: true,
-            typescript: require('typescript'),
-            experimentalDecorators: true
-        }));
-    //If this gulp task is running on travis, file the build!
-    if (process.env.TRAVIS) {
-        var error = false;
-        tsResult.on('error', function () {
-            error = true;
-        }).on('end', function () {
-            if (error) {
-                console.log('Typescript compile failed');
-                process.exit(1);
-            }
-        });
-    }
-    return merge2([
-        tsResult.dts
-            .pipe(concat(config.build.declarationFilename))
-            .pipe(gulp.dest(config.build.outputDirectory)),
-        tsResult.js
-            .pipe(gulp.dest(config.build.srcOutputDirectory))
-    ])
-});
-
-gulp.task('typescript-sourcemaps', function () {
-    var tsResult = gulp.src(config.core.typescript)
-        .pipe(sourcemaps.init()) // sourcemaps init. currently redundant directory def, waiting for this - https://github.com/floridoo/gulp-sourcemaps/issues/111
-        .pipe(typescript({
-            noExternalResolve: true,
-            target: 'ES5',
-            declarationFiles: true,
-            typescript: require('typescript'),
-            experimentalDecorators: true
-        }));
-    return tsResult.js
-        .pipe(sourcemaps.write("./")) // sourcemaps are written.
-        .pipe(gulp.dest(config.build.srcOutputDirectory));
-});
-
-gulp.task("default", ["shaders"], function () {
-    return merge2(
-        gulp.src(config.core.files).        
-            pipe(expect.real({ errorOnFailure: true }, config.core.files)),
-        shadersStream)
-        .pipe(concat(config.build.filename))
-        .pipe(cleants())
-        .pipe(replace(extendsSearchRegex, ""))
-        .pipe(replace(decorateSearchRegex, ""))
-        .pipe(addModuleExports("BABYLON"))
-        .pipe(gulp.dest(config.build.outputDirectory))
-        .pipe(rename(config.build.minFilename))
-        .pipe(uglify())
-        .pipe(optimisejs())
-        .pipe(gulp.dest(config.build.outputDirectory));
-});
-
-gulp.task("typescript", function (cb) {
-    runSequence("typescript-compile", "default", cb);
-});
-
-/**
- * Watch task, will call the default task if a js file is updated.
- */
-gulp.task('watch', function () {
-    gulp.watch(config.core.typescript, ['default']);
-});
-
-/**
- * Watch typescript task, will call the default typescript task if a typescript file is updated.
- */
-gulp.task('watch-typescript', function () {
-    gulp.watch(config.core.typescript, ["typescript-compile", "build"]);
-});

+ 0 - 28
canvas2D/package.json

@@ -1,28 +0,0 @@
-{
-  "name": "BabylonJS",
-  "version": "2.4.0",
-  "description": "Babylon.js is a 3D engine based on webgl and javascript",
-  "main": "",
-  "repository": { "url": "https://github.com/BabylonJS/Babylon.js/" },
-  "readme": "https://github.com/BabylonJS/Babylon.js/edit/master/readme.md",
-  "license": "(Apache-2.0)",
-  "devDependencies": {
-    "gulp": "^3.8.11",
-    "gulp-uglify": "~1.5.3",
-    "gulp-sourcemaps": "~1.5.2",
-    "typescript": "^1.7.5",
-    "gulp-typescript": "~2.13.0",
-    "through2": "~0.6.5",
-    "gulp-util": "~3.0.4",
-    "gulp-concat": "~2.5.2",
-    "merge2": "~0.3.5",
-    "gulp-rename": "~1.2.2",
-    "gulp-clean-ts-extends": "~0.1.1",
-    "gulp-changed": "~1.2.1",
-    "run-sequence": "~1.1.0",
-    "gulp-replace": "~0.5.3",
-    "gulp-content-to-variable": "^0.1.0",
-    "gulp-expect-file": "^0.0.7",
-    "gulp-optimize-js": "^1.0.2"
-  }
-}

+ 11 - 27
canvas2D/readme.md

@@ -9,6 +9,8 @@ Build Babylon.canvas2d.js with [gulp](http://gulpjs.com/ "gulp") and npm ([nodej
 
 # How to use it
 
+From the /Tools/Gulp folder:
+
 ### First install gulp :
 ```
 npm install -g gulp
@@ -25,41 +27,23 @@ npm update
 ```
 
 ## From the javascript source
-### Build Babylon.canvas2d.js from the javascript files:
-
-```
-gulp
-```
-Will be generated :
-- babylon.canvas2d.js
-- babylon.canvas2d.max.js (unminified)
+### Build Babylon.canvas2d.js:
 
-### Build Babylon.canvas2d.js when you save a javascript file:
 ```
-gulp watch
+gulp Canvas2D
 ```
-
-## From the typescript source
-### Build Babylon.canvas2d.js from the typescript files:
-
-```
-gulp typescript
-```
-Will be generated :
-- babylon.canvas2d.js
+Will be generated in dist/preview release/canvas2D:
+- babylon.canvas2d.min.js
+- babylon.canvas2d.js (unminified)
 - babylon.canvas2d.d.ts
-- babylon.canvas2d.max.js (unminified)
 
-Be aware that all js files content will be overwrite.
-
-### Build Babylon.canvas2d.js when you save a typescript file:
+### Build the changed files for debug when you save a typescript or shader file:
 ```
-gulp watch-typescript
+gulp watch
 ```
 
-### Compile all the typscript files to their javascript respective files including declaration file
+### Watch and run a web server for debug purpose:
 ```
-gulp typescript-compile
+gulp run
 ```
 
-Be aware that all js files content will be overwritten.

+ 1 - 0
canvas2D/src/lib.d.ts

@@ -0,0 +1 @@
+/// <reference path="../../dist/preview release/babylon.d.ts"/>

+ 7 - 0
canvas2D/src/tsconfig.json

@@ -0,0 +1,7 @@
+{
+    "compilerOptions": {
+        "experimentalDecorators": true,
+        "module": "commonjs", 
+        "target": "es5"
+    }
+}

File diff suppressed because it is too large
+ 0 - 10
dist/preview release/babylon.canvas2d.js


File diff suppressed because it is too large
+ 605 - 605
dist/preview release/babylon.d.ts


File diff suppressed because it is too large
dist/preview release/canvas2D/babylon.canvas2d.d.ts


File diff suppressed because it is too large
+ 279 - 145
dist/preview release/babylon.canvas2d.max.js


File diff suppressed because it is too large
+ 10 - 0
dist/preview release/canvas2D/babylon.canvas2d.min.js


+ 487 - 0
dist/preview release/loaders/babylon.glTFFileLoader.d.ts

@@ -0,0 +1,487 @@
+/// <reference path="../../../dist/preview release/babylon.d.ts" />
+declare module BABYLON {
+    /**
+    * Enums
+    */
+    enum EComponentType {
+        BYTE = 5120,
+        UNSIGNED_BYTE = 5121,
+        SHORT = 5122,
+        UNSIGNED_SHORT = 5123,
+        FLOAT = 5126,
+    }
+    enum EShaderType {
+        FRAGMENT = 35632,
+        VERTEX = 35633,
+    }
+    enum EParameterType {
+        BYTE = 5120,
+        UNSIGNED_BYTE = 5121,
+        SHORT = 5122,
+        UNSIGNED_SHORT = 5123,
+        INT = 5124,
+        UNSIGNED_INT = 5125,
+        FLOAT = 5126,
+        FLOAT_VEC2 = 35664,
+        FLOAT_VEC3 = 35665,
+        FLOAT_VEC4 = 35666,
+        INT_VEC2 = 35667,
+        INT_VEC3 = 35668,
+        INT_VEC4 = 35669,
+        BOOL = 35670,
+        BOOL_VEC2 = 35671,
+        BOOL_VEC3 = 35672,
+        BOOL_VEC4 = 35673,
+        FLOAT_MAT2 = 35674,
+        FLOAT_MAT3 = 35675,
+        FLOAT_MAT4 = 35676,
+        SAMPLER_2D = 35678,
+    }
+    enum ETextureWrapMode {
+        CLAMP_TO_EDGE = 33071,
+        MIRRORED_REPEAT = 33648,
+        REPEAT = 10497,
+    }
+    enum ETextureFilterType {
+        NEAREST = 9728,
+        LINEAR = 9728,
+        NEAREST_MIPMAP_NEAREST = 9984,
+        LINEAR_MIPMAP_NEAREST = 9985,
+        NEAREST_MIPMAP_LINEAR = 9986,
+        LINEAR_MIPMAP_LINEAR = 9987,
+    }
+    enum ETextureFormat {
+        ALPHA = 6406,
+        RGB = 6407,
+        RGBA = 6408,
+        LUMINANCE = 6409,
+        LUMINANCE_ALPHA = 6410,
+    }
+    enum ECullingType {
+        FRONT = 1028,
+        BACK = 1029,
+        FRONT_AND_BACK = 1032,
+    }
+    enum EBlendingFunction {
+        ZERO = 0,
+        ONE = 1,
+        SRC_COLOR = 768,
+        ONE_MINUS_SRC_COLOR = 769,
+        DST_COLOR = 774,
+        ONE_MINUS_DST_COLOR = 775,
+        SRC_ALPHA = 770,
+        ONE_MINUS_SRC_ALPHA = 771,
+        DST_ALPHA = 772,
+        ONE_MINUS_DST_ALPHA = 773,
+        CONSTANT_COLOR = 32769,
+        ONE_MINUS_CONSTANT_COLOR = 32770,
+        CONSTANT_ALPHA = 32771,
+        ONE_MINUS_CONSTANT_ALPHA = 32772,
+        SRC_ALPHA_SATURATE = 776,
+    }
+    /**
+    * Interfaces
+    */
+    interface IGLTFProperty {
+        extensions?: Object;
+        extras?: Object;
+    }
+    interface IGLTFChildRootProperty extends IGLTFProperty {
+        name?: string;
+    }
+    interface IGLTFAccessor extends IGLTFChildRootProperty {
+        bufferView: string;
+        byteOffset: number;
+        byteStride: number;
+        count: number;
+        type: string;
+        componentType: EComponentType;
+        max?: number[];
+        min?: number[];
+        name?: string;
+    }
+    interface IGLTFBufferView extends IGLTFChildRootProperty {
+        buffer: string;
+        byteOffset: number;
+        byteLength: number;
+        target?: number;
+    }
+    interface IGLTFBuffer extends IGLTFChildRootProperty {
+        uri: string;
+        byteLength?: number;
+        type?: string;
+    }
+    interface IGLTFShader extends IGLTFChildRootProperty {
+        uri: string;
+        type: EShaderType;
+    }
+    interface IGLTFProgram extends IGLTFChildRootProperty {
+        attributes: string[];
+        fragmentShader: string;
+        vertexShader: string;
+    }
+    interface IGLTFTechniqueParameter {
+        type: number;
+        count?: number;
+        semantic?: string;
+        node?: string;
+        value?: number | boolean | string | Array<any>;
+        source?: string;
+        babylonValue?: any;
+    }
+    interface IGLTFTechniqueCommonProfile {
+        lightingModel: string;
+        texcoordBindings: Object;
+        parameters?: Array<any>;
+    }
+    interface IGLTFTechniqueStatesFunctions {
+        blendColor?: number[];
+        blendEquationSeparate?: number[];
+        blendFuncSeparate?: number[];
+        colorMask: boolean[];
+        cullFace: number[];
+    }
+    interface IGLTFTechniqueStates {
+        enable: number[];
+        functions: IGLTFTechniqueStatesFunctions;
+    }
+    interface IGLTFTechnique extends IGLTFChildRootProperty {
+        parameters: Object;
+        program: string;
+        attributes: Object;
+        uniforms: Object;
+        states: IGLTFTechniqueStates;
+    }
+    interface IGLTFMaterial extends IGLTFChildRootProperty {
+        technique?: string;
+        values: string[];
+    }
+    interface IGLTFMeshPrimitive extends IGLTFProperty {
+        attributes: Object;
+        indices: string;
+        material: string;
+        mode?: number;
+    }
+    interface IGLTFMesh extends IGLTFChildRootProperty {
+        primitives: IGLTFMeshPrimitive[];
+    }
+    interface IGLTFImage extends IGLTFChildRootProperty {
+        uri: string;
+    }
+    interface IGLTFSampler extends IGLTFChildRootProperty {
+        magFilter?: number;
+        minFilter?: number;
+        wrapS?: number;
+        wrapT?: number;
+    }
+    interface IGLTFTexture extends IGLTFChildRootProperty {
+        sampler: string;
+        source: string;
+        format?: ETextureFormat;
+        internalFormat?: ETextureFormat;
+        target?: number;
+        type?: number;
+        babylonTexture?: Texture;
+    }
+    interface IGLTFAmbienLight {
+        color?: number[];
+    }
+    interface IGLTFDirectionalLight {
+        color?: number[];
+    }
+    interface IGLTFPointLight {
+        color?: number[];
+        constantAttenuation?: number;
+        linearAttenuation?: number;
+        quadraticAttenuation?: number;
+    }
+    interface IGLTFSpotLight {
+        color?: number[];
+        constantAttenuation?: number;
+        fallOfAngle?: number;
+        fallOffExponent?: number;
+        linearAttenuation?: number;
+        quadraticAttenuation?: number;
+    }
+    interface IGLTFLight extends IGLTFChildRootProperty {
+        type: string;
+    }
+    interface IGLTFCameraOrthographic {
+        xmag: number;
+        ymag: number;
+        zfar: number;
+        znear: number;
+    }
+    interface IGLTFCameraPerspective {
+        aspectRatio: number;
+        yfov: number;
+        zfar: number;
+        znear: number;
+    }
+    interface IGLTFCamera extends IGLTFChildRootProperty {
+        type: string;
+    }
+    interface IGLTFAnimationChannelTarget {
+        id: string;
+        path: string;
+    }
+    interface IGLTFAnimationChannel {
+        sampler: string;
+        target: IGLTFAnimationChannelTarget;
+    }
+    interface IGLTFAnimationSampler {
+        input: string;
+        output: string;
+        interpolation?: string;
+    }
+    interface IGLTFAnimation extends IGLTFChildRootProperty {
+        channels?: IGLTFAnimationChannel[];
+        parameters?: Object;
+        samplers?: Object;
+    }
+    interface IGLTFNodeInstanceSkin {
+        skeletons: string[];
+        skin: string;
+        meshes: string[];
+    }
+    interface IGLTFSkins extends IGLTFChildRootProperty {
+        bindShapeMatrix: number[];
+        inverseBindMatrices: string;
+        jointNames: string[];
+        babylonSkeleton?: Skeleton;
+    }
+    interface IGLTFNode extends IGLTFChildRootProperty {
+        camera?: string;
+        children: string[];
+        skin?: string;
+        jointName?: string;
+        light?: string;
+        matrix: number[];
+        mesh?: string;
+        meshes?: string[];
+        rotation?: number[];
+        scale?: number[];
+        translation?: number[];
+        babylonNode?: Node;
+    }
+    interface IGLTFScene extends IGLTFChildRootProperty {
+        nodes: string[];
+    }
+    /**
+    * Runtime
+    */
+    interface IGLTFRuntime {
+        accessors: Object;
+        buffers: Object;
+        bufferViews: Object;
+        meshes: Object;
+        lights: Object;
+        cameras: Object;
+        nodes: Object;
+        images: Object;
+        textures: Object;
+        shaders: Object;
+        programs: Object;
+        samplers: Object;
+        techniques: Object;
+        materials: Object;
+        animations: Object;
+        skins: Object;
+        currentScene: Object;
+        extensionsUsed: string[];
+        buffersCount: number;
+        shaderscount: number;
+        scene: Scene;
+        rootUrl: string;
+        loadedBufferCount: number;
+        loadedBufferViews: {
+            [name: string]: ArrayBufferView;
+        };
+        loadedShaderCount: number;
+        importOnlyMeshes: boolean;
+        importMeshesNames?: string[];
+        dummyNodes: Node[];
+    }
+    /**
+    * Bones
+    */
+    interface INodeToRoot {
+        bone: Bone;
+        node: IGLTFNode;
+        id: string;
+    }
+    interface IJointNode {
+        node: IGLTFNode;
+        id: string;
+    }
+}
+
+/// <reference path="../../../dist/preview release/babylon.d.ts" />
+declare module BABYLON {
+    /**
+    * Implementation of the base glTF spec
+    */
+    class GLTFFileLoaderBase {
+        static CreateRuntime(parsedData: any, scene: Scene, rootUrl: string): IGLTFRuntime;
+        static LoadBufferAsync(gltfRuntime: IGLTFRuntime, id: string, onSuccess: (buffer: ArrayBufferView) => void, onError: () => void): void;
+        static LoadTextureBufferAsync(gltfRuntime: IGLTFRuntime, id: string, onSuccess: (buffer: ArrayBufferView) => void, onError: () => void): void;
+        static CreateTextureAsync(gltfRuntime: IGLTFRuntime, id: string, buffer: ArrayBufferView, onSuccess: (texture: Texture) => void, onError: () => void): void;
+        static LoadShaderStringAsync(gltfRuntime: IGLTFRuntime, id: string, onSuccess: (shaderString: string) => void, onError: () => void): void;
+        static LoadMaterialAsync(gltfRuntime: IGLTFRuntime, id: string, onSuccess: (material: Material) => void, onError: () => void): void;
+    }
+    /**
+    * glTF File Loader Plugin
+    */
+    class GLTFFileLoader implements ISceneLoaderPluginAsync {
+        /**
+        * Public members
+        */
+        extensions: ISceneLoaderPluginExtensions;
+        /**
+        * Private members
+        */
+        /**
+        * Static members
+        */
+        static MakeYUP: boolean;
+        static HomogeneousCoordinates: boolean;
+        static Extensions: {
+            [name: string]: GLTFFileLoaderExtension;
+        };
+        static RegisterExtension(extension: GLTFFileLoaderExtension): void;
+        /**
+        * Import meshes
+        */
+        importMeshAsync(meshesNames: any, scene: Scene, data: any, rootUrl: string, onSuccess?: (meshes: AbstractMesh[], particleSystems: ParticleSystem[], skeletons: Skeleton[]) => void, onError?: () => void): boolean;
+        /**
+        * Load scene
+        */
+        loadAsync(scene: Scene, data: string | ArrayBuffer, rootUrl: string, onSuccess: () => void, onError: () => void): boolean;
+        private _loadShadersAsync(gltfRuntime, onload);
+        private _loadBuffersAsync(gltfRuntime, onload);
+        private _createNodes(gltfRuntime);
+    }
+}
+
+/// <reference path="../../../dist/preview release/babylon.d.ts" />
+declare module BABYLON {
+    /**
+    * Utils functions for GLTF
+    */
+    class GLTFUtils {
+        /**
+         * Sets the given "parameter" matrix
+         * @param scene: the {BABYLON.Scene} object
+         * @param source: the source node where to pick the matrix
+         * @param parameter: the GLTF technique parameter
+         * @param uniformName: the name of the shader's uniform
+         * @param shaderMaterial: the shader material
+         */
+        static SetMatrix(scene: Scene, source: Node, parameter: IGLTFTechniqueParameter, uniformName: string, shaderMaterial: ShaderMaterial | Effect): void;
+        /**
+         * Sets the given "parameter" matrix
+         * @param shaderMaterial: the shader material
+         * @param uniform: the name of the shader's uniform
+         * @param value: the value of the uniform
+         * @param type: the uniform's type (EParameterType FLOAT, VEC2, VEC3 or VEC4)
+         */
+        static SetUniform(shaderMaterial: ShaderMaterial | Effect, uniform: string, value: any, type: number): boolean;
+        /**
+        * If the uri is a base64 string
+        * @param uri: the uri to test
+        */
+        static IsBase64(uri: string): boolean;
+        /**
+        * Decode the base64 uri
+        * @param uri: the uri to decode
+        */
+        static DecodeBase64(uri: string): ArrayBuffer;
+        /**
+        * Returns the wrap mode of the texture
+        * @param mode: the mode value
+        */
+        static GetWrapMode(mode: number): number;
+        /**
+         * Returns the byte stride giving an accessor
+         * @param accessor: the GLTF accessor objet
+         */
+        static GetByteStrideFromType(accessor: IGLTFAccessor): number;
+        /**
+         * Returns the texture filter mode giving a mode value
+         * @param mode: the filter mode value
+         */
+        static GetTextureFilterMode(mode: number): ETextureFilterType;
+        static GetBufferFromBufferView(gltfRuntime: IGLTFRuntime, bufferView: IGLTFBufferView, byteOffset: number, byteLength: number, componentType: EComponentType): ArrayBufferView;
+        /**
+         * Returns a buffer from its accessor
+         * @param gltfRuntime: the GLTF runtime
+         * @param accessor: the GLTF accessor
+         */
+        static GetBufferFromAccessor(gltfRuntime: IGLTFRuntime, accessor: IGLTFAccessor): any;
+        /**
+         * Decodes a buffer view into a string
+         * @param view: the buffer view
+         */
+        static DecodeBufferToText(view: ArrayBufferView): string;
+    }
+}
+
+/// <reference path="../../../dist/preview release/babylon.d.ts" />
+declare module BABYLON {
+    abstract class GLTFFileLoaderExtension {
+        private _name;
+        constructor(name: string);
+        name: string;
+        /**
+        * Defines an override for loading the runtime
+        * Return true to stop further extensions from loading the runtime
+        */
+        loadRuntimeAsync(scene: Scene, data: string | ArrayBuffer, rootUrl: string, onSuccess: (gltfRuntime: IGLTFRuntime) => void, onError: () => void): boolean;
+        /**
+        * Defines an override for loading buffers
+        * Return true to stop further extensions from loading this buffer
+        */
+        loadBufferAsync(gltfRuntime: IGLTFRuntime, id: string, onSuccess: (buffer: ArrayBufferView) => void, onError: () => void): boolean;
+        /**
+        * Defines an override for loading texture buffers
+        * Return true to stop further extensions from loading this texture data
+        */
+        loadTextureBufferAsync(gltfRuntime: IGLTFRuntime, id: string, onSuccess: (buffer: ArrayBufferView) => void, onError: () => void): boolean;
+        /**
+        * Defines an override for creating textures
+        * Return true to stop further extensions from loading this texture
+        */
+        createTextureAsync(gltfRuntime: IGLTFRuntime, id: string, buffer: ArrayBufferView, onSuccess: (texture: Texture) => void, onError: () => void): boolean;
+        /**
+        * Defines an override for loading shader strings
+        * Return true to stop further extensions from loading this shader data
+        */
+        loadShaderStringAsync(gltfRuntime: IGLTFRuntime, id: string, onSuccess: (shaderString: string) => void, onError: () => void): boolean;
+        /**
+        * Defines an override for loading materials
+        * Return true to stop further extensions from loading this material
+        */
+        loadMaterialAsync(gltfRuntime: IGLTFRuntime, id: string, onSuccess: (material: Material) => void, onError: () => void): boolean;
+        static LoadRuntimeAsync(scene: Scene, data: string | ArrayBuffer, rootUrl: string, onSuccess: (gltfRuntime: IGLTFRuntime) => void, onError: () => void): void;
+        static LoadBufferAsync(gltfRuntime: IGLTFRuntime, id: string, onSuccess: (bufferView: ArrayBufferView) => void, onError: () => void): void;
+        static LoadTextureAsync(gltfRuntime: IGLTFRuntime, id: string, onSuccess: (texture: Texture) => void, onError: () => void): void;
+        static LoadShaderStringAsync(gltfRuntime: IGLTFRuntime, id: string, onSuccess: (shaderData: string) => void, onError: () => void): void;
+        static LoadMaterialAsync(gltfRuntime: IGLTFRuntime, id: string, onSuccess: (material: Material) => void, onError: () => void): void;
+        private static LoadTextureBufferAsync(gltfRuntime, id, onSuccess, onError);
+        private static CreateTextureAsync(gltfRuntime, id, buffer, onSuccess, onError);
+        private static ApplyExtensions(func, defaultFunc);
+    }
+}
+
+/// <reference path="../../../dist/preview release/babylon.d.ts" />
+declare module BABYLON {
+    class GLTFBinaryExtension extends GLTFFileLoaderExtension {
+        private _binary;
+        constructor();
+        loadRuntimeAsync(scene: Scene, data: string | ArrayBuffer, rootUrl: string, onSuccess: (gltfRuntime: IGLTFRuntime) => void, onError: () => void): boolean;
+        loadBufferAsync(gltfRuntime: IGLTFRuntime, id: string, onSuccess: (buffer: ArrayBufferView) => void, onError: () => void): boolean;
+        loadTextureBufferAsync(gltfRuntime: IGLTFRuntime, id: string, onSuccess: (buffer: ArrayBufferView) => void, onError: () => void): boolean;
+        loadShaderStringAsync(gltfRuntime: IGLTFRuntime, id: string, onSuccess: (shaderString: string) => void, onError: () => void): boolean;
+        private _parseBinary(data);
+    }
+}

+ 74 - 0
dist/preview release/loaders/babylon.objFileLoader.d.ts

@@ -0,0 +1,74 @@
+/// <reference path="../../../dist/preview release/babylon.d.ts" />
+declare module BABYLON {
+    /**
+     * Class reading and parsing the MTL file bundled with the obj file.
+     */
+    class MTLFileLoader {
+        materials: BABYLON.StandardMaterial[];
+        /**
+         * This function will read the mtl file and create each material described inside
+         * This function could be improve by adding :
+         * -some component missing (Ni, Tf...)
+         * -including the specific options available
+         *
+         * @param scene
+         * @param data
+         * @param rootUrl
+         */
+        parseMTL: (scene: Scene, data: string, rootUrl: string) => void;
+        /**
+         * Gets the texture for the material.
+         *
+         * If the material is imported from input file,
+         * We sanitize the url to ensure it takes the textre from aside the material.
+         *
+         * @param rootUrl The root url to load from
+         * @param value The value stored in the mtl
+         * @return The Texture
+         */
+        private static _getTexture(rootUrl, value, scene);
+    }
+    class OBJFileLoader implements ISceneLoaderPlugin {
+        static OPTIMIZE_WITH_UV: boolean;
+        extensions: string;
+        obj: RegExp;
+        group: RegExp;
+        mtllib: RegExp;
+        usemtl: RegExp;
+        smooth: RegExp;
+        vertexPattern: RegExp;
+        normalPattern: RegExp;
+        uvPattern: RegExp;
+        facePattern1: RegExp;
+        facePattern2: RegExp;
+        facePattern3: RegExp;
+        facePattern4: RegExp;
+        /**
+         * Calls synchronously the MTL file attached to this obj.
+         * Load function or importMesh function don't enable to load 2 files in the same time asynchronously.
+         * Without this function materials are not displayed in the first frame (but displayed after).
+         * In consequence it is impossible to get material information in your HTML file
+         *
+         * @param url The URL of the MTL file
+         * @param rootUrl
+         * @param onSuccess Callback function to be called when the MTL file is loaded
+         * @private
+         */
+        private _loadMTL(url, rootUrl, onSuccess);
+        importMesh(meshesNames: any, scene: Scene, data: any, rootUrl: string, meshes: AbstractMesh[], particleSystems: ParticleSystem[], skeletons: Skeleton[]): boolean;
+        load(scene: Scene, data: string, rootUrl: string): boolean;
+        /**
+         * Read the OBJ file and create an Array of meshes.
+         * Each mesh contains all information given by the OBJ and the MTL file.
+         * i.e. vertices positions and indices, optional normals values, optional UV values, optional material
+         *
+         * @param meshesNames
+         * @param scene BABYLON.Scene The scene where are displayed the data
+         * @param data String The content of the obj file
+         * @param rootUrl String The path to the folder
+         * @returns Array<AbstractMesh>
+         * @private
+         */
+        private _parseSolid(meshesNames, scene, data, rootUrl);
+    }
+}

+ 13 - 0
dist/preview release/loaders/babylon.stlFileLoader.d.ts

@@ -0,0 +1,13 @@
+/// <reference path="../../../dist/preview release/babylon.d.ts" />
+declare module BABYLON {
+    class STLFileLoader implements ISceneLoaderPlugin {
+        solidPattern: RegExp;
+        facetsPattern: RegExp;
+        normalPattern: RegExp;
+        vertexPattern: RegExp;
+        extensions: string;
+        importMesh(meshesNames: any, scene: Scene, data: any, rootUrl: string, meshes: AbstractMesh[], particleSystems: ParticleSystem[], skeletons: Skeleton[]): boolean;
+        load(scene: Scene, data: string, rootUrl: string): boolean;
+        private parseSolid(mesh, solidData);
+    }
+}

+ 28 - 0
dist/preview release/materialsLibrary/babylon.fireMaterial.d.ts

@@ -0,0 +1,28 @@
+/// <reference path="../../../dist/preview release/babylon.d.ts" />
+declare module BABYLON {
+    class FireMaterial extends Material {
+        diffuseTexture: BaseTexture;
+        distortionTexture: BaseTexture;
+        opacityTexture: BaseTexture;
+        diffuseColor: Color3;
+        speed: number;
+        private _scaledDiffuse;
+        private _renderId;
+        private _defines;
+        private _cachedDefines;
+        private _lastTime;
+        constructor(name: string, scene: Scene);
+        needAlphaBlending(): boolean;
+        needAlphaTesting(): boolean;
+        getAlphaTestTexture(): BaseTexture;
+        private _checkCache(scene, mesh?, useInstances?);
+        isReady(mesh?: AbstractMesh, useInstances?: boolean): boolean;
+        bindOnlyWorldMatrix(world: Matrix): void;
+        bind(world: Matrix, mesh?: Mesh): void;
+        getAnimatables(): IAnimatable[];
+        dispose(forceDisposeEffect?: boolean): void;
+        clone(name: string): FireMaterial;
+        serialize(): any;
+        static Parse(source: any, scene: Scene, rootUrl: string): FireMaterial;
+    }
+}

+ 43 - 0
dist/preview release/materialsLibrary/babylon.furMaterial.d.ts

@@ -0,0 +1,43 @@
+/// <reference path="../../../dist/preview release/babylon.d.ts" />
+declare module BABYLON {
+    class FurMaterial extends Material {
+        diffuseTexture: BaseTexture;
+        heightTexture: BaseTexture;
+        diffuseColor: Color3;
+        furLength: number;
+        furAngle: number;
+        furColor: Color3;
+        furOffset: number;
+        furSpacing: number;
+        furGravity: Vector3;
+        furSpeed: number;
+        furDensity: number;
+        furTexture: DynamicTexture;
+        disableLighting: boolean;
+        highLevelFur: boolean;
+        maxSimultaneousLights: number;
+        _meshes: AbstractMesh[];
+        private _worldViewProjectionMatrix;
+        private _renderId;
+        private _furTime;
+        private _defines;
+        private _cachedDefines;
+        constructor(name: string, scene: Scene);
+        furTime: number;
+        needAlphaBlending(): boolean;
+        needAlphaTesting(): boolean;
+        getAlphaTestTexture(): BaseTexture;
+        updateFur(): void;
+        private _checkCache(scene, mesh?, useInstances?);
+        isReady(mesh?: AbstractMesh, useInstances?: boolean): boolean;
+        bindOnlyWorldMatrix(world: Matrix): void;
+        bind(world: Matrix, mesh?: Mesh): void;
+        getAnimatables(): IAnimatable[];
+        dispose(forceDisposeEffect?: boolean): void;
+        clone(name: string): FurMaterial;
+        serialize(): any;
+        static Parse(source: any, scene: Scene, rootUrl: string): FurMaterial;
+        static GenerateTexture(name: string, scene: Scene): DynamicTexture;
+        static FurifyMesh(sourceMesh: Mesh, quality: number): Mesh[];
+    }
+}

+ 30 - 0
dist/preview release/materialsLibrary/babylon.gradientMaterial.d.ts

@@ -0,0 +1,30 @@
+/// <reference path="../../../dist/preview release/babylon.d.ts" />
+declare module BABYLON {
+    class GradientMaterial extends Material {
+        topColor: Color3;
+        topColorAlpha: number;
+        bottomColor: Color3;
+        bottomColorAlpha: number;
+        offset: number;
+        smoothness: number;
+        disableLighting: boolean;
+        private _worldViewProjectionMatrix;
+        private _scaledDiffuse;
+        private _renderId;
+        private _defines;
+        private _cachedDefines;
+        constructor(name: string, scene: Scene);
+        needAlphaBlending(): boolean;
+        needAlphaTesting(): boolean;
+        getAlphaTestTexture(): BaseTexture;
+        private _checkCache(scene, mesh?, useInstances?);
+        isReady(mesh?: AbstractMesh, useInstances?: boolean): boolean;
+        bindOnlyWorldMatrix(world: Matrix): void;
+        bind(world: Matrix, mesh?: Mesh): void;
+        getAnimatables(): IAnimatable[];
+        dispose(forceDisposeEffect?: boolean): void;
+        clone(name: string): GradientMaterial;
+        serialize(): any;
+        static Parse(source: any, scene: Scene, rootUrl: string): GradientMaterial;
+    }
+}

+ 55 - 0
dist/preview release/materialsLibrary/babylon.gridMaterial.d.ts

@@ -0,0 +1,55 @@
+/// <reference path="../../../dist/preview release/babylon.d.ts" />
+declare module BABYLON {
+    /**
+     * The grid materials allows you to wrap any shape with a grid.
+     * Colors are customizable.
+     */
+    class GridMaterial extends BABYLON.Material {
+        /**
+         * Main color of the grid (e.g. between lines)
+         */
+        mainColor: Color3;
+        /**
+         * Color of the grid lines.
+         */
+        lineColor: Color3;
+        /**
+         * The scale of the grid compared to unit.
+         */
+        gridRatio: number;
+        /**
+         * The frequency of thicker lines.
+         */
+        majorUnitFrequency: number;
+        /**
+         * The visibility of minor units in the grid.
+         */
+        minorUnitVisibility: number;
+        /**
+         * The grid opacity outside of the lines.
+         */
+        opacity: number;
+        private _gridControl;
+        private _renderId;
+        private _defines;
+        private _cachedDefines;
+        /**
+         * constructor
+         * @param name The name given to the material in order to identify it afterwards.
+         * @param scene The scene the material is used in.
+         */
+        constructor(name: string, scene: Scene);
+        /**
+         * Returns wehter or not the grid requires alpha blending.
+         */
+        needAlphaBlending(): boolean;
+        private _checkCache(scene, mesh?, useInstances?);
+        isReady(mesh?: AbstractMesh, useInstances?: boolean): boolean;
+        bindOnlyWorldMatrix(world: Matrix): void;
+        bind(world: Matrix, mesh?: Mesh): void;
+        dispose(forceDisposeEffect?: boolean): void;
+        clone(name: string): GridMaterial;
+        serialize(): any;
+        static Parse(source: any, scene: Scene, rootUrl: string): GridMaterial;
+    }
+}

+ 34 - 0
dist/preview release/materialsLibrary/babylon.lavaMaterial.d.ts

@@ -0,0 +1,34 @@
+/// <reference path="../../../dist/preview release/babylon.d.ts" />
+declare module BABYLON {
+    class LavaMaterial extends Material {
+        diffuseTexture: BaseTexture;
+        noiseTexture: BaseTexture;
+        fogColor: Color3;
+        speed: number;
+        movingSpeed: number;
+        lowFrequencySpeed: number;
+        fogDensity: number;
+        private _lastTime;
+        diffuseColor: Color3;
+        disableLighting: boolean;
+        maxSimultaneousLights: number;
+        private _worldViewProjectionMatrix;
+        private _scaledDiffuse;
+        private _renderId;
+        private _defines;
+        private _cachedDefines;
+        constructor(name: string, scene: Scene);
+        needAlphaBlending(): boolean;
+        needAlphaTesting(): boolean;
+        getAlphaTestTexture(): BaseTexture;
+        private _checkCache(scene, mesh?, useInstances?);
+        isReady(mesh?: AbstractMesh, useInstances?: boolean): boolean;
+        bindOnlyWorldMatrix(world: Matrix): void;
+        bind(world: Matrix, mesh?: Mesh): void;
+        getAnimatables(): IAnimatable[];
+        dispose(forceDisposeEffect?: boolean): void;
+        clone(name: string): LavaMaterial;
+        serialize(): any;
+        static Parse(source: any, scene: Scene, rootUrl: string): LavaMaterial;
+    }
+}

+ 26 - 0
dist/preview release/materialsLibrary/babylon.normalMaterial.d.ts

@@ -0,0 +1,26 @@
+/// <reference path="../../../dist/preview release/babylon.d.ts" />
+declare module BABYLON {
+    class NormalMaterial extends Material {
+        diffuseTexture: BaseTexture;
+        diffuseColor: Color3;
+        disableLighting: boolean;
+        private _worldViewProjectionMatrix;
+        private _scaledDiffuse;
+        private _renderId;
+        private _defines;
+        private _cachedDefines;
+        constructor(name: string, scene: Scene);
+        needAlphaBlending(): boolean;
+        needAlphaTesting(): boolean;
+        getAlphaTestTexture(): BaseTexture;
+        private _checkCache(scene, mesh?, useInstances?);
+        isReady(mesh?: AbstractMesh, useInstances?: boolean): boolean;
+        bindOnlyWorldMatrix(world: Matrix): void;
+        bind(world: Matrix, mesh?: Mesh): void;
+        getAnimatables(): IAnimatable[];
+        dispose(forceDisposeEffect?: boolean): void;
+        clone(name: string): NormalMaterial;
+        serialize(): any;
+        static Parse(source: any, scene: Scene, rootUrl: string): NormalMaterial;
+    }
+}

+ 27 - 0
dist/preview release/materialsLibrary/babylon.simpleMaterial.d.ts

@@ -0,0 +1,27 @@
+/// <reference path="../../../dist/preview release/babylon.d.ts" />
+declare module BABYLON {
+    class SimpleMaterial extends Material {
+        diffuseTexture: BaseTexture;
+        diffuseColor: Color3;
+        disableLighting: boolean;
+        maxSimultaneousLights: number;
+        private _worldViewProjectionMatrix;
+        private _scaledDiffuse;
+        private _renderId;
+        private _defines;
+        private _cachedDefines;
+        constructor(name: string, scene: Scene);
+        needAlphaBlending(): boolean;
+        needAlphaTesting(): boolean;
+        getAlphaTestTexture(): BaseTexture;
+        private _checkCache(scene, mesh?, useInstances?);
+        isReady(mesh?: AbstractMesh, useInstances?: boolean): boolean;
+        bindOnlyWorldMatrix(world: Matrix): void;
+        bind(world: Matrix, mesh?: Mesh): void;
+        getAnimatables(): IAnimatable[];
+        dispose(forceDisposeEffect?: boolean): void;
+        clone(name: string): SimpleMaterial;
+        serialize(): any;
+        static Parse(source: any, scene: Scene, rootUrl: string): SimpleMaterial;
+    }
+}

+ 32 - 0
dist/preview release/materialsLibrary/babylon.skyMaterial.d.ts

@@ -0,0 +1,32 @@
+/// <reference path="../../../dist/preview release/babylon.d.ts" />
+declare module BABYLON {
+    class SkyMaterial extends Material {
+        luminance: number;
+        turbidity: number;
+        rayleigh: number;
+        mieCoefficient: number;
+        mieDirectionalG: number;
+        distance: number;
+        inclination: number;
+        azimuth: number;
+        sunPosition: Vector3;
+        useSunPosition: boolean;
+        private _cameraPosition;
+        private _renderId;
+        private _defines;
+        private _cachedDefines;
+        constructor(name: string, scene: Scene);
+        needAlphaBlending(): boolean;
+        needAlphaTesting(): boolean;
+        getAlphaTestTexture(): BaseTexture;
+        private _checkCache(scene, mesh?, useInstances?);
+        isReady(mesh?: AbstractMesh, useInstances?: boolean): boolean;
+        bindOnlyWorldMatrix(world: Matrix): void;
+        bind(world: Matrix, mesh?: Mesh): void;
+        getAnimatables(): IAnimatable[];
+        dispose(forceDisposeEffect?: boolean): void;
+        clone(name: string): SkyMaterial;
+        serialize(): any;
+        static Parse(source: any, scene: Scene, rootUrl: string): SkyMaterial;
+    }
+}

+ 34 - 0
dist/preview release/materialsLibrary/babylon.terrainMaterial.d.ts

@@ -0,0 +1,34 @@
+/// <reference path="../../../dist/preview release/babylon.d.ts" />
+declare module BABYLON {
+    class TerrainMaterial extends Material {
+        mixTexture: BaseTexture;
+        diffuseTexture1: Texture;
+        diffuseTexture2: Texture;
+        diffuseTexture3: Texture;
+        bumpTexture1: Texture;
+        bumpTexture2: Texture;
+        bumpTexture3: Texture;
+        diffuseColor: Color3;
+        specularColor: Color3;
+        specularPower: number;
+        disableLighting: boolean;
+        maxSimultaneousLights: number;
+        private _worldViewProjectionMatrix;
+        private _renderId;
+        private _defines;
+        private _cachedDefines;
+        constructor(name: string, scene: Scene);
+        needAlphaBlending(): boolean;
+        needAlphaTesting(): boolean;
+        getAlphaTestTexture(): BaseTexture;
+        private _checkCache(scene, mesh?, useInstances?);
+        isReady(mesh?: AbstractMesh, useInstances?: boolean): boolean;
+        bindOnlyWorldMatrix(world: Matrix): void;
+        bind(world: Matrix, mesh?: Mesh): void;
+        getAnimatables(): IAnimatable[];
+        dispose(forceDisposeEffect?: boolean): void;
+        clone(name: string): TerrainMaterial;
+        serialize(): any;
+        static Parse(source: any, scene: Scene, rootUrl: string): TerrainMaterial;
+    }
+}

+ 35 - 0
dist/preview release/materialsLibrary/babylon.triPlanarMaterial.d.ts

@@ -0,0 +1,35 @@
+/// <reference path="../../../dist/preview release/babylon.d.ts" />
+declare module BABYLON {
+    class TriPlanarMaterial extends Material {
+        mixTexture: BaseTexture;
+        diffuseTextureX: Texture;
+        diffuseTextureY: Texture;
+        diffuseTextureZ: Texture;
+        normalTextureX: Texture;
+        normalTextureY: Texture;
+        normalTextureZ: Texture;
+        tileSize: number;
+        diffuseColor: Color3;
+        specularColor: Color3;
+        specularPower: number;
+        disableLighting: boolean;
+        maxSimultaneousLights: number;
+        private _worldViewProjectionMatrix;
+        private _renderId;
+        private _defines;
+        private _cachedDefines;
+        constructor(name: string, scene: Scene);
+        needAlphaBlending(): boolean;
+        needAlphaTesting(): boolean;
+        getAlphaTestTexture(): BaseTexture;
+        private _checkCache(scene, mesh?, useInstances?);
+        isReady(mesh?: AbstractMesh, useInstances?: boolean): boolean;
+        bindOnlyWorldMatrix(world: Matrix): void;
+        bind(world: Matrix, mesh?: Mesh): void;
+        getAnimatables(): IAnimatable[];
+        dispose(forceDisposeEffect?: boolean): void;
+        clone(name: string): TriPlanarMaterial;
+        serialize(): any;
+        static Parse(source: any, scene: Scene, rootUrl: string): TriPlanarMaterial;
+    }
+}

+ 100 - 0
dist/preview release/materialsLibrary/babylon.waterMaterial.d.ts

@@ -0,0 +1,100 @@
+/// <reference path="../../../dist/preview release/babylon.d.ts" />
+/// <reference path="../simple/babylon.simpleMaterial.d.ts" />
+declare module BABYLON {
+    class WaterMaterial extends Material {
+        renderTargetSize: Vector2;
+        bumpTexture: BaseTexture;
+        diffuseColor: Color3;
+        specularColor: Color3;
+        specularPower: number;
+        disableLighting: boolean;
+        maxSimultaneousLights: number;
+        /**
+        * @param {number}: Represents the wind force
+        */
+        windForce: number;
+        /**
+        * @param {Vector2}: The direction of the wind in the plane (X, Z)
+        */
+        windDirection: Vector2;
+        /**
+        * @param {number}: Wave height, represents the height of the waves
+        */
+        waveHeight: number;
+        /**
+        * @param {number}: Bump height, represents the bump height related to the bump map
+        */
+        bumpHeight: number;
+        /**
+         * @param {boolean}: Add a smaller moving bump to less steady waves.
+         */
+        bumpSuperimpose: boolean;
+        /**
+         * @param {boolean}: Color refraction and reflection differently with .waterColor2 and .colorBlendFactor2. Non-linear (physically correct) fresnel.
+         */
+        fresnelSeparate: boolean;
+        /**
+         * @param {boolean}: bump Waves modify the reflection.
+         */
+        bumpAffectsReflection: boolean;
+        /**
+        * @param {number}: The water color blended with the refraction (near)
+        */
+        waterColor: Color3;
+        /**
+        * @param {number}: The blend factor related to the water color
+        */
+        colorBlendFactor: number;
+        /**
+         * @param {number}: The water color blended with the reflection (far)
+         */
+        waterColor2: Color3;
+        /**
+         * @param {number}: The blend factor related to the water color (reflection, far)
+         */
+        colorBlendFactor2: number;
+        /**
+        * @param {number}: Represents the maximum length of a wave
+        */
+        waveLength: number;
+        /**
+        * @param {number}: Defines the waves speed
+        */
+        waveSpeed: number;
+        private _mesh;
+        private _refractionRTT;
+        private _reflectionRTT;
+        private _material;
+        private _reflectionTransform;
+        private _lastTime;
+        private _renderId;
+        private _defines;
+        private _cachedDefines;
+        private _useLogarithmicDepth;
+        /**
+        * Constructor
+        */
+        constructor(name: string, scene: Scene, renderTargetSize?: Vector2);
+        useLogarithmicDepth: boolean;
+        refractionTexture: RenderTargetTexture;
+        reflectionTexture: RenderTargetTexture;
+        addToRenderList(node: any): void;
+        enableRenderTargets(enable: boolean): void;
+        getRenderList(): AbstractMesh[];
+        renderTargetsEnabled: boolean;
+        needAlphaBlending(): boolean;
+        needAlphaTesting(): boolean;
+        getAlphaTestTexture(): BaseTexture;
+        private _checkCache(scene, mesh?, useInstances?);
+        isReady(mesh?: AbstractMesh, useInstances?: boolean): boolean;
+        bindOnlyWorldMatrix(world: Matrix): void;
+        bind(world: Matrix, mesh?: Mesh): void;
+        private _createRenderTargets(scene, renderTargetSize);
+        getAnimatables(): IAnimatable[];
+        dispose(forceDisposeEffect?: boolean): void;
+        clone(name: string): WaterMaterial;
+        serialize(): any;
+        static Parse(source: any, scene: Scene, rootUrl: string): WaterMaterial;
+        static CreateDefaultMesh(name: string, scene: Scene): Mesh;
+    }
+}

+ 102 - 0
dist/preview release/postProcessesLibrary/babylon.asciiArtPostProcess.d.ts

@@ -0,0 +1,102 @@
+/// <reference path="../../../dist/preview release/babylon.d.ts" />
+declare module BABYLON {
+    /**
+     * 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.
+     */
+    class AsciiArtFontTexture extends BaseTexture {
+        private _font;
+        private _text;
+        private _charSize;
+        /**
+         * Gets the size of one char in the texture (each char fits in size * size space in the texture).
+         */
+        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: Scene);
+        /**
+         * Gets the max char width of a font.
+         * @param font the font to use, use the W3C CSS notation
+         * @return the max char width
+         */
+        private getFontWidth(font);
+        /**
+         * Gets the max char height of a font.
+         * @param font the font to use, use the W3C CSS notation
+         * @return the max char height
+         */
+        private getFontHeight(font);
+        /**
+         * 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.
+     */
+    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);
+     */
+    class AsciiArtPostProcess extends PostProcess {
+        /**
+         * The font texture used to render the char in the post process.
+         */
+        private _asciiArtFontTexture;
+        /**
+         * 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);
+    }
+}

+ 98 - 0
dist/preview release/postProcessesLibrary/babylon.digitalRainPostProcess.d.ts

@@ -0,0 +1,98 @@
+/// <reference path="../../../dist/preview release/babylon.d.ts" />
+declare module BABYLON {
+    /**
+     * 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.
+     */
+    class DigitalRainFontTexture extends BaseTexture {
+        private _font;
+        private _text;
+        private _charSize;
+        /**
+         * Gets the size of one char in the texture (each char fits in size * size space in the texture).
+         */
+        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: Scene);
+        /**
+         * Gets the max char width of a font.
+         * @param font the font to use, use the W3C CSS notation
+         * @return the max char width
+         */
+        private getFontWidth(font);
+        /**
+         * Gets the max char height of a font.
+         * @param font the font to use, use the W3C CSS notation
+         * @return the max char height
+         */
+        private getFontHeight(font);
+        /**
+         * 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.
+     */
+    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);
+     */
+    class DigitalRainPostProcess extends PostProcess {
+        /**
+         * The font texture used to render the char in the post process.
+         */
+        private _digitalRainFontTexture;
+        /**
+         * 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);
+    }
+}

+ 15 - 0
dist/preview release/proceduralTexturesLibrary/babylon.brickProceduralTexture.d.ts

@@ -0,0 +1,15 @@
+/// <reference path="../../../dist/preview release/babylon.d.ts" />
+declare module BABYLON {
+    class BrickProceduralTexture extends ProceduralTexture {
+        private _numberOfBricksHeight;
+        private _numberOfBricksWidth;
+        private _jointColor;
+        private _brickColor;
+        constructor(name: string, size: number, scene: Scene, fallbackTexture?: Texture, generateMipMaps?: boolean);
+        updateShaderUniforms(): void;
+        numberOfBricksHeight: number;
+        numberOfBricksWidth: number;
+        jointColor: Color3;
+        brickColor: Color3;
+    }
+}

+ 11 - 0
dist/preview release/proceduralTexturesLibrary/babylon.cloudProceduralTexture.d.ts

@@ -0,0 +1,11 @@
+/// <reference path="../../../dist/preview release/babylon.d.ts" />
+declare module BABYLON {
+    class CloudProceduralTexture extends ProceduralTexture {
+        private _skyColor;
+        private _cloudColor;
+        constructor(name: string, size: number, scene: Scene, fallbackTexture?: Texture, generateMipMaps?: boolean);
+        updateShaderUniforms(): void;
+        skyColor: Color4;
+        cloudColor: Color4;
+    }
+}

+ 21 - 0
dist/preview release/proceduralTexturesLibrary/babylon.fireProceduralTexture.d.ts

@@ -0,0 +1,21 @@
+/// <reference path="../../../dist/preview release/babylon.d.ts" />
+declare module BABYLON {
+    class FireProceduralTexture extends ProceduralTexture {
+        private _time;
+        private _speed;
+        private _autoGenerateTime;
+        private _fireColors;
+        private _alphaThreshold;
+        constructor(name: string, size: number, scene: Scene, fallbackTexture?: Texture, generateMipMaps?: boolean);
+        updateShaderUniforms(): void;
+        render(useCameraPostProcess?: boolean): void;
+        static PurpleFireColors: Color3[];
+        static GreenFireColors: Color3[];
+        static RedFireColors: Color3[];
+        static BlueFireColors: Color3[];
+        fireColors: Color3[];
+        time: number;
+        speed: Vector2;
+        alphaThreshold: number;
+    }
+}

+ 14 - 0
dist/preview release/proceduralTexturesLibrary/babylon.grassProceduralTexture.d.ts

@@ -0,0 +1,14 @@
+/// <reference path="../../../dist/preview release/babylon.d.ts" />
+declare module BABYLON {
+    class GrassProceduralTexture extends ProceduralTexture {
+        private _grassColors;
+        private _herb1;
+        private _herb2;
+        private _herb3;
+        private _groundColor;
+        constructor(name: string, size: number, scene: Scene, fallbackTexture?: Texture, generateMipMaps?: boolean);
+        updateShaderUniforms(): void;
+        grassColors: Color3[];
+        groundColor: Color3;
+    }
+}

+ 15 - 0
dist/preview release/proceduralTexturesLibrary/babylon.marbleProceduralTexture.d.ts

@@ -0,0 +1,15 @@
+/// <reference path="../../../dist/preview release/babylon.d.ts" />
+declare module BABYLON {
+    class MarbleProceduralTexture extends ProceduralTexture {
+        private _numberOfTilesHeight;
+        private _numberOfTilesWidth;
+        private _amplitude;
+        private _jointColor;
+        constructor(name: string, size: number, scene: Scene, fallbackTexture?: Texture, generateMipMaps?: boolean);
+        updateShaderUniforms(): void;
+        numberOfTilesHeight: number;
+        amplitude: number;
+        numberOfTilesWidth: number;
+        jointColor: Color3;
+    }
+}

+ 9 - 0
dist/preview release/proceduralTexturesLibrary/babylon.roadProceduralTexture.d.ts

@@ -0,0 +1,9 @@
+/// <reference path="../../../dist/preview release/babylon.d.ts" />
+declare module BABYLON {
+    class RoadProceduralTexture extends ProceduralTexture {
+        private _roadColor;
+        constructor(name: string, size: number, scene: Scene, fallbackTexture?: Texture, generateMipMaps?: boolean);
+        updateShaderUniforms(): void;
+        roadColor: Color3;
+    }
+}

+ 29 - 0
dist/preview release/proceduralTexturesLibrary/babylon.starfieldProceduralTexture.d.ts

@@ -0,0 +1,29 @@
+/// <reference path="../../../dist/preview release/babylon.d.ts" />
+declare module BABYLON {
+    class StarfieldProceduralTexture extends ProceduralTexture {
+        private _time;
+        private _alpha;
+        private _beta;
+        private _zoom;
+        private _formuparam;
+        private _stepsize;
+        private _tile;
+        private _brightness;
+        private _darkmatter;
+        private _distfading;
+        private _saturation;
+        constructor(name: string, size: number, scene: Scene, fallbackTexture?: Texture, generateMipMaps?: boolean);
+        updateShaderUniforms(): void;
+        time: number;
+        alpha: number;
+        beta: number;
+        formuparam: number;
+        stepsize: number;
+        zoom: number;
+        tile: number;
+        brightness: number;
+        darkmatter: number;
+        distfading: number;
+        saturation: number;
+    }
+}

+ 11 - 0
dist/preview release/proceduralTexturesLibrary/babylon.woodProceduralTexture.d.ts

@@ -0,0 +1,11 @@
+/// <reference path="../../../dist/preview release/babylon.d.ts" />
+declare module BABYLON {
+    class WoodProceduralTexture extends ProceduralTexture {
+        private _ampScale;
+        private _woodColor;
+        constructor(name: string, size: number, scene: Scene, fallbackTexture?: Texture, generateMipMaps?: boolean);
+        updateShaderUniforms(): void;
+        ampScale: number;
+        woodColor: Color3;
+    }
+}

+ 7 - 0
dist/preview release/serializers/babylon.objSerializer.d.ts

@@ -0,0 +1,7 @@
+/// <reference path="../../../dist/preview release/babylon.d.ts" />
+declare module BABYLON {
+    class OBJExport {
+        static OBJ(mesh: Mesh, materials?: boolean, matlibname?: string): string;
+        static MTL(mesh: Mesh): string;
+    }
+}