소스 검색

Fixing gulp for module exports
Integrating latest PR (in 2.1)

David Catuhe 10 년 전
부모
커밋
fb93561c10
70개의 변경된 파일261개의 추가작업 그리고 172개의 파일을 삭제
  1. 1 1
      Babylon/Actions/babylon.condition.js
  2. 1 1
      Babylon/Actions/babylon.directActions.js
  3. 1 1
      Babylon/Actions/babylon.interpolateValueAction.js
  4. 1 1
      Babylon/Animations/babylon.easing.js
  5. 1 1
      Babylon/Cameras/VR/babylon.vrDeviceOrientationCamera.js
  6. 1 1
      Babylon/Cameras/VR/babylon.webVRCamera.js
  7. 1 1
      Babylon/Cameras/babylon.arcRotateCamera.js
  8. 1 1
      Babylon/Cameras/babylon.camera.js
  9. 1 1
      Babylon/Cameras/babylon.deviceOrientationCamera.js
  10. 1 1
      Babylon/Cameras/babylon.followCamera.js
  11. 1 1
      Babylon/Cameras/babylon.freeCamera.js
  12. 1 1
      Babylon/Cameras/babylon.gamepadCamera.js
  13. 1 1
      Babylon/Cameras/babylon.stereoscopicCameras.js
  14. 1 1
      Babylon/Cameras/babylon.targetCamera.js
  15. 1 1
      Babylon/Cameras/babylon.touchCamera.js
  16. 1 1
      Babylon/Cameras/babylon.virtualJoysticksCamera.js
  17. 1 1
      Babylon/Lights/babylon.directionalLight.js
  18. 1 1
      Babylon/Lights/babylon.hemisphericLight.js
  19. 1 1
      Babylon/Lights/babylon.light.js
  20. 1 1
      Babylon/Lights/babylon.pointLight.js
  21. 1 1
      Babylon/Lights/babylon.spotLight.js
  22. 1 1
      Babylon/Materials/Textures/Procedurals/babylon.customProceduralTexture.js
  23. 1 1
      Babylon/Materials/Textures/Procedurals/babylon.proceduralTexture.js
  24. 1 1
      Babylon/Materials/Textures/Procedurals/babylon.standardProceduralTexture.js
  25. 1 1
      Babylon/Materials/Textures/babylon.cubeTexture.js
  26. 1 1
      Babylon/Materials/Textures/babylon.dynamicTexture.js
  27. 1 1
      Babylon/Materials/Textures/babylon.mirrorTexture.js
  28. 1 1
      Babylon/Materials/Textures/babylon.rawTexture.js
  29. 1 1
      Babylon/Materials/Textures/babylon.renderTargetTexture.js
  30. 1 1
      Babylon/Materials/Textures/babylon.texture.js
  31. 1 1
      Babylon/Materials/Textures/babylon.videoTexture.js
  32. 1 1
      Babylon/Materials/babylon.multiMaterial.js
  33. 1 1
      Babylon/Materials/babylon.shaderMaterial.js
  34. 1 1
      Babylon/Materials/babylon.standardMaterial.js
  35. 1 1
      Babylon/Mesh/babylon.abstractMesh.js
  36. 1 1
      Babylon/Mesh/babylon.geometry.js
  37. 1 1
      Babylon/Mesh/babylon.groundMesh.js
  38. 1 1
      Babylon/Mesh/babylon.instancedMesh.js
  39. 1 1
      Babylon/Mesh/babylon.linesMesh.js
  40. 5 5
      Babylon/Mesh/babylon.mesh.js
  41. 1 1
      Babylon/Mesh/babylon.polygonmesh.js
  42. 1 1
      Babylon/PostProcess/babylon.anaglyphPostProcess.js
  43. 1 1
      Babylon/PostProcess/babylon.blackAndWhitePostProcess.js
  44. 1 1
      Babylon/PostProcess/babylon.blurPostProcess.js
  45. 1 1
      Babylon/PostProcess/babylon.colorCorrectionPostProcess.js
  46. 1 1
      Babylon/PostProcess/babylon.convolutionPostProcess.js
  47. 1 1
      Babylon/PostProcess/babylon.displayPassPostProcess.js
  48. 1 1
      Babylon/PostProcess/babylon.filterPostProcess.js
  49. 1 1
      Babylon/PostProcess/babylon.fxaaPostProcess.js
  50. 20 14
      Babylon/PostProcess/babylon.lensRenderingPipeline.js
  51. 3 3
      Babylon/PostProcess/babylon.lensRenderingPipeline.ts
  52. 1 1
      Babylon/PostProcess/babylon.passPostProcess.js
  53. 1 1
      Babylon/PostProcess/babylon.refractionPostProcess.js
  54. 1 1
      Babylon/PostProcess/babylon.ssaoRenderingPipeline.js
  55. 1 1
      Babylon/PostProcess/babylon.stereoscopicInterlacePostProcess.js
  56. 23 7
      Babylon/PostProcess/babylon.volumetricLightScatteringPostProcess.js
  57. 20 6
      Babylon/PostProcess/babylon.volumetricLightScatteringPostProcess.ts
  58. 1 1
      Babylon/PostProcess/babylon.vrDistortionCorrectionPostProcess.js
  59. 8 8
      Babylon/Shaders/depthOfField.fragment.fx
  60. 12 3
      Babylon/Shaders/volumetricLightScatteringPass.fragment.fx
  61. 1 1
      Babylon/Tools/babylon.gamepads.js
  62. 1 1
      Babylon/Tools/babylon.sceneOptimizer.js
  63. 5 5
      Preview release/babylon.2.2.js
  64. 47 25
      Preview release/babylon.2.2.max.js
  65. 4 4
      Preview release/babylon.2.2.noworker.js
  66. 1 1
      Preview release/what's new.md
  67. 2 2
      Tools/Gulp/gulp-addModuleExports.js
  68. 47 25
      babylon.2.1.debug.js
  69. 5 5
      babylon.2.1.js
  70. 4 4
      babylon.2.1.noworker.js

+ 1 - 1
Babylon/Actions/babylon.condition.js

@@ -1,4 +1,4 @@
-var __extends = (this && this.__extends) || function (d, b) {
+var __extends = this.__extends || function (d, b) {
     for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
     function __() { this.constructor = d; }
     __.prototype = b.prototype;

+ 1 - 1
Babylon/Actions/babylon.directActions.js

@@ -1,4 +1,4 @@
-var __extends = (this && this.__extends) || function (d, b) {
+var __extends = this.__extends || function (d, b) {
     for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
     function __() { this.constructor = d; }
     __.prototype = b.prototype;

+ 1 - 1
Babylon/Actions/babylon.interpolateValueAction.js

@@ -1,4 +1,4 @@
-var __extends = (this && this.__extends) || function (d, b) {
+var __extends = this.__extends || function (d, b) {
     for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
     function __() { this.constructor = d; }
     __.prototype = b.prototype;

+ 1 - 1
Babylon/Animations/babylon.easing.js

@@ -1,4 +1,4 @@
-var __extends = (this && this.__extends) || function (d, b) {
+var __extends = this.__extends || function (d, b) {
     for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
     function __() { this.constructor = d; }
     __.prototype = b.prototype;

+ 1 - 1
Babylon/Cameras/VR/babylon.vrDeviceOrientationCamera.js

@@ -1,4 +1,4 @@
-var __extends = (this && this.__extends) || function (d, b) {
+var __extends = this.__extends || function (d, b) {
     for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
     function __() { this.constructor = d; }
     __.prototype = b.prototype;

+ 1 - 1
Babylon/Cameras/VR/babylon.webVRCamera.js

@@ -1,4 +1,4 @@
-var __extends = (this && this.__extends) || function (d, b) {
+var __extends = this.__extends || function (d, b) {
     for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
     function __() { this.constructor = d; }
     __.prototype = b.prototype;

+ 1 - 1
Babylon/Cameras/babylon.arcRotateCamera.js

@@ -1,4 +1,4 @@
-var __extends = (this && this.__extends) || function (d, b) {
+var __extends = this.__extends || function (d, b) {
     for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
     function __() { this.constructor = d; }
     __.prototype = b.prototype;

+ 1 - 1
Babylon/Cameras/babylon.camera.js

@@ -1,4 +1,4 @@
-var __extends = (this && this.__extends) || function (d, b) {
+var __extends = this.__extends || function (d, b) {
     for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
     function __() { this.constructor = d; }
     __.prototype = b.prototype;

+ 1 - 1
Babylon/Cameras/babylon.deviceOrientationCamera.js

@@ -1,4 +1,4 @@
-var __extends = (this && this.__extends) || function (d, b) {
+var __extends = this.__extends || function (d, b) {
     for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
     function __() { this.constructor = d; }
     __.prototype = b.prototype;

+ 1 - 1
Babylon/Cameras/babylon.followCamera.js

@@ -1,4 +1,4 @@
-var __extends = (this && this.__extends) || function (d, b) {
+var __extends = this.__extends || function (d, b) {
     for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
     function __() { this.constructor = d; }
     __.prototype = b.prototype;

+ 1 - 1
Babylon/Cameras/babylon.freeCamera.js

@@ -1,4 +1,4 @@
-var __extends = (this && this.__extends) || function (d, b) {
+var __extends = this.__extends || function (d, b) {
     for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
     function __() { this.constructor = d; }
     __.prototype = b.prototype;

+ 1 - 1
Babylon/Cameras/babylon.gamepadCamera.js

@@ -1,4 +1,4 @@
-var __extends = (this && this.__extends) || function (d, b) {
+var __extends = this.__extends || function (d, b) {
     for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
     function __() { this.constructor = d; }
     __.prototype = b.prototype;

+ 1 - 1
Babylon/Cameras/babylon.stereoscopicCameras.js

@@ -1,4 +1,4 @@
-var __extends = (this && this.__extends) || function (d, b) {
+var __extends = this.__extends || function (d, b) {
     for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
     function __() { this.constructor = d; }
     __.prototype = b.prototype;

+ 1 - 1
Babylon/Cameras/babylon.targetCamera.js

@@ -1,4 +1,4 @@
-var __extends = (this && this.__extends) || function (d, b) {
+var __extends = this.__extends || function (d, b) {
     for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
     function __() { this.constructor = d; }
     __.prototype = b.prototype;

+ 1 - 1
Babylon/Cameras/babylon.touchCamera.js

@@ -1,4 +1,4 @@
-var __extends = (this && this.__extends) || function (d, b) {
+var __extends = this.__extends || function (d, b) {
     for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
     function __() { this.constructor = d; }
     __.prototype = b.prototype;

+ 1 - 1
Babylon/Cameras/babylon.virtualJoysticksCamera.js

@@ -1,4 +1,4 @@
-var __extends = (this && this.__extends) || function (d, b) {
+var __extends = this.__extends || function (d, b) {
     for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
     function __() { this.constructor = d; }
     __.prototype = b.prototype;

+ 1 - 1
Babylon/Lights/babylon.directionalLight.js

@@ -1,4 +1,4 @@
-var __extends = (this && this.__extends) || function (d, b) {
+var __extends = this.__extends || function (d, b) {
     for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
     function __() { this.constructor = d; }
     __.prototype = b.prototype;

+ 1 - 1
Babylon/Lights/babylon.hemisphericLight.js

@@ -1,4 +1,4 @@
-var __extends = (this && this.__extends) || function (d, b) {
+var __extends = this.__extends || function (d, b) {
     for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
     function __() { this.constructor = d; }
     __.prototype = b.prototype;

+ 1 - 1
Babylon/Lights/babylon.light.js

@@ -1,4 +1,4 @@
-var __extends = (this && this.__extends) || function (d, b) {
+var __extends = this.__extends || function (d, b) {
     for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
     function __() { this.constructor = d; }
     __.prototype = b.prototype;

+ 1 - 1
Babylon/Lights/babylon.pointLight.js

@@ -1,4 +1,4 @@
-var __extends = (this && this.__extends) || function (d, b) {
+var __extends = this.__extends || function (d, b) {
     for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
     function __() { this.constructor = d; }
     __.prototype = b.prototype;

+ 1 - 1
Babylon/Lights/babylon.spotLight.js

@@ -1,4 +1,4 @@
-var __extends = (this && this.__extends) || function (d, b) {
+var __extends = this.__extends || function (d, b) {
     for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
     function __() { this.constructor = d; }
     __.prototype = b.prototype;

+ 1 - 1
Babylon/Materials/Textures/Procedurals/babylon.customProceduralTexture.js

@@ -1,4 +1,4 @@
-var __extends = (this && this.__extends) || function (d, b) {
+var __extends = this.__extends || function (d, b) {
     for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
     function __() { this.constructor = d; }
     __.prototype = b.prototype;

+ 1 - 1
Babylon/Materials/Textures/Procedurals/babylon.proceduralTexture.js

@@ -1,4 +1,4 @@
-var __extends = (this && this.__extends) || function (d, b) {
+var __extends = this.__extends || function (d, b) {
     for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
     function __() { this.constructor = d; }
     __.prototype = b.prototype;

+ 1 - 1
Babylon/Materials/Textures/Procedurals/babylon.standardProceduralTexture.js

@@ -1,4 +1,4 @@
-var __extends = (this && this.__extends) || function (d, b) {
+var __extends = this.__extends || function (d, b) {
     for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
     function __() { this.constructor = d; }
     __.prototype = b.prototype;

+ 1 - 1
Babylon/Materials/Textures/babylon.cubeTexture.js

@@ -1,4 +1,4 @@
-var __extends = (this && this.__extends) || function (d, b) {
+var __extends = this.__extends || function (d, b) {
     for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
     function __() { this.constructor = d; }
     __.prototype = b.prototype;

+ 1 - 1
Babylon/Materials/Textures/babylon.dynamicTexture.js

@@ -1,4 +1,4 @@
-var __extends = (this && this.__extends) || function (d, b) {
+var __extends = this.__extends || function (d, b) {
     for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
     function __() { this.constructor = d; }
     __.prototype = b.prototype;

+ 1 - 1
Babylon/Materials/Textures/babylon.mirrorTexture.js

@@ -1,4 +1,4 @@
-var __extends = (this && this.__extends) || function (d, b) {
+var __extends = this.__extends || function (d, b) {
     for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
     function __() { this.constructor = d; }
     __.prototype = b.prototype;

+ 1 - 1
Babylon/Materials/Textures/babylon.rawTexture.js

@@ -1,4 +1,4 @@
-var __extends = (this && this.__extends) || function (d, b) {
+var __extends = this.__extends || function (d, b) {
     for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
     function __() { this.constructor = d; }
     __.prototype = b.prototype;

+ 1 - 1
Babylon/Materials/Textures/babylon.renderTargetTexture.js

@@ -1,4 +1,4 @@
-var __extends = (this && this.__extends) || function (d, b) {
+var __extends = this.__extends || function (d, b) {
     for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
     function __() { this.constructor = d; }
     __.prototype = b.prototype;

+ 1 - 1
Babylon/Materials/Textures/babylon.texture.js

@@ -1,4 +1,4 @@
-var __extends = (this && this.__extends) || function (d, b) {
+var __extends = this.__extends || function (d, b) {
     for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
     function __() { this.constructor = d; }
     __.prototype = b.prototype;

+ 1 - 1
Babylon/Materials/Textures/babylon.videoTexture.js

@@ -1,4 +1,4 @@
-var __extends = (this && this.__extends) || function (d, b) {
+var __extends = this.__extends || function (d, b) {
     for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
     function __() { this.constructor = d; }
     __.prototype = b.prototype;

+ 1 - 1
Babylon/Materials/babylon.multiMaterial.js

@@ -1,4 +1,4 @@
-var __extends = (this && this.__extends) || function (d, b) {
+var __extends = this.__extends || function (d, b) {
     for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
     function __() { this.constructor = d; }
     __.prototype = b.prototype;

+ 1 - 1
Babylon/Materials/babylon.shaderMaterial.js

@@ -1,4 +1,4 @@
-var __extends = (this && this.__extends) || function (d, b) {
+var __extends = this.__extends || function (d, b) {
     for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
     function __() { this.constructor = d; }
     __.prototype = b.prototype;

+ 1 - 1
Babylon/Materials/babylon.standardMaterial.js

@@ -1,4 +1,4 @@
-var __extends = (this && this.__extends) || function (d, b) {
+var __extends = this.__extends || function (d, b) {
     for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
     function __() { this.constructor = d; }
     __.prototype = b.prototype;

+ 1 - 1
Babylon/Mesh/babylon.abstractMesh.js

@@ -1,4 +1,4 @@
-var __extends = (this && this.__extends) || function (d, b) {
+var __extends = this.__extends || function (d, b) {
     for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
     function __() { this.constructor = d; }
     __.prototype = b.prototype;

+ 1 - 1
Babylon/Mesh/babylon.geometry.js

@@ -1,4 +1,4 @@
-var __extends = (this && this.__extends) || function (d, b) {
+var __extends = this.__extends || function (d, b) {
     for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
     function __() { this.constructor = d; }
     __.prototype = b.prototype;

+ 1 - 1
Babylon/Mesh/babylon.groundMesh.js

@@ -1,4 +1,4 @@
-var __extends = (this && this.__extends) || function (d, b) {
+var __extends = this.__extends || function (d, b) {
     for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
     function __() { this.constructor = d; }
     __.prototype = b.prototype;

+ 1 - 1
Babylon/Mesh/babylon.instancedMesh.js

@@ -1,4 +1,4 @@
-var __extends = (this && this.__extends) || function (d, b) {
+var __extends = this.__extends || function (d, b) {
     for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
     function __() { this.constructor = d; }
     __.prototype = b.prototype;

+ 1 - 1
Babylon/Mesh/babylon.linesMesh.js

@@ -1,4 +1,4 @@
-var __extends = (this && this.__extends) || function (d, b) {
+var __extends = this.__extends || function (d, b) {
     for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
     function __() { this.constructor = d; }
     __.prototype = b.prototype;

+ 5 - 5
Babylon/Mesh/babylon.mesh.js

@@ -1,4 +1,4 @@
-var __extends = (this && this.__extends) || function (d, b) {
+var __extends = this.__extends || function (d, b) {
     for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
     function __() { this.constructor = d; }
     __.prototype = b.prototype;
@@ -323,7 +323,7 @@ var BABYLON;
         Mesh.prototype.unfreezeNormals = function () {
             this._areNormalsFrozen = false;
         };
-        // Methods  
+        // Methods
         Mesh.prototype._preActivate = function () {
             var sceneRenderId = this.getScene().getRenderId();
             if (this._preActivateId === sceneRenderId) {
@@ -802,7 +802,7 @@ var BABYLON;
             }
             return true;
         };
-        // Clone 
+        // Clone
         Mesh.prototype.clone = function (name, newParent, doNotCloneChildren) {
             return new Mesh(name, this.getScene(), newParent, this, doNotCloneChildren);
         };
@@ -1347,7 +1347,7 @@ var BABYLON;
                 canvas.height = heightMapHeight;
                 context.drawImage(img, 0, 0);
                 // Create VertexData from map data
-                // Cast is due to wrong definition in lib.d.ts from ts 1.3 - https://github.com/Microsoft/TypeScript/issues/949 
+                // Cast is due to wrong definition in lib.d.ts from ts 1.3 - https://github.com/Microsoft/TypeScript/issues/949
                 var buffer = context.getImageData(0, 0, heightMapWidth, heightMapHeight).data;
                 var vertexData = BABYLON.VertexData.CreateGroundFromHeightMap(width, height, subdivisions, minHeight, maxHeight, buffer, heightMapWidth, heightMapHeight);
                 vertexData.applyToMesh(ground, updatable);
@@ -1381,7 +1381,7 @@ var BABYLON;
                 for (var i = 0; i < path.length; i++) {
                     rad = radiusFunctionFinal(i, distances[i]); // current radius
                     circlePath = Array(); // current circle array
-                    normal = normals[i]; // current normal  
+                    normal = normals[i]; // current normal
                     for (var t = 0; t < tessellation; t++) {
                         rotationMatrix = BABYLON.Matrix.RotationAxis(tangents[i], step * t);
                         rotated = BABYLON.Vector3.TransformCoordinates(normal, rotationMatrix).scaleInPlace(rad).add(path[i]);

+ 1 - 1
Babylon/Mesh/babylon.polygonmesh.js

@@ -1,4 +1,4 @@
-var __extends = (this && this.__extends) || function (d, b) {
+var __extends = this.__extends || function (d, b) {
     for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
     function __() { this.constructor = d; }
     __.prototype = b.prototype;

+ 1 - 1
Babylon/PostProcess/babylon.anaglyphPostProcess.js

@@ -1,4 +1,4 @@
-var __extends = (this && this.__extends) || function (d, b) {
+var __extends = this.__extends || function (d, b) {
     for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
     function __() { this.constructor = d; }
     __.prototype = b.prototype;

+ 1 - 1
Babylon/PostProcess/babylon.blackAndWhitePostProcess.js

@@ -1,4 +1,4 @@
-var __extends = (this && this.__extends) || function (d, b) {
+var __extends = this.__extends || function (d, b) {
     for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
     function __() { this.constructor = d; }
     __.prototype = b.prototype;

+ 1 - 1
Babylon/PostProcess/babylon.blurPostProcess.js

@@ -1,4 +1,4 @@
-var __extends = (this && this.__extends) || function (d, b) {
+var __extends = this.__extends || function (d, b) {
     for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
     function __() { this.constructor = d; }
     __.prototype = b.prototype;

+ 1 - 1
Babylon/PostProcess/babylon.colorCorrectionPostProcess.js

@@ -11,7 +11,7 @@
 //  For explanations on color grading, see here:
 //      http://udn.epicgames.com/Three/ColorGrading.html
 //
-var __extends = (this && this.__extends) || function (d, b) {
+var __extends = this.__extends || function (d, b) {
     for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
     function __() { this.constructor = d; }
     __.prototype = b.prototype;

+ 1 - 1
Babylon/PostProcess/babylon.convolutionPostProcess.js

@@ -1,4 +1,4 @@
-var __extends = (this && this.__extends) || function (d, b) {
+var __extends = this.__extends || function (d, b) {
     for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
     function __() { this.constructor = d; }
     __.prototype = b.prototype;

+ 1 - 1
Babylon/PostProcess/babylon.displayPassPostProcess.js

@@ -1,4 +1,4 @@
-var __extends = (this && this.__extends) || function (d, b) {
+var __extends = this.__extends || function (d, b) {
     for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
     function __() { this.constructor = d; }
     __.prototype = b.prototype;

+ 1 - 1
Babylon/PostProcess/babylon.filterPostProcess.js

@@ -1,4 +1,4 @@
-var __extends = (this && this.__extends) || function (d, b) {
+var __extends = this.__extends || function (d, b) {
     for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
     function __() { this.constructor = d; }
     __.prototype = b.prototype;

+ 1 - 1
Babylon/PostProcess/babylon.fxaaPostProcess.js

@@ -1,4 +1,4 @@
-var __extends = (this && this.__extends) || function (d, b) {
+var __extends = this.__extends || function (d, b) {
     for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
     function __() { this.constructor = d; }
     __.prototype = b.prototype;

+ 20 - 14
Babylon/PostProcess/babylon.lensRenderingPipeline.js

@@ -1,4 +1,4 @@
-var __extends = (this && this.__extends) || function (d, b) {
+var __extends = this.__extends || function (d, b) {
     for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
     function __() { this.constructor = d; }
     __.prototype = b.prototype;
@@ -18,11 +18,12 @@ var BABYLON;
          *      distortion: number;                 // from 0 to x (1 for realism)
          *      grain_amount: number;               // from 0 to 1
          *      grain_texture: BABYLON.Texture;     // texture to use for grain effect; if unset, use random B&W noise
-         *      dof_focus_depth: number;            // depth-of-field: focus depth; unset to disable (disabled by default)
+         *      dof_focus_distance: number;         // depth-of-field: focus distance; unset to disable (disabled by default)
          *      dof_aperture: number;               // depth-of-field: focus blur bias (default: 1)
+         *      dof_darken: number;                 // depth-of-field: darken that which is out of focus (from 0 to 1, disabled by default)
          *      dof_pentagon: boolean;              // depth-of-field: makes a pentagon-like "bokeh" effect
-         *      dof_gain: number;                   // depth-of-field: depthOfField gain; unset to disable (disabled by default)
-         *      dof_threshold: number;              // depth-of-field: depthOfField threshold (default: 1)
+         *      dof_gain: number;                   // depth-of-field: highlights gain; unset to disable (disabled by default)
+         *      dof_threshold: number;              // depth-of-field: highlights threshold (default: 1)
          *      blur_noise: boolean;                // add a little bit of noise to the blur (default: true)
          * }
          * Note: if an effect parameter is unset, effect is disabled
@@ -78,14 +79,15 @@ var BABYLON;
             this._distortion = parameters.distortion ? parameters.distortion : 0;
             this._highlightsGain = parameters.dof_gain !== undefined ? parameters.dof_gain : -1;
             this._highlightsThreshold = parameters.dof_threshold ? parameters.dof_threshold : 1;
-            this._dofDepth = parameters.dof_focus_depth !== undefined ? parameters.dof_focus_depth : -1;
+            this._dofDistance = parameters.dof_focus_distance !== undefined ? parameters.dof_focus_distance : -1;
             this._dofAperture = parameters.dof_aperture ? parameters.dof_aperture : 1;
+            this._dofDarken = parameters.dof_darken ? parameters.dof_darken : 0;
             this._dofPentagon = parameters.dof_pentagon !== undefined ? parameters.dof_pentagon : true;
             this._blurNoise = parameters.blur_noise !== undefined ? parameters.blur_noise : true;
             // Create effects
             this._createChromaticAberrationPostProcess(ratio);
             this._createHighlightsPostProcess(ratio);
-            this._createDepthOfFieldPostProcess(ratio);
+            this._createDepthOfFieldPostProcess(ratio / 4);
             // Set up pipeline
             this.addEffect(new BABYLON.PostProcessRenderEffect(scene.getEngine(), this.LensChromaticAberrationEffect, function () { return _this._chromaticAberrationPostProcess; }, true));
             this.addEffect(new BABYLON.PostProcessRenderEffect(scene.getEngine(), this.HighlightsEnhancingEffect, function () { return _this._highlightsPostProcess; }, true));
@@ -108,9 +110,10 @@ var BABYLON;
         LensRenderingPipeline.prototype.disableChromaticAberration = function () { this._chromaticAberration = 0; };
         LensRenderingPipeline.prototype.setEdgeDistortion = function (amount) { this._distortion = amount; };
         LensRenderingPipeline.prototype.disableEdgeDistortion = function () { this._distortion = 0; };
-        LensRenderingPipeline.prototype.setFocusDepth = function (amount) { this._dofDepth = amount; };
-        LensRenderingPipeline.prototype.disableDepthOfField = function () { this._dofDepth = -1; };
+        LensRenderingPipeline.prototype.setFocusDistance = function (amount) { this._dofDistance = amount; };
+        LensRenderingPipeline.prototype.disableDepthOfField = function () { this._dofDistance = -1; };
         LensRenderingPipeline.prototype.setAperture = function (amount) { this._dofAperture = amount; };
+        LensRenderingPipeline.prototype.setDarkenOutOfFocus = function (amount) { this._dofDarken = amount; };
         LensRenderingPipeline.prototype.enablePentagonBokeh = function () { this._dofPentagon = true; };
         LensRenderingPipeline.prototype.disablePentagonBokeh = function () { this._dofPentagon = false; };
         LensRenderingPipeline.prototype.enableNoiseBlur = function () { this._blurNoise = true; };
@@ -167,24 +170,27 @@ var BABYLON;
         LensRenderingPipeline.prototype._createDepthOfFieldPostProcess = function (ratio) {
             var _this = this;
             this._depthOfFieldPostProcess = new BABYLON.PostProcess("LensDepthOfField", "depthOfField", [
-                "focus_depth", "aperture", "pentagon", "maxZ", "edge_blur", "chromatic_aberration",
-                "distortion", "blur_noise", "grain_amount", "screen_width", "screen_height", "highlights"
+                "grain_amount", "blur_noise", "screen_width", "screen_height", "distortion", "dof_enabled",
+                "screen_distance", "aperture", "darken", "edge_blur", "highlights", "near", "far"
             ], ["depthSampler", "grainSampler", "highlightsSampler"], ratio, null, BABYLON.Texture.TRILINEAR_SAMPLINGMODE, this._scene.getEngine(), false);
             this._depthOfFieldPostProcess.onApply = function (effect) {
-                effect.setBool('blur_noise', _this._blurNoise);
-                effect.setFloat('maxZ', _this._scene.activeCamera.maxZ);
-                effect.setFloat('grain_amount', _this._grainAmount);
                 effect.setTexture("depthSampler", _this._depthTexture);
                 effect.setTexture("grainSampler", _this._grainTexture);
                 effect.setTextureFromPostProcess("textureSampler", _this._highlightsPostProcess);
                 effect.setTextureFromPostProcess("highlightsSampler", _this._depthOfFieldPostProcess);
+                effect.setFloat('grain_amount', _this._grainAmount);
+                effect.setBool('blur_noise', _this._blurNoise);
                 effect.setFloat('screen_width', _this._scene.getEngine().getRenderingCanvas().width);
                 effect.setFloat('screen_height', _this._scene.getEngine().getRenderingCanvas().height);
                 effect.setFloat('distortion', _this._distortion);
-                effect.setFloat('focus_depth', _this._dofDepth);
+                effect.setBool('dof_enabled', (_this._dofDistance != -1));
+                effect.setFloat('screen_distance', 1.0 / (0.1 - 1.0 / _this._dofDistance));
                 effect.setFloat('aperture', _this._dofAperture);
+                effect.setFloat('darken', _this._dofDarken);
                 effect.setFloat('edge_blur', _this._edgeBlur);
                 effect.setBool('highlights', (_this._highlightsGain != -1));
+                effect.setFloat('near', _this._scene.activeCamera.minZ);
+                effect.setFloat('far', _this._scene.activeCamera.maxZ);
             };
         };
         // creates a black and white random noise texture, 512x512

+ 3 - 3
Babylon/PostProcess/babylon.lensRenderingPipeline.ts

@@ -102,7 +102,7 @@ module BABYLON {
             // Create effects
             this._createChromaticAberrationPostProcess(ratio);
             this._createHighlightsPostProcess(ratio);
-            this._createDepthOfFieldPostProcess(ratio/4);
+            this._createDepthOfFieldPostProcess(ratio / 4);
 
             // Set up pipeline
             this.addEffect(new PostProcessRenderEffect(scene.getEngine(), this.LensChromaticAberrationEffect, () => { return this._chromaticAberrationPostProcess; }, true));
@@ -227,7 +227,7 @@ module BABYLON {
                 effect.setFloat('distortion', this._distortion);
 
                 effect.setBool('dof_enabled', (this._dofDistance != -1));
-                effect.setFloat('screen_distance',  1.0 / ( 0.1 - 1.0 / this._dofDistance ));
+                effect.setFloat('screen_distance', 1.0 / (0.1 - 1.0 / this._dofDistance));
                 effect.setFloat('aperture', this._dofAperture);
                 effect.setFloat('darken', this._dofDarken);
 
@@ -266,4 +266,4 @@ module BABYLON {
         }
 
     }
-}
+}

+ 1 - 1
Babylon/PostProcess/babylon.passPostProcess.js

@@ -1,4 +1,4 @@
-var __extends = (this && this.__extends) || function (d, b) {
+var __extends = this.__extends || function (d, b) {
     for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
     function __() { this.constructor = d; }
     __.prototype = b.prototype;

+ 1 - 1
Babylon/PostProcess/babylon.refractionPostProcess.js

@@ -1,4 +1,4 @@
-var __extends = (this && this.__extends) || function (d, b) {
+var __extends = this.__extends || function (d, b) {
     for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
     function __() { this.constructor = d; }
     __.prototype = b.prototype;

+ 1 - 1
Babylon/PostProcess/babylon.ssaoRenderingPipeline.js

@@ -1,4 +1,4 @@
-var __extends = (this && this.__extends) || function (d, b) {
+var __extends = this.__extends || function (d, b) {
     for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
     function __() { this.constructor = d; }
     __.prototype = b.prototype;

+ 1 - 1
Babylon/PostProcess/babylon.stereoscopicInterlacePostProcess.js

@@ -1,4 +1,4 @@
-var __extends = (this && this.__extends) || function (d, b) {
+var __extends = this.__extends || function (d, b) {
     for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
     function __() { this.constructor = d; }
     __.prototype = b.prototype;

+ 23 - 7
Babylon/PostProcess/babylon.volumetricLightScatteringPostProcess.js

@@ -1,4 +1,4 @@
-var __extends = (this && this.__extends) || function (d, b) {
+var __extends = this.__extends || function (d, b) {
     for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
     function __() { this.constructor = d; }
     __.prototype = b.prototype;
@@ -37,6 +37,11 @@ var BABYLON;
             */
             this.invert = true;
             /**
+            * Set to true to use the diffuseColor instead of the diffuseTexture
+            * @type {boolean}
+            */
+            this.useDiffuseColor = false;
+            /**
             * Array containing the excluded meshes not rendered in the internal pass
             */
             this.excludedMeshes = new Array();
@@ -68,14 +73,20 @@ var BABYLON;
             var needUV = false;
             // Render this.mesh as default
             if (mesh === this.mesh) {
-                defines.push("#define BASIC_RENDER");
+                if (this.useDiffuseColor) {
+                    defines.push("#define DIFFUSE_COLOR_RENDER");
+                }
+                else {
+                    defines.push("#define BASIC_RENDER");
+                }
                 defines.push("#define NEED_UV");
                 needUV = true;
             }
             // Alpha test
             if (material) {
-                if (material.needAlphaTesting() || mesh === this.mesh)
+                if (material.needAlphaTesting()) {
                     defines.push("#define ALPHATEST");
+                }
                 if (material.opacityTexture !== undefined) {
                     defines.push("#define OPACITY");
                     if (material.opacityTexture.getAlphaFromRGB)
@@ -111,7 +122,7 @@ var BABYLON;
             var join = defines.join("\n");
             if (this._cachedDefines !== join) {
                 this._cachedDefines = join;
-                this._volumetricLightScatteringPass = mesh.getScene().getEngine().createEffect({ vertexElement: "depth", fragmentElement: "volumetricLightScatteringPass" }, attribs, ["world", "mBones", "viewProjection", "diffuseMatrix", "opacityLevel"], ["diffuseSampler", "opacitySampler"], join);
+                this._volumetricLightScatteringPass = mesh.getScene().getEngine().createEffect({ vertexElement: "depth", fragmentElement: "volumetricLightScatteringPass" }, attribs, ["world", "mBones", "viewProjection", "diffuseMatrix", "opacityLevel", "color"], ["diffuseSampler", "opacitySampler"], join);
             }
             return this._volumetricLightScatteringPass.isReady();
         };
@@ -187,9 +198,14 @@ var BABYLON;
                     // Alpha test
                     if (material && (mesh === _this.mesh || material.needAlphaTesting() || material.opacityTexture !== undefined)) {
                         var alphaTexture = material.getAlphaTestTexture();
-                        _this._volumetricLightScatteringPass.setTexture("diffuseSampler", alphaTexture);
-                        if (alphaTexture) {
-                            _this._volumetricLightScatteringPass.setMatrix("diffuseMatrix", alphaTexture.getTextureMatrix());
+                        if (_this.useDiffuseColor && mesh === _this.mesh) {
+                            _this._volumetricLightScatteringPass.setColor3("color", material.diffuseColor);
+                        }
+                        else {
+                            _this._volumetricLightScatteringPass.setTexture("diffuseSampler", alphaTexture);
+                            if (alphaTexture) {
+                                _this._volumetricLightScatteringPass.setMatrix("diffuseMatrix", alphaTexture.getTextureMatrix());
+                            }
                         }
                         if (material.opacityTexture !== undefined) {
                             _this._volumetricLightScatteringPass.setTexture("opacitySampler", material.opacityTexture);

+ 20 - 6
Babylon/PostProcess/babylon.volumetricLightScatteringPostProcess.ts

@@ -24,6 +24,11 @@
         * @type {boolean}
         */
         public mesh: Mesh;
+        /**
+        * Set to true to use the diffuseColor instead of the diffuseTexture
+        * @type {boolean}
+        */
+        public useDiffuseColor: boolean = false;
 
         /**
         * Array containing the excluded meshes not rendered in the internal pass
@@ -80,15 +85,20 @@
 
             // Render this.mesh as default
             if (mesh === this.mesh) {
-                defines.push("#define BASIC_RENDER");
+                if (this.useDiffuseColor) {
+                    defines.push("#define DIFFUSE_COLOR_RENDER");
+                } else {
+                    defines.push("#define BASIC_RENDER");
+                }
                 defines.push("#define NEED_UV");
                 needUV = true;
             }
 
             // Alpha test
             if (material) {
-                if (material.needAlphaTesting() || mesh === this.mesh)
+                if (material.needAlphaTesting()) {
                     defines.push("#define ALPHATEST");
+                }
 
                 if (material.opacityTexture !== undefined) {
                     defines.push("#define OPACITY");
@@ -132,7 +142,7 @@
                 this._volumetricLightScatteringPass = mesh.getScene().getEngine().createEffect(
                     { vertexElement: "depth", fragmentElement: "volumetricLightScatteringPass" },
                     attribs,
-                    ["world", "mBones", "viewProjection", "diffuseMatrix", "opacityLevel"],
+                    ["world", "mBones", "viewProjection", "diffuseMatrix", "opacityLevel", "color"],
                     ["diffuseSampler", "opacitySampler"], join);
             }
 
@@ -227,10 +237,14 @@
                     // Alpha test
                     if (material && (mesh === this.mesh || material.needAlphaTesting() || material.opacityTexture !== undefined)) {
                         var alphaTexture = material.getAlphaTestTexture();
-                        this._volumetricLightScatteringPass.setTexture("diffuseSampler", alphaTexture);
 
-                        if (alphaTexture) {
-                            this._volumetricLightScatteringPass.setMatrix("diffuseMatrix", alphaTexture.getTextureMatrix());
+                        if (this.useDiffuseColor && mesh === this.mesh) {
+                            this._volumetricLightScatteringPass.setColor3("color", material.diffuseColor);
+                        } else {
+                            this._volumetricLightScatteringPass.setTexture("diffuseSampler", alphaTexture);
+                            if (alphaTexture) {
+                                this._volumetricLightScatteringPass.setMatrix("diffuseMatrix", alphaTexture.getTextureMatrix());
+                            }
                         }
 
                         if (material.opacityTexture !== undefined) {

+ 1 - 1
Babylon/PostProcess/babylon.vrDistortionCorrectionPostProcess.js

@@ -1,4 +1,4 @@
-var __extends = (this && this.__extends) || function (d, b) {
+var __extends = this.__extends || function (d, b) {
     for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
     function __() { this.constructor = d; }
     __.prototype = b.prototype;

+ 8 - 8
Babylon/Shaders/depthOfField.fragment.fx

@@ -142,9 +142,9 @@ vec4 getBlurColor(float size) {
 
 	col /= total_weight;		// scales color according to weights
 
-	// darken if out of focus
-	if(darken > 0.0) {
-		col.rgb *= clamp(0.3, 1.0, 1.05-size*0.5*darken);
+								// darken if out of focus
+	if (darken > 0.0) {
+		col.rgb *= clamp(0.3, 1.0, 1.05 - size*0.5*darken);
 	}
 
 	// blur levels debug
@@ -166,13 +166,13 @@ void main(void)
 	vec2 texels_coords = vec2(vUV.x * screen_width, vUV.y * screen_height);	// varies from 0 to SCREEN_WIDTH or _HEIGHT
 
 	float depth = texture2D(depthSampler, distorted_coords).r;	// depth value from DepthRenderer: 0 to 1
-	float distance = near + (far-near)*depth;		// actual distance from the lens
+	float distance = near + (far - near)*depth;		// actual distance from the lens
 	vec4 color = texture2D(textureSampler, vUV);	// original raster
 
 
-	// compute the circle of confusion size (CoC), i.e. blur radius depending on depth
-	// screen_distance is precomputed in code
-	float coc = abs( aperture * ( screen_distance * ( inverse_focal_length - 1.0 / distance ) - 1.0 ) );
+													// compute the circle of confusion size (CoC), i.e. blur radius depending on depth
+													// screen_distance is precomputed in code
+	float coc = abs(aperture * (screen_distance * (inverse_focal_length - 1.0 / distance) - 1.0));
 
 	// disable blur
 	if (dof_enabled == false || coc < 0.07) { coc = 0.0; }
@@ -215,4 +215,4 @@ void main(void)
 		gl_FragColor.rgb += (-0.5 + grain_color.rgb) * 0.30 * grain_amount;
 	}
 
-}
+}

+ 12 - 3
Babylon/Shaders/volumetricLightScatteringPass.fragment.fx

@@ -10,6 +10,10 @@ varying vec2 vUV;
 uniform sampler2D diffuseSampler;
 #endif
 
+#if defined(DIFFUSE_COLOR_RENDER)
+uniform vec3 color;
+#endif
+
 #if defined(OPACITY)
 uniform sampler2D opacitySampler;
 uniform float opacityLevel;
@@ -39,16 +43,21 @@ void main(void)
 
 	#if defined(BASIC_RENDER)
 	gl_FragColor = vec4(diffuseColor.rgb, alpha);
+	#elif defined(DIFFUSE_COLOR_RENDER)
+	gl_FragColor = vec4(color.rgb, alpha);
 	#else
 	gl_FragColor = vec4(0.0, 0.0, 0.0, alpha);
 	#endif
 
 	gl_FragColor.a = alpha;
 #else
-	#ifndef BASIC_RENDER
-	gl_FragColor = vec4(0.0, 0.0, 0.0, 1.0);
-	#else
+
+	#if defined(BASIC_RENDER)
 	gl_FragColor = diffuseColor;
+	#elif defined(DIFFUSE_COLOR_RENDER)
+	gl_FragColor = vec4(color.rgb, 1.0);
+	#else
+	gl_FragColor = vec4(0.0, 0.0, 0.0, 1.0);
 	#endif
 #endif
 

+ 1 - 1
Babylon/Tools/babylon.gamepads.js

@@ -1,4 +1,4 @@
-var __extends = (this && this.__extends) || function (d, b) {
+var __extends = this.__extends || function (d, b) {
     for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
     function __() { this.constructor = d; }
     __.prototype = b.prototype;

+ 1 - 1
Babylon/Tools/babylon.sceneOptimizer.js

@@ -1,4 +1,4 @@
-var __extends = (this && this.__extends) || function (d, b) {
+var __extends = this.__extends || function (d, b) {
     for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
     function __() { this.constructor = d; }
     __.prototype = b.prototype;

파일 크기가 너무 크기때문에 변경 상태를 표시하지 않습니다.
+ 5 - 5
Preview release/babylon.2.2.js


파일 크기가 너무 크기때문에 변경 상태를 표시하지 않습니다.
+ 47 - 25
Preview release/babylon.2.2.max.js


파일 크기가 너무 크기때문에 변경 상태를 표시하지 않습니다.
+ 4 - 4
Preview release/babylon.2.2.noworker.js


+ 1 - 1
Preview release/what's new.md

@@ -2,7 +2,7 @@
   - **Major updates**
     
   - **Updates**
-  
+    - Depth-of-field improvements [PR](https://github.com/BabylonJS/Babylon.js/pull/567) [jahow](https://github.com/jahow)
   - **Bug fixes**
  
   - **Breaking changes**

+ 2 - 2
Tools/Gulp/gulp-addModuleExports.js

@@ -5,7 +5,7 @@ module.exports = function (varName) {
   return through.obj(function (file, enc, cb) {
 
     var moduleExportsAddition = 
-      '\nif (module && module.exports) {\n' +
+      '\nif (((window && window.module) || (!window && module)) && module.exports) {\n' +
       '    module.exports = ' + varName + ';\n' +
       '};\n';
       
@@ -36,4 +36,4 @@ module.exports = function (varName) {
     }
     cb();
   });
-};
+};

파일 크기가 너무 크기때문에 변경 상태를 표시하지 않습니다.
+ 47 - 25
babylon.2.1.debug.js


파일 크기가 너무 크기때문에 변경 상태를 표시하지 않습니다.
+ 5 - 5
babylon.2.1.js


파일 크기가 너무 크기때문에 변경 상태를 표시하지 않습니다.
+ 4 - 4
babylon.2.1.noworker.js