Переглянути джерело

If not webgl 2, force power of two for multiple render targets

Julien Moreau-Mathis 8 роки тому
батько
коміт
f919989426
1 змінених файлів з 5 додано та 0 видалено
  1. 5 0
      src/babylon.engine.ts

+ 5 - 0
src/babylon.engine.ts

@@ -3155,6 +3155,11 @@
             var width = size.width || size;
             var width = size.width || size;
             var height = size.height || size;
             var height = size.height || size;
 
 
+            if (this.webGLVersion < 2) {
+                width = Tools.GetExponentOfTwo(width, this._caps.maxTextureSize);
+                height = Tools.GetExponentOfTwo(height, this._caps.maxTextureSize);
+            }
+
             var textures = [];
             var textures = [];
             var attachments = []
             var attachments = []