From 9e2ef876112925736ab6f0945691f8a874fffe38 Mon Sep 17 00:00:00 2001
From: Alexander Rose <alex.rose@rcsb.org>
Date: Thu, 22 Aug 2019 16:17:22 -0700
Subject: [PATCH] don't use Mesh.uniformTriangleGroup when WebGL2 is available

---
 src/mol-repr/structure/visual/gaussian-surface-mesh.ts  | 4 ++--
 src/mol-repr/structure/visual/molecular-surface-mesh.ts | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/mol-repr/structure/visual/gaussian-surface-mesh.ts b/src/mol-repr/structure/visual/gaussian-surface-mesh.ts
index 60e1e7e51..78981b0fb 100644
--- a/src/mol-repr/structure/visual/gaussian-surface-mesh.ts
+++ b/src/mol-repr/structure/visual/gaussian-surface-mesh.ts
@@ -48,7 +48,7 @@ async function createGaussianSurfaceMesh(ctx: VisualContext, unit: Unit, structu
     const surface = await computeMarchingCubesMesh(params, mesh).runAsChild(ctx.runtime)
 
     Mesh.transformImmediate(surface, transform)
-    Mesh.uniformTriangleGroup(surface)
+    if (ctx.webgl && !ctx.webgl.isWebGL2) Mesh.uniformTriangleGroup(surface)
 
     return surface
 }
@@ -91,7 +91,7 @@ async function createStructureGaussianSurfaceMesh(ctx: VisualContext, structure:
     const surface = await computeMarchingCubesMesh(params, mesh).runAsChild(ctx.runtime)
 
     Mesh.transformImmediate(surface, transform)
-    Mesh.uniformTriangleGroup(surface)
+    if (ctx.webgl && !ctx.webgl.isWebGL2) Mesh.uniformTriangleGroup(surface)
 
     return surface
 }
diff --git a/src/mol-repr/structure/visual/molecular-surface-mesh.ts b/src/mol-repr/structure/visual/molecular-surface-mesh.ts
index 4f14f9db6..b19364b55 100644
--- a/src/mol-repr/structure/visual/molecular-surface-mesh.ts
+++ b/src/mol-repr/structure/visual/molecular-surface-mesh.ts
@@ -37,7 +37,7 @@ async function createMolecularSurfaceMesh(ctx: VisualContext, unit: Unit, struct
     const surface = await computeMarchingCubesMesh(params, mesh).runAsChild(ctx.runtime)
 
     Mesh.transformImmediate(surface, transform)
-    Mesh.uniformTriangleGroup(surface)
+    if (ctx.webgl && !ctx.webgl.isWebGL2) Mesh.uniformTriangleGroup(surface)
 
     return surface
 }
-- 
GitLab