Browse Source

don't use Mesh.uniformTriangleGroup when WebGL2 is available

Alexander Rose 5 years ago
parent
commit
9e2ef87611

+ 2 - 2
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
 }

+ 1 - 1
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
 }