浏览代码

Fixing small bug with new postProcess system (related to reusing postprocess render texture)

David Catuhe 11 年之前
父节点
当前提交
5a604618d0
共有 2 个文件被更改,包括 2 次插入4 次删除
  1. 1 3
      Babylon/PostProcess/babylon.postProcess.js
  2. 1 1
      Babylon/babylon.engine.js

+ 1 - 3
Babylon/PostProcess/babylon.postProcess.js

@@ -7,8 +7,6 @@ var BABYLON = BABYLON || {};
         this.name = name;
 
         if (camera != null) {
-            console.warn("Adding a camera in a post process is deprecated");
-
             this._camera = camera;
             this._scene = camera.getScene();
             camera.attachPostProcess(this);
@@ -113,7 +111,7 @@ var BABYLON = BABYLON || {};
         }
         if (this._textures.length > 0) {
             for (var i = 0; i < this._textures.length; i++) {
-                this._engine._releaseTexture(this._textures[i]);
+                this._engine._releaseTexture(this._textures.data[i]);
             }
             this._textures.reset();
         }

+ 1 - 1
Babylon/babylon.engine.js

@@ -928,7 +928,7 @@ var BABYLON = BABYLON || {};
     };
 
     BABYLON.Engine.prototype.setTextureFromPostProcess = function (channel, postProcess) {
-        this._bindTexture(channel, postProcess._texture);
+        this._bindTexture(channel, postProcess._textures.data[postProcess._currentRenderTextureInd]);
     };
 
     BABYLON.Engine.prototype.setTexture = function (channel, texture) {