Quellcode durchsuchen

Fix bugs in RenderPipeline

michael-korbas vor 11 Jahren
Ursprung
Commit
5558edaa1a

+ 8 - 8
Babylon/PostProcess/RenderPipeline/babylon.postProcessRenderEffect.js

@@ -1,4 +1,4 @@
-var BABYLON;
+var BABYLON;
 (function (BABYLON) {
     var PostProcessRenderEffect = (function () {
         function PostProcessRenderEffect(engine, name, postProcessType, ratio, samplingMode, singleInstance) {
@@ -18,11 +18,11 @@
             this._renderPasses = [];
             this._renderEffectAsPasses = [];
 
-            this.parameters = function () {
+            this.parameters = function (effect) {
             };
         }
         PostProcessRenderEffect.getInstance = function (engine, postProcessType, ratio, samplingMode) {
-            var tmpClass;
+            var postProcess;
             var instance;
             var args = new Array();
 
@@ -53,11 +53,11 @@
                 }
             }
 
-            tmpClass = function () {
+            postProcess = function () {
             };
-            tmpClass.prototype = postProcessType.prototype;
+            postProcess.prototype = postProcessType.prototype;
 
-            instance = new tmpClass();
+            instance = new postProcess();
             postProcessType.apply(instance, args);
 
             return instance;
@@ -134,7 +134,7 @@
                 this._indicesForCamera[cameras[i].name].push(index);
 
                 if (this._cameras.indexOf(cameras[i]) == -1) {
-                    this._cameras.push(cameras[i]);
+                    this._cameras[cameras[i].name] = cameras[i];
                 }
 
                 for (var passName in this._renderPasses) {
@@ -145,7 +145,7 @@
             this._linkParameters();
         };
 
-        PostProcessRenderEffect.prototype.detachCamera = function (cameras) {
+        PostProcessRenderEffect.prototype.detachCameras = function (cameras) {
             cameras = BABYLON.Tools.MakeArray(cameras || this._cameras);
 
             for (var i = 0; i < cameras.length; i++) {

+ 7 - 7
Babylon/PostProcess/RenderPipeline/babylon.postProcessRenderEffect.ts

@@ -37,11 +37,11 @@ module BABYLON {
             this._renderPasses = [];
             this._renderEffectAsPasses = [];
 
-            this.parameters = function () { };
+            this.parameters = function (effect) { };
         }
 
         public static getInstance(engine: Engine, postProcessType, ratio: number, samplingMode: number): PostProcess {
-            var tmpClass;
+            var postProcess;
             var instance;
             var args = new Array();
 
@@ -72,10 +72,10 @@ module BABYLON {
                 }
             }
 
-            tmpClass = function () { };
-            tmpClass.prototype = postProcessType.prototype;
+            postProcess = function () { };
+            postProcess.prototype = postProcessType.prototype;
 
-            instance = new tmpClass();
+            instance = new postProcess();
             postProcessType.apply(instance, args);
 
             return instance;
@@ -153,7 +153,7 @@ module BABYLON {
                 this._indicesForCamera[cameras[i].name].push(index);
 
                 if (this._cameras.indexOf(cameras[i]) == -1) {
-                    this._cameras.push(cameras[i]);
+                    this._cameras[cameras[i].name] = cameras[i];
                 }
 
                 for (var passName in this._renderPasses) {
@@ -164,7 +164,7 @@ module BABYLON {
             this._linkParameters();
         }
 
-        public detachCamera(cameras): void {
+        public detachCameras(cameras): void {
             cameras = Tools.MakeArray(cameras || this._cameras);
 
             for (var i = 0; i < cameras.length; i++) {

+ 4 - 4
Babylon/PostProcess/RenderPipeline/babylon.postProcessRenderPipeline.js

@@ -1,4 +1,4 @@
-var BABYLON;
+var BABYLON;
 (function (BABYLON) {
     var PostProcessRenderPipeline = (function () {
         function PostProcessRenderPipeline(engine, name) {
@@ -45,7 +45,7 @@
 
             for (var i = 0; i < cameras.length; i++) {
                 if (this._cameras.indexOf(cameras[i]) == -1) {
-                    this._cameras.push(cameras[i]);
+                    this._cameras[cameras[i].name] = cameras[i];
                 } else if (unique) {
                     indicesToDelete.push(i);
                 }
@@ -60,11 +60,11 @@
             }
         };
 
-        PostProcessRenderPipeline.prototype.detachCamera = function (cameras) {
+        PostProcessRenderPipeline.prototype.detachCameras = function (cameras) {
             cameras = BABYLON.Tools.MakeArray(cameras || this._cameras);
 
             for (var renderEffectName in this._renderEffects) {
-                this._renderEffects[renderEffectName].detachCamera(cameras);
+                this._renderEffects[renderEffectName].detachCameras(cameras);
             }
 
             for (var i = 0; i < cameras.length; i++) {

+ 3 - 3
Babylon/PostProcess/RenderPipeline/babylon.postProcessRenderPipeline.ts

@@ -57,7 +57,7 @@ module BABYLON {
 
             for (var i = 0; i < cameras.length; i++) {
                 if (this._cameras.indexOf(cameras[i]) == -1) {
-                    this._cameras.push(cameras[i]);
+                    this._cameras[cameras[i].name] = cameras[i];
                 }
                 else if (unique) {
                     indicesToDelete.push(i);
@@ -73,11 +73,11 @@ module BABYLON {
             }
         }
 
-        public detachCamera(cameras): void {
+        public detachCameras(cameras): void {
             cameras = Tools.MakeArray(cameras || this._cameras);
 
             for (var renderEffectName in this._renderEffects) {
-                this._renderEffects[renderEffectName].detachCamera(cameras);
+                this._renderEffects[renderEffectName].detachCameras(cameras);
             }
 
             for (var i = 0; i < cameras.length; i++) {

+ 1 - 1
Babylon/PostProcess/RenderPipeline/babylon.postProcessRenderPipelineManager.js

@@ -18,7 +18,7 @@ var BABYLON;
             renderPipeline.attachCameras(cameras, unique);
         };
 
-        PostProcessRenderPipelineManager.prototype.detachCameraFromRenderPipeline = function (renderPipelineName, cameras) {
+        PostProcessRenderPipelineManager.prototype.detachCamerasFromRenderPipeline = function (renderPipelineName, cameras) {
             var renderPipeline = this._renderPipelines[renderPipelineName];
 
             if (!renderPipeline) {

+ 1 - 1
Babylon/PostProcess/RenderPipeline/babylon.postProcessRenderPipelineManager.ts

@@ -20,7 +20,7 @@ module BABYLON {
             renderPipeline.attachCameras(cameras, unique);
         }
 
-        public detachCameraFromRenderPipeline(renderPipelineName: string, cameras): void {
+        public detachCamerasFromRenderPipeline(renderPipelineName: string, cameras): void {
             var renderPipeline = this._renderPipelines[renderPipelineName];
 
             if (!renderPipeline) {

Datei-Diff unterdrückt, da er zu groß ist
+ 2 - 2
Tools/BuildOurOwnBabylonJS/BuildOurOwnBabylonJS/ourOwnBabylon.js