Explorar o código

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

Julien Moreau-Mathis %!s(int64=8) %!d(string=hai) anos
pai
achega
f919989426
Modificáronse 1 ficheiros con 5 adicións e 0 borrados
  1. 5 0
      src/babylon.engine.ts

+ 5 - 0
src/babylon.engine.ts

@@ -3155,6 +3155,11 @@
             var width = size.width || 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 attachments = []