Forráskód Böngészése

Fixing an issue with Internet Explorer while rendering a RenderTargetTexture outside the engine renderLoop.

Nicolas Obré 11 éve
szülő
commit
ed6861060f

+ 4 - 3
Babylon/Materials/textures/babylon.renderTargetTexture.js

@@ -86,12 +86,13 @@ var BABYLON = BABYLON || {};
         // Render
         this._renderingManager.render(this.customRenderFunction, this.renderList, this.renderParticles, this.renderSprites);
 
-        // Unbind
-        engine.unBindFramebuffer(this._texture);
-
+        //Call this before unBinding Framebuffer in case of manipulating texture with WebGL commands inside the onAfterRender method.
         if (this.onAfterRender) {
             this.onAfterRender();
         }
+
+        // Unbind
+        engine.unBindFramebuffer(this._texture);
     };
 
     BABYLON.RenderTargetTexture.prototype.clone = function () {

+ 2 - 0
Babylon/babylon.engine.js

@@ -272,6 +272,8 @@ var BABYLON = BABYLON || {};
             gl.generateMipmap(gl.TEXTURE_2D);
             gl.bindTexture(gl.TEXTURE_2D, null);
         }
+
+        this._gl.bindFramebuffer(this._gl.FRAMEBUFFER, null);
     };
 
     BABYLON.Engine.prototype.flushFramebuffer = function () {