David Catuhe %!s(int64=5) %!d(string=hai) anos
pai
achega
e7eb9fe4ff
Modificáronse 1 ficheiros con 7 adicións e 1 borrados
  1. 7 1
      src/Engines/thinEngine.ts

+ 7 - 1
src/Engines/thinEngine.ts

@@ -3284,7 +3284,13 @@ export class ThinEngine {
             return this._getDepthStencilBuffer(width, height, samples, gl.DEPTH_STENCIL, gl.DEPTH24_STENCIL8, gl.DEPTH_STENCIL_ATTACHMENT);
         }
         if (generateDepthBuffer) {
-            return this._getDepthStencilBuffer(width, height, samples, gl.DEPTH_COMPONENT16, gl.DEPTH_COMPONENT16, gl.DEPTH_ATTACHMENT);
+            let anyGl = <any>gl;
+            let depthFormat = gl.DEPTH_COMPONENT16;
+            if (this._webGLVersion > 1) {
+                depthFormat = anyGl.DEPTH_COMPONENT32F;
+            }
+
+            return this._getDepthStencilBuffer(width, height, samples, depthFormat, depthFormat, gl.DEPTH_ATTACHMENT);
         }
         if (generateStencilBuffer) {
             return this._getDepthStencilBuffer(width, height, samples, gl.STENCIL_INDEX8, gl.STENCIL_INDEX8, gl.STENCIL_ATTACHMENT);