diff --git a/CHANGELOG.md b/CHANGELOG.md index 2ee4e47af2c6575b785e6e0fd0d4729ceebc745b..f317290b6f5a1a0bec3241567377b75191769071 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -18,6 +18,7 @@ Note that since we don't clearly distinguish between a public and private interf - Add `Segmentation` custom volume property - Add `SegmentRepresentation` representation - Add `volume-segment` color theme +- Fix GPU marching cubes failing for large meshes with webgl2 (due to use of float16) ## [v3.27.0] - 2022-12-15 diff --git a/src/mol-gl/compute/histogram-pyramid/reduction.ts b/src/mol-gl/compute/histogram-pyramid/reduction.ts index 43aaddf292b62a701c48f4cdb273beda069cc255..cd6ec8301584b0d57cd1d0b9c280cee5c6d90503 100644 --- a/src/mol-gl/compute/histogram-pyramid/reduction.ts +++ b/src/mol-gl/compute/histogram-pyramid/reduction.ts @@ -204,8 +204,7 @@ export function createHistogramPyramid(ctx: WebGLContext, inputTexture: Texture, // return at least a count of one to avoid issues downstram const count = Math.max(1, getHistopyramidSum(ctx, levelTexturesFramebuffers[0].texture)); const height = Math.ceil(count / Math.pow(2, levels)); - // const scale = Vec2.create(maxSize / inputTexture.width, maxSize / inputTexture.height); - // console.log('height', height, 'finalCount', count, 'scale', scale); + // console.log({ height, count, scale }); return { pyramidTex, count, height, levels, scale }; } \ No newline at end of file diff --git a/src/mol-gl/compute/marching-cubes/isosurface.ts b/src/mol-gl/compute/marching-cubes/isosurface.ts index 62af9563c3315e72f2ed814250a2d4cb007ff6a7..3f495d3edfaeb52cfa8cda232695a8f018c52d54 100644 --- a/src/mol-gl/compute/marching-cubes/isosurface.ts +++ b/src/mol-gl/compute/marching-cubes/isosurface.ts @@ -142,9 +142,7 @@ export function createIsosurfaceBuffers(ctx: WebGLContext, activeVoxelsBase: Tex if (isWebGL2(gl)) { if (!vertexTexture) { - vertexTexture = extensions.colorBufferHalfFloat && extensions.textureHalfFloat - ? resources.texture('image-float16', 'rgba', 'fp16', 'nearest') - : resources.texture('image-float32', 'rgba', 'float', 'nearest'); + vertexTexture = resources.texture('image-float32', 'rgba', 'float', 'nearest'); } if (!groupTexture) { @@ -199,9 +197,9 @@ export function createIsosurfaceBuffers(ctx: WebGLContext, activeVoxelsBase: Tex gl.finish(); if (isTimingMode) ctx.timer.markEnd('createIsosurfaceBuffers'); - // printTextureImage(readTexture(ctx, vertexTexture, new Float32Array(width * height * 4)), { scale: 0.75 }); - // printTextureImage(readTexture(ctx, groupTexture, new Uint8Array(width * height * 4)), { scale: 0.75 }); - // printTextureImage(readTexture(ctx, normalTexture, new Float32Array(width * height * 4)), { scale: 0.75 }); + // printTextureImage(readTexture(ctx, vertexTexture, new Float32Array(width * height * 4)), { scale: 0.75, normalize: true }); + // printTextureImage(readTexture(ctx, groupTexture, new Uint8Array(width * height * 4)), { scale: 0.75, normalize: true }); + // printTextureImage(readTexture(ctx, normalTexture, new Float32Array(width * height * 4)), { scale: 0.75, normalize: true }); return { vertexTexture, groupTexture, normalTexture, vertexCount: count }; }