Browse Source

fix(renderTargetTexture) : Fix null texture error.

pierre 7 năm trước cách đây
mục cha
commit
77b3516084

+ 3 - 0
src/Materials/Textures/babylon.renderTargetTexture.ts

@@ -496,6 +496,9 @@
         }
         }
 
 
         protected unbindFrameBuffer(engine: Engine, faceIndex: number): void {
         protected unbindFrameBuffer(engine: Engine, faceIndex: number): void {
+            if (!this._texture) {
+                return;
+            }
             engine.unBindFramebuffer(this._texture, this.isCube, () => {
             engine.unBindFramebuffer(this._texture, this.isCube, () => {
                 this.onAfterRenderObservable.notifyObservers(faceIndex);
                 this.onAfterRenderObservable.notifyObservers(faceIndex);
             });
             });