浏览代码

Merge pull request #2164 from abow/master

fix for lower fps when reflections are disabled
sebavan 8 年之前
父节点
当前提交
110ad64310
共有 2 个文件被更改,包括 4 次插入4 次删除
  1. 2 2
      src/Materials/babylon.pbrMaterial.ts
  2. 2 2
      src/Materials/babylon.standardMaterial.ts

+ 2 - 2
src/Materials/babylon.pbrMaterial.ts

@@ -554,11 +554,11 @@
             this.getRenderTargetTextures = (): SmartArray<RenderTargetTexture> => {
                 this._renderTargets.reset();
 
-                if (this.reflectionTexture && this.reflectionTexture.isRenderTarget) {
+                if (StandardMaterial.ReflectionTextureEnabled && this.reflectionTexture && this.reflectionTexture.isRenderTarget) {
                     this._renderTargets.push(this.reflectionTexture);
                 }
 
-                if (this.refractionTexture && this.refractionTexture.isRenderTarget) {
+                if (StandardMaterial.RefractionTextureEnabled && this.refractionTexture && this.refractionTexture.isRenderTarget) {
                     this._renderTargets.push(this.refractionTexture);
                 }
 

+ 2 - 2
src/Materials/babylon.standardMaterial.ts

@@ -303,11 +303,11 @@ module BABYLON {
             this.getRenderTargetTextures = (): SmartArray<RenderTargetTexture> => {
                 this._renderTargets.reset();
 
-                if (this._reflectionTexture && this._reflectionTexture.isRenderTarget) {
+                if (StandardMaterial.ReflectionTextureEnabled && this._reflectionTexture && this._reflectionTexture.isRenderTarget) {
                     this._renderTargets.push(this._reflectionTexture);
                 }
 
-                if (this._refractionTexture && this._refractionTexture.isRenderTarget) {
+                if (StandardMaterial.RefractionTextureEnabled && this._refractionTexture && this._refractionTexture.isRenderTarget) {
                     this._renderTargets.push(this._refractionTexture);
                 }