molstar 3.8.2 → 3.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/viewer/index.html +4 -1
- package/build/viewer/molstar.js +1 -1
- package/lib/apps/viewer/app.d.ts +1 -1
- package/lib/apps/viewer/app.js +1 -1
- package/lib/apps/viewer/index.html +4 -1
- package/lib/cli/cif2bcif/converter.js +1 -1
- package/lib/commonjs/apps/viewer/app.d.ts +1 -1
- package/lib/commonjs/apps/viewer/app.js +2 -1
- package/lib/commonjs/cli/cif2bcif/converter.js +1 -1
- package/lib/commonjs/examples/alpha-orbitals/index.d.ts +1 -1
- package/lib/commonjs/examples/alpha-orbitals/index.js +4 -1
- package/lib/commonjs/examples/basic-wrapper/custom-theme.js +1 -1
- package/lib/commonjs/examples/proteopedia-wrapper/coloring.js +3 -3
- package/lib/commonjs/extensions/alpha-orbitals/density.d.ts +1 -1
- package/lib/commonjs/extensions/alpha-orbitals/density.js +6 -2
- package/lib/commonjs/extensions/alpha-orbitals/orbitals.d.ts +1 -1
- package/lib/commonjs/extensions/alpha-orbitals/orbitals.js +6 -3
- package/lib/commonjs/extensions/anvil/algorithm.js +1 -1
- package/lib/commonjs/extensions/cellpack/color/generate.js +1 -1
- package/lib/commonjs/extensions/cellpack/color/provided.js +1 -1
- package/lib/commonjs/extensions/cellpack/state.js +1 -1
- package/lib/commonjs/extensions/dnatco/confal-pyramids/color.js +1 -1
- package/lib/commonjs/extensions/g3d/model.js +1 -1
- package/lib/commonjs/extensions/model-archive/quality-assessment/color/plddt.js +1 -1
- package/lib/commonjs/extensions/model-archive/quality-assessment/color/qmean.js +1 -1
- package/lib/commonjs/extensions/pdbe/structure-quality-report/color.js +1 -1
- package/lib/commonjs/extensions/rcsb/assembly-symmetry/color.js +4 -4
- package/lib/commonjs/extensions/rcsb/validation-report/color/density-fit.js +1 -1
- package/lib/commonjs/extensions/rcsb/validation-report/color/geometry-quality.js +2 -2
- package/lib/commonjs/extensions/rcsb/validation-report/color/random-coil-index.js +1 -1
- package/lib/commonjs/extensions/rcsb/validation-report/representation.js +2 -2
- package/lib/commonjs/mol-canvas3d/canvas3d.js +4 -0
- package/lib/commonjs/mol-canvas3d/controls/trackball.js +7 -7
- package/lib/commonjs/mol-canvas3d/helper/camera-helper.js +14 -14
- package/lib/commonjs/mol-canvas3d/helper/interaction-events.js +5 -5
- package/lib/commonjs/mol-canvas3d/passes/draw.js +34 -5
- package/lib/commonjs/mol-canvas3d/passes/fxaa.js +5 -0
- package/lib/commonjs/mol-canvas3d/passes/marking.js +5 -0
- package/lib/commonjs/mol-canvas3d/passes/multi-sample.js +9 -0
- package/lib/commonjs/mol-canvas3d/passes/pick.d.ts +18 -5
- package/lib/commonjs/mol-canvas3d/passes/pick.js +125 -24
- package/lib/commonjs/mol-canvas3d/passes/postprocessing.js +5 -0
- package/lib/commonjs/mol-canvas3d/passes/smaa.js +4 -0
- package/lib/commonjs/mol-canvas3d/passes/wboit.js +4 -0
- package/lib/commonjs/mol-data/db/column.js +5 -5
- package/lib/commonjs/mol-data/db/table.js +2 -2
- package/lib/commonjs/mol-data/util/array.d.ts +1 -1
- package/lib/commonjs/mol-geo/geometry/texture-mesh/color-smoothing.js +13 -0
- package/lib/commonjs/mol-gl/compute/grid3d.d.ts +2 -2
- package/lib/commonjs/mol-gl/compute/grid3d.js +30 -8
- package/lib/commonjs/mol-gl/compute/histogram-pyramid/reduction.d.ts +1 -1
- package/lib/commonjs/mol-gl/compute/histogram-pyramid/reduction.js +6 -1
- package/lib/commonjs/mol-gl/compute/histogram-pyramid/sum.d.ts +1 -1
- package/lib/commonjs/mol-gl/compute/histogram-pyramid/sum.js +6 -1
- package/lib/commonjs/mol-gl/compute/marching-cubes/active-voxels.d.ts +1 -1
- package/lib/commonjs/mol-gl/compute/marching-cubes/active-voxels.js +6 -1
- package/lib/commonjs/mol-gl/compute/marching-cubes/isosurface.d.ts +1 -1
- package/lib/commonjs/mol-gl/compute/marching-cubes/isosurface.js +10 -10
- package/lib/commonjs/mol-gl/renderer.js +77 -32
- package/lib/commonjs/mol-gl/scene.js +2 -0
- package/lib/commonjs/mol-gl/shader/chunks/assign-color-varying.glsl.d.ts +1 -1
- package/lib/commonjs/mol-gl/shader/chunks/assign-color-varying.glsl.js +1 -1
- package/lib/commonjs/mol-gl/shader/chunks/assign-material-color.glsl.d.ts +1 -1
- package/lib/commonjs/mol-gl/shader/chunks/assign-material-color.glsl.js +1 -1
- package/lib/commonjs/mol-gl/shader/chunks/color-frag-params.glsl.d.ts +1 -1
- package/lib/commonjs/mol-gl/shader/chunks/color-frag-params.glsl.js +1 -1
- package/lib/commonjs/mol-gl/shader/chunks/color-vert-params.glsl.d.ts +1 -1
- package/lib/commonjs/mol-gl/shader/chunks/color-vert-params.glsl.js +1 -1
- package/lib/commonjs/mol-gl/shader/cylinders.frag.d.ts +1 -1
- package/lib/commonjs/mol-gl/shader/cylinders.frag.js +1 -1
- package/lib/commonjs/mol-gl/shader/direct-volume.frag.d.ts +1 -1
- package/lib/commonjs/mol-gl/shader/direct-volume.frag.js +1 -1
- package/lib/commonjs/mol-gl/shader/image.frag.d.ts +1 -1
- package/lib/commonjs/mol-gl/shader/image.frag.js +1 -1
- package/lib/commonjs/mol-gl/shader/lines.frag.d.ts +1 -1
- package/lib/commonjs/mol-gl/shader/lines.frag.js +1 -1
- package/lib/commonjs/mol-gl/shader/mesh.frag.d.ts +1 -1
- package/lib/commonjs/mol-gl/shader/mesh.frag.js +1 -1
- package/lib/commonjs/mol-gl/shader/points.frag.d.ts +1 -1
- package/lib/commonjs/mol-gl/shader/points.frag.js +1 -1
- package/lib/commonjs/mol-gl/shader/spheres.frag.d.ts +1 -1
- package/lib/commonjs/mol-gl/shader/spheres.frag.js +1 -1
- package/lib/commonjs/mol-gl/shader/text.frag.d.ts +1 -1
- package/lib/commonjs/mol-gl/shader/text.frag.js +1 -1
- package/lib/commonjs/mol-gl/shader-code.d.ts +1 -1
- package/lib/commonjs/mol-gl/shader-code.js +41 -9
- package/lib/commonjs/mol-gl/webgl/compat.d.ts +34 -1
- package/lib/commonjs/mol-gl/webgl/compat.js +50 -2
- package/lib/commonjs/mol-gl/webgl/context.d.ts +2 -0
- package/lib/commonjs/mol-gl/webgl/context.js +3 -0
- package/lib/commonjs/mol-gl/webgl/extensions.d.ts +3 -2
- package/lib/commonjs/mol-gl/webgl/extensions.js +6 -1
- package/lib/commonjs/mol-gl/webgl/timer.d.ts +22 -0
- package/lib/commonjs/mol-gl/webgl/timer.js +169 -0
- package/lib/commonjs/mol-io/common/binary-cif/array-encoder.js +18 -18
- package/lib/commonjs/mol-io/common/binary-cif/decoder.js +16 -16
- package/lib/commonjs/mol-io/common/binary-cif/encoding.js +9 -9
- package/lib/commonjs/mol-io/reader/cif/binary/field.js +3 -3
- package/lib/commonjs/mol-io/reader/cif/data-model.js +14 -14
- package/lib/commonjs/mol-io/reader/cif/schema.js +1 -1
- package/lib/commonjs/mol-io/reader/cif/text/parser.js +23 -23
- package/lib/commonjs/mol-io/reader/common/text/column/fixed.js +1 -1
- package/lib/commonjs/mol-io/reader/common/text/column/token.js +1 -1
- package/lib/commonjs/mol-io/reader/common/text/number-parser.js +6 -6
- package/lib/commonjs/mol-io/reader/csv/parser.js +8 -8
- package/lib/commonjs/mol-io/writer/cif/encoder/binary.js +10 -10
- package/lib/commonjs/mol-io/writer/cif/encoder/text.js +7 -7
- package/lib/commonjs/mol-io/writer/cif/encoder.js +8 -8
- package/lib/commonjs/mol-io/writer/mol2/encoder.js +4 -4
- package/lib/commonjs/mol-math/geometry/gaussian-density/gpu.js +13 -2
- package/lib/commonjs/mol-model/sequence/alignment/sequence.js +3 -3
- package/lib/commonjs/mol-model/sequence/sequence.js +9 -9
- package/lib/commonjs/mol-model/structure/export/categories/atom_site_operator_mapping.js +3 -3
- package/lib/commonjs/mol-model/structure/export/categories/secondary-structure.js +2 -2
- package/lib/commonjs/mol-model/structure/export/categories/utils.js +1 -1
- package/lib/commonjs/mol-model/structure/model/model.js +2 -2
- package/lib/commonjs/mol-model/structure/model/properties/custom/indexed.js +6 -6
- package/lib/commonjs/mol-model/structure/model/properties/utils/atomic-ranges.js +1 -1
- package/lib/commonjs/mol-model/structure/model/types.js +116 -116
- package/lib/commonjs/mol-model/structure/query/context.js +1 -1
- package/lib/commonjs/mol-model/structure/query/queries/generators.js +5 -5
- package/lib/commonjs/mol-model/structure/query/queries/internal.js +4 -4
- package/lib/commonjs/mol-model/structure/query/queries/modifiers.js +4 -4
- package/lib/commonjs/mol-model/structure/query/utils/structure-distance.d.ts +5 -54
- package/lib/commonjs/mol-model/structure/query/utils/structure-distance.js +9 -9
- package/lib/commonjs/mol-model/structure/structure/carbohydrates/constants.js +106 -106
- package/lib/commonjs/mol-model/structure/structure/element/loci.js +5 -5
- package/lib/commonjs/mol-model/structure/structure/element/stats.js +5 -5
- package/lib/commonjs/mol-model/structure/structure/properties.js +5 -5
- package/lib/commonjs/mol-model/structure/structure/structure.js +11 -11
- package/lib/commonjs/mol-model/structure/structure/unit/bonds/inter-compute.js +5 -5
- package/lib/commonjs/mol-model/structure/structure/unit/bonds/intra-compute.js +4 -4
- package/lib/commonjs/mol-model/structure/structure/unit/bonds.js +2 -2
- package/lib/commonjs/mol-model/structure/structure/unit/resonance.js +1 -1
- package/lib/commonjs/mol-model/structure/structure/unit/rings/compute.js +6 -6
- package/lib/commonjs/mol-model/structure/structure/unit/rings.js +6 -6
- package/lib/commonjs/mol-model/structure/structure/unit.js +16 -16
- package/lib/commonjs/mol-model/structure/structure/util/superposition-sifts-mapping.js +1 -1
- package/lib/commonjs/mol-model/structure/util.js +4 -4
- package/lib/commonjs/mol-model-formats/structure/basic/atomic.js +2 -2
- package/lib/commonjs/mol-model-formats/structure/basic/parser.js +4 -4
- package/lib/commonjs/mol-model-formats/structure/basic/properties.js +1 -1
- package/lib/commonjs/mol-model-formats/structure/basic/sort.js +1 -1
- package/lib/commonjs/mol-model-formats/structure/basic/util.js +1 -1
- package/lib/commonjs/mol-model-formats/structure/cif-core.js +6 -6
- package/lib/commonjs/mol-model-formats/structure/common/entity.js +1 -1
- package/lib/commonjs/mol-model-formats/structure/cube.js +1 -1
- package/lib/commonjs/mol-model-formats/structure/gro.js +1 -1
- package/lib/commonjs/mol-model-formats/structure/mol.js +1 -1
- package/lib/commonjs/mol-model-formats/structure/mol2.js +4 -4
- package/lib/commonjs/mol-model-formats/structure/prmtop.js +1 -1
- package/lib/commonjs/mol-model-formats/structure/property/bonds/chem_comp.js +3 -3
- package/lib/commonjs/mol-model-formats/structure/property/bonds/index-pair.js +1 -1
- package/lib/commonjs/mol-model-formats/structure/property/bonds/struct_conn.js +6 -6
- package/lib/commonjs/mol-model-formats/structure/property/secondary-structure.js +8 -8
- package/lib/commonjs/mol-model-formats/structure/psf.js +1 -1
- package/lib/commonjs/mol-model-formats/structure/top.js +1 -1
- package/lib/commonjs/mol-model-formats/structure/xyz.js +1 -1
- package/lib/commonjs/mol-model-props/computed/accessible-surface-area/shrake-rupley/radii.js +2 -2
- package/lib/commonjs/mol-model-props/computed/accessible-surface-area/shrake-rupley.js +3 -3
- package/lib/commonjs/mol-model-props/computed/accessible-surface-area.js +2 -2
- package/lib/commonjs/mol-model-props/computed/chemistry/functional-group.js +31 -31
- package/lib/commonjs/mol-model-props/computed/chemistry/geometry.js +22 -22
- package/lib/commonjs/mol-model-props/computed/chemistry/valence-model.js +32 -32
- package/lib/commonjs/mol-model-props/computed/interactions/charged.js +39 -39
- package/lib/commonjs/mol-model-props/computed/interactions/common.js +34 -34
- package/lib/commonjs/mol-model-props/computed/interactions/contacts-builder.js +1 -1
- package/lib/commonjs/mol-model-props/computed/interactions/contacts.js +1 -1
- package/lib/commonjs/mol-model-props/computed/interactions/halogen-bonds.js +12 -12
- package/lib/commonjs/mol-model-props/computed/interactions/hydrogen-bonds.js +32 -32
- package/lib/commonjs/mol-model-props/computed/interactions/hydrophobic.js +9 -9
- package/lib/commonjs/mol-model-props/computed/interactions/metal.js +26 -26
- package/lib/commonjs/mol-model-props/computed/interactions/refine.js +20 -20
- package/lib/commonjs/mol-model-props/computed/representations/interactions-inter-unit-cylinder.js +2 -2
- package/lib/commonjs/mol-model-props/computed/representations/interactions-intra-unit-cylinder.js +2 -2
- package/lib/commonjs/mol-model-props/computed/secondary-structure/dssp/bends.js +1 -1
- package/lib/commonjs/mol-model-props/computed/secondary-structure/dssp/bridges.js +12 -12
- package/lib/commonjs/mol-model-props/computed/secondary-structure/dssp/helices.js +6 -6
- package/lib/commonjs/mol-model-props/computed/secondary-structure/dssp/ladders.js +3 -3
- package/lib/commonjs/mol-model-props/computed/secondary-structure/dssp/sheets.js +11 -11
- package/lib/commonjs/mol-model-props/computed/secondary-structure/dssp/turns.js +3 -3
- package/lib/commonjs/mol-model-props/computed/secondary-structure/dssp.js +30 -30
- package/lib/commonjs/mol-model-props/computed/themes/accessible-surface-area.js +1 -1
- package/lib/commonjs/mol-model-props/computed/themes/interaction-type.js +10 -10
- package/lib/commonjs/mol-model-props/integrative/cross-link-restraint/color.js +1 -1
- package/lib/commonjs/mol-model-props/integrative/cross-link-restraint/format.js +3 -3
- package/lib/commonjs/mol-model-props/sequence/sifts-mapping.js +1 -1
- package/lib/commonjs/mol-model-props/sequence/themes/sifts-mapping.js +1 -1
- package/lib/commonjs/mol-plugin/animation-loop.d.ts +2 -1
- package/lib/commonjs/mol-plugin/animation-loop.js +18 -5
- package/lib/commonjs/mol-plugin/behavior/dynamic/camera.js +12 -12
- package/lib/commonjs/mol-plugin/behavior/dynamic/representation.js +7 -7
- package/lib/commonjs/mol-plugin/context.d.ts +2 -2
- package/lib/commonjs/mol-plugin/state.d.ts +1 -14
- package/lib/commonjs/mol-plugin-state/formats/volume.d.ts +12 -11
- package/lib/commonjs/mol-plugin-state/formats/volume.js +20 -13
- package/lib/commonjs/mol-plugin-state/helpers/structure-selection-query.js +5 -5
- package/lib/commonjs/mol-plugin-state/transforms/representation.js +2 -2
- package/lib/commonjs/mol-plugin-ui/controls/parameters.d.ts +1 -1
- package/lib/commonjs/mol-plugin-ui/sequence/polymer.js +1 -1
- package/lib/commonjs/mol-plugin-ui/sequence/sequence.js +1 -1
- package/lib/commonjs/mol-plugin-ui/structure/focus.js +1 -1
- package/lib/commonjs/mol-plugin-ui/viewport.d.ts +2 -2
- package/lib/commonjs/mol-repr/structure/visual/bond-inter-unit-cylinder.js +10 -10
- package/lib/commonjs/mol-repr/structure/visual/bond-inter-unit-line.js +10 -10
- package/lib/commonjs/mol-repr/structure/visual/bond-intra-unit-cylinder.js +12 -12
- package/lib/commonjs/mol-repr/structure/visual/bond-intra-unit-line.js +12 -12
- package/lib/commonjs/mol-repr/structure/visual/carbohydrate-symbol-mesh.js +16 -16
- package/lib/commonjs/mol-repr/structure/visual/carbohydrate-terminal-link-cylinder.js +1 -1
- package/lib/commonjs/mol-repr/structure/visual/gaussian-surface-mesh.js +9 -0
- package/lib/commonjs/mol-repr/structure/visual/orientation-ellipsoid-mesh.js +4 -4
- package/lib/commonjs/mol-repr/structure/visual/polymer-direction-wedge.js +1 -1
- package/lib/commonjs/mol-repr/structure/visual/polymer-trace-mesh.js +2 -2
- package/lib/commonjs/mol-repr/structure/visual/util/bond.js +2 -2
- package/lib/commonjs/mol-repr/structure/visual/util/common.js +3 -3
- package/lib/commonjs/mol-repr/structure/visual/util/link.js +30 -30
- package/lib/commonjs/mol-repr/structure/visual/util/polymer/backbone.js +6 -6
- package/lib/commonjs/mol-repr/structure/visual/util/polymer/gap-iterator.js +3 -3
- package/lib/commonjs/mol-repr/structure/visual/util/polymer/trace-iterator.js +20 -20
- package/lib/commonjs/mol-repr/structure/visual/util/polymer.js +6 -6
- package/lib/commonjs/mol-script/language/symbol-table/core.d.ts +2 -2
- package/lib/commonjs/mol-script/runtime/query/table.js +13 -13
- package/lib/commonjs/mol-state/object.d.ts +3 -3
- package/lib/commonjs/mol-task/util/user-timing.js +1 -1
- package/lib/commonjs/mol-theme/clipping.js +19 -19
- package/lib/commonjs/mol-theme/color/atom-id.js +1 -1
- package/lib/commonjs/mol-theme/color/carbohydrate-symbol.js +1 -1
- package/lib/commonjs/mol-theme/color/chain-id.js +4 -4
- package/lib/commonjs/mol-theme/color/element-index.js +1 -1
- package/lib/commonjs/mol-theme/color/element-symbol.js +1 -1
- package/lib/commonjs/mol-theme/color/entity-id.js +4 -4
- package/lib/commonjs/mol-theme/color/entity-source.js +5 -4
- package/lib/commonjs/mol-theme/color/hydrophobicity.js +1 -1
- package/lib/commonjs/mol-theme/color/illustrative.js +1 -1
- package/lib/commonjs/mol-theme/color/model-index.js +1 -1
- package/lib/commonjs/mol-theme/color/molecule-type.js +8 -8
- package/lib/commonjs/mol-theme/color/occupancy.js +1 -1
- package/lib/commonjs/mol-theme/color/operator-hkl.js +1 -1
- package/lib/commonjs/mol-theme/color/operator-name.js +1 -1
- package/lib/commonjs/mol-theme/color/partial-charge.js +1 -1
- package/lib/commonjs/mol-theme/color/polymer-id.js +4 -4
- package/lib/commonjs/mol-theme/color/polymer-index.js +1 -1
- package/lib/commonjs/mol-theme/color/residue-name.js +1 -1
- package/lib/commonjs/mol-theme/color/secondary-structure.js +12 -12
- package/lib/commonjs/mol-theme/color/sequence-id.js +7 -7
- package/lib/commonjs/mol-theme/color/shape-group.js +1 -1
- package/lib/commonjs/mol-theme/color/uncertainty.js +1 -1
- package/lib/commonjs/mol-theme/color/uniform.js +1 -1
- package/lib/commonjs/mol-theme/color/unit-index.js +1 -1
- package/lib/commonjs/mol-theme/color/volume-value.js +1 -1
- package/lib/commonjs/mol-theme/label.js +3 -3
- package/lib/commonjs/mol-util/binding.js +4 -4
- package/lib/commonjs/mol-util/debug.d.ts +6 -1
- package/lib/commonjs/mol-util/debug.js +11 -1
- package/lib/commonjs/mol-util/input/input-observer.js +20 -20
- package/lib/commonjs/mol-util/string-builder.js +1 -1
- package/lib/commonjs/servers/model/preprocess/converter.js +1 -1
- package/lib/commonjs/servers/model/server/query.js +1 -1
- package/lib/commonjs/servers/model/utils/fetch-retry.js +3 -2
- package/lib/commonjs/servers/volume/server/algebra/coordinate.js +6 -6
- package/lib/commonjs/servers/volume/server/query/encode.js +1 -1
- package/lib/examples/alpha-orbitals/index.d.ts +1 -1
- package/lib/examples/alpha-orbitals/index.html +11 -0
- package/lib/examples/alpha-orbitals/index.js +4 -1
- package/lib/examples/basic-wrapper/custom-theme.js +1 -1
- package/lib/examples/proteopedia-wrapper/coloring.js +3 -3
- package/lib/extensions/alpha-orbitals/density.d.ts +1 -1
- package/lib/extensions/alpha-orbitals/density.js +6 -2
- package/lib/extensions/alpha-orbitals/orbitals.d.ts +1 -1
- package/lib/extensions/alpha-orbitals/orbitals.js +6 -3
- package/lib/extensions/anvil/algorithm.js +1 -1
- package/lib/extensions/cellpack/color/generate.js +1 -1
- package/lib/extensions/cellpack/color/provided.js +1 -1
- package/lib/extensions/cellpack/state.js +1 -1
- package/lib/extensions/dnatco/confal-pyramids/color.js +1 -1
- package/lib/extensions/g3d/model.js +1 -1
- package/lib/extensions/model-archive/quality-assessment/color/plddt.js +1 -1
- package/lib/extensions/model-archive/quality-assessment/color/qmean.js +1 -1
- package/lib/extensions/pdbe/structure-quality-report/color.js +1 -1
- package/lib/extensions/rcsb/assembly-symmetry/color.js +4 -4
- package/lib/extensions/rcsb/validation-report/color/density-fit.js +1 -1
- package/lib/extensions/rcsb/validation-report/color/geometry-quality.js +2 -2
- package/lib/extensions/rcsb/validation-report/color/random-coil-index.js +1 -1
- package/lib/extensions/rcsb/validation-report/representation.js +2 -2
- package/lib/mol-canvas3d/canvas3d.js +5 -1
- package/lib/mol-canvas3d/controls/trackball.js +7 -7
- package/lib/mol-canvas3d/helper/camera-helper.js +14 -14
- package/lib/mol-canvas3d/helper/interaction-events.js +5 -5
- package/lib/mol-canvas3d/passes/draw.js +34 -5
- package/lib/mol-canvas3d/passes/fxaa.js +5 -0
- package/lib/mol-canvas3d/passes/marking.js +5 -0
- package/lib/mol-canvas3d/passes/multi-sample.js +9 -0
- package/lib/mol-canvas3d/passes/pick.d.ts +18 -5
- package/lib/mol-canvas3d/passes/pick.js +125 -24
- package/lib/mol-canvas3d/passes/postprocessing.js +5 -0
- package/lib/mol-canvas3d/passes/smaa.js +5 -1
- package/lib/mol-canvas3d/passes/wboit.js +5 -1
- package/lib/mol-data/db/column.js +5 -5
- package/lib/mol-data/db/table.js +2 -2
- package/lib/mol-data/util/array.d.ts +1 -1
- package/lib/mol-geo/geometry/texture-mesh/color-smoothing.js +13 -0
- package/lib/mol-gl/compute/grid3d.d.ts +2 -2
- package/lib/mol-gl/compute/grid3d.js +30 -8
- package/lib/mol-gl/compute/histogram-pyramid/reduction.d.ts +1 -1
- package/lib/mol-gl/compute/histogram-pyramid/reduction.js +6 -1
- package/lib/mol-gl/compute/histogram-pyramid/sum.d.ts +1 -1
- package/lib/mol-gl/compute/histogram-pyramid/sum.js +6 -1
- package/lib/mol-gl/compute/marching-cubes/active-voxels.d.ts +1 -1
- package/lib/mol-gl/compute/marching-cubes/active-voxels.js +6 -1
- package/lib/mol-gl/compute/marching-cubes/isosurface.d.ts +1 -1
- package/lib/mol-gl/compute/marching-cubes/isosurface.js +10 -10
- package/lib/mol-gl/renderer.js +77 -32
- package/lib/mol-gl/scene.js +2 -0
- package/lib/mol-gl/shader/chunks/assign-color-varying.glsl.d.ts +1 -1
- package/lib/mol-gl/shader/chunks/assign-color-varying.glsl.js +1 -1
- package/lib/mol-gl/shader/chunks/assign-material-color.glsl.d.ts +1 -1
- package/lib/mol-gl/shader/chunks/assign-material-color.glsl.js +1 -1
- package/lib/mol-gl/shader/chunks/color-frag-params.glsl.d.ts +1 -1
- package/lib/mol-gl/shader/chunks/color-frag-params.glsl.js +1 -1
- package/lib/mol-gl/shader/chunks/color-vert-params.glsl.d.ts +1 -1
- package/lib/mol-gl/shader/chunks/color-vert-params.glsl.js +1 -1
- package/lib/mol-gl/shader/cylinders.frag.d.ts +1 -1
- package/lib/mol-gl/shader/cylinders.frag.js +1 -1
- package/lib/mol-gl/shader/direct-volume.frag.d.ts +1 -1
- package/lib/mol-gl/shader/direct-volume.frag.js +1 -1
- package/lib/mol-gl/shader/image.frag.d.ts +1 -1
- package/lib/mol-gl/shader/image.frag.js +1 -1
- package/lib/mol-gl/shader/lines.frag.d.ts +1 -1
- package/lib/mol-gl/shader/lines.frag.js +1 -1
- package/lib/mol-gl/shader/mesh.frag.d.ts +1 -1
- package/lib/mol-gl/shader/mesh.frag.js +1 -1
- package/lib/mol-gl/shader/points.frag.d.ts +1 -1
- package/lib/mol-gl/shader/points.frag.js +1 -1
- package/lib/mol-gl/shader/spheres.frag.d.ts +1 -1
- package/lib/mol-gl/shader/spheres.frag.js +1 -1
- package/lib/mol-gl/shader/text.frag.d.ts +1 -1
- package/lib/mol-gl/shader/text.frag.js +1 -1
- package/lib/mol-gl/shader-code.d.ts +1 -1
- package/lib/mol-gl/shader-code.js +41 -9
- package/lib/mol-gl/webgl/compat.d.ts +34 -1
- package/lib/mol-gl/webgl/compat.js +48 -1
- package/lib/mol-gl/webgl/context.d.ts +2 -0
- package/lib/mol-gl/webgl/context.js +3 -0
- package/lib/mol-gl/webgl/extensions.d.ts +3 -2
- package/lib/mol-gl/webgl/extensions.js +7 -2
- package/lib/mol-gl/webgl/timer.d.ts +22 -0
- package/lib/mol-gl/webgl/timer.js +164 -0
- package/lib/mol-io/common/binary-cif/array-encoder.js +18 -18
- package/lib/mol-io/common/binary-cif/decoder.js +16 -16
- package/lib/mol-io/common/binary-cif/encoding.js +9 -9
- package/lib/mol-io/reader/cif/binary/field.js +3 -3
- package/lib/mol-io/reader/cif/data-model.js +14 -14
- package/lib/mol-io/reader/cif/schema.js +1 -1
- package/lib/mol-io/reader/cif/text/parser.js +23 -23
- package/lib/mol-io/reader/common/text/column/fixed.js +1 -1
- package/lib/mol-io/reader/common/text/column/token.js +1 -1
- package/lib/mol-io/reader/common/text/number-parser.js +6 -6
- package/lib/mol-io/reader/csv/parser.js +8 -8
- package/lib/mol-io/writer/cif/encoder/binary.js +10 -10
- package/lib/mol-io/writer/cif/encoder/text.js +7 -7
- package/lib/mol-io/writer/cif/encoder.js +8 -8
- package/lib/mol-io/writer/mol2/encoder.js +4 -4
- package/lib/mol-math/geometry/gaussian-density/gpu.js +13 -2
- package/lib/mol-model/sequence/alignment/sequence.js +3 -3
- package/lib/mol-model/sequence/sequence.js +9 -9
- package/lib/mol-model/structure/export/categories/atom_site_operator_mapping.js +3 -3
- package/lib/mol-model/structure/export/categories/secondary-structure.js +2 -2
- package/lib/mol-model/structure/export/categories/utils.js +1 -1
- package/lib/mol-model/structure/model/model.js +2 -2
- package/lib/mol-model/structure/model/properties/custom/indexed.js +6 -6
- package/lib/mol-model/structure/model/properties/utils/atomic-ranges.js +1 -1
- package/lib/mol-model/structure/model/types.js +116 -116
- package/lib/mol-model/structure/query/context.js +1 -1
- package/lib/mol-model/structure/query/queries/generators.js +5 -5
- package/lib/mol-model/structure/query/queries/internal.js +4 -4
- package/lib/mol-model/structure/query/queries/modifiers.js +4 -4
- package/lib/mol-model/structure/query/utils/structure-distance.d.ts +5 -54
- package/lib/mol-model/structure/query/utils/structure-distance.js +9 -9
- package/lib/mol-model/structure/structure/carbohydrates/constants.js +106 -106
- package/lib/mol-model/structure/structure/element/loci.js +5 -5
- package/lib/mol-model/structure/structure/element/stats.js +5 -5
- package/lib/mol-model/structure/structure/properties.js +5 -5
- package/lib/mol-model/structure/structure/structure.js +11 -11
- package/lib/mol-model/structure/structure/unit/bonds/inter-compute.js +5 -5
- package/lib/mol-model/structure/structure/unit/bonds/intra-compute.js +4 -4
- package/lib/mol-model/structure/structure/unit/bonds.js +2 -2
- package/lib/mol-model/structure/structure/unit/resonance.js +1 -1
- package/lib/mol-model/structure/structure/unit/rings/compute.js +6 -6
- package/lib/mol-model/structure/structure/unit/rings.js +6 -6
- package/lib/mol-model/structure/structure/unit.js +16 -16
- package/lib/mol-model/structure/structure/util/superposition-sifts-mapping.js +1 -1
- package/lib/mol-model/structure/util.js +4 -4
- package/lib/mol-model-formats/structure/basic/atomic.js +2 -2
- package/lib/mol-model-formats/structure/basic/parser.js +4 -4
- package/lib/mol-model-formats/structure/basic/properties.js +1 -1
- package/lib/mol-model-formats/structure/basic/sort.js +1 -1
- package/lib/mol-model-formats/structure/basic/util.js +1 -1
- package/lib/mol-model-formats/structure/cif-core.js +6 -6
- package/lib/mol-model-formats/structure/common/entity.js +1 -1
- package/lib/mol-model-formats/structure/cube.js +1 -1
- package/lib/mol-model-formats/structure/gro.js +1 -1
- package/lib/mol-model-formats/structure/mol.js +1 -1
- package/lib/mol-model-formats/structure/mol2.js +4 -4
- package/lib/mol-model-formats/structure/prmtop.js +1 -1
- package/lib/mol-model-formats/structure/property/bonds/chem_comp.js +3 -3
- package/lib/mol-model-formats/structure/property/bonds/index-pair.js +1 -1
- package/lib/mol-model-formats/structure/property/bonds/struct_conn.js +6 -6
- package/lib/mol-model-formats/structure/property/secondary-structure.js +8 -8
- package/lib/mol-model-formats/structure/psf.js +1 -1
- package/lib/mol-model-formats/structure/top.js +1 -1
- package/lib/mol-model-formats/structure/xyz.js +1 -1
- package/lib/mol-model-props/computed/accessible-surface-area/shrake-rupley/radii.js +2 -2
- package/lib/mol-model-props/computed/accessible-surface-area/shrake-rupley.js +3 -3
- package/lib/mol-model-props/computed/accessible-surface-area.js +2 -2
- package/lib/mol-model-props/computed/chemistry/functional-group.js +31 -31
- package/lib/mol-model-props/computed/chemistry/geometry.js +22 -22
- package/lib/mol-model-props/computed/chemistry/valence-model.js +32 -32
- package/lib/mol-model-props/computed/interactions/charged.js +39 -39
- package/lib/mol-model-props/computed/interactions/common.js +34 -34
- package/lib/mol-model-props/computed/interactions/contacts-builder.js +1 -1
- package/lib/mol-model-props/computed/interactions/contacts.js +1 -1
- package/lib/mol-model-props/computed/interactions/halogen-bonds.js +12 -12
- package/lib/mol-model-props/computed/interactions/hydrogen-bonds.js +32 -32
- package/lib/mol-model-props/computed/interactions/hydrophobic.js +9 -9
- package/lib/mol-model-props/computed/interactions/metal.js +26 -26
- package/lib/mol-model-props/computed/interactions/refine.js +20 -20
- package/lib/mol-model-props/computed/representations/interactions-inter-unit-cylinder.js +2 -2
- package/lib/mol-model-props/computed/representations/interactions-intra-unit-cylinder.js +2 -2
- package/lib/mol-model-props/computed/secondary-structure/dssp/bends.js +1 -1
- package/lib/mol-model-props/computed/secondary-structure/dssp/bridges.js +12 -12
- package/lib/mol-model-props/computed/secondary-structure/dssp/helices.js +6 -6
- package/lib/mol-model-props/computed/secondary-structure/dssp/ladders.js +3 -3
- package/lib/mol-model-props/computed/secondary-structure/dssp/sheets.js +11 -11
- package/lib/mol-model-props/computed/secondary-structure/dssp/turns.js +3 -3
- package/lib/mol-model-props/computed/secondary-structure/dssp.js +30 -30
- package/lib/mol-model-props/computed/themes/accessible-surface-area.js +1 -1
- package/lib/mol-model-props/computed/themes/interaction-type.js +10 -10
- package/lib/mol-model-props/integrative/cross-link-restraint/color.js +1 -1
- package/lib/mol-model-props/integrative/cross-link-restraint/format.js +3 -3
- package/lib/mol-model-props/sequence/sifts-mapping.js +1 -1
- package/lib/mol-model-props/sequence/themes/sifts-mapping.js +1 -1
- package/lib/mol-plugin/animation-loop.d.ts +2 -1
- package/lib/mol-plugin/animation-loop.js +18 -5
- package/lib/mol-plugin/behavior/dynamic/camera.js +12 -12
- package/lib/mol-plugin/behavior/dynamic/representation.js +7 -7
- package/lib/mol-plugin/context.d.ts +2 -2
- package/lib/mol-plugin/state.d.ts +1 -14
- package/lib/mol-plugin/version.js +2 -2
- package/lib/mol-plugin-state/formats/volume.d.ts +12 -11
- package/lib/mol-plugin-state/formats/volume.js +20 -13
- package/lib/mol-plugin-state/helpers/structure-selection-query.js +5 -5
- package/lib/mol-plugin-state/transforms/representation.js +2 -2
- package/lib/mol-plugin-ui/controls/parameters.d.ts +1 -1
- package/lib/mol-plugin-ui/sequence/polymer.js +1 -1
- package/lib/mol-plugin-ui/sequence/sequence.js +1 -1
- package/lib/mol-plugin-ui/structure/focus.js +1 -1
- package/lib/mol-plugin-ui/viewport.d.ts +2 -2
- package/lib/mol-repr/structure/visual/bond-inter-unit-cylinder.js +10 -10
- package/lib/mol-repr/structure/visual/bond-inter-unit-line.js +10 -10
- package/lib/mol-repr/structure/visual/bond-intra-unit-cylinder.js +12 -12
- package/lib/mol-repr/structure/visual/bond-intra-unit-line.js +12 -12
- package/lib/mol-repr/structure/visual/carbohydrate-symbol-mesh.js +16 -16
- package/lib/mol-repr/structure/visual/carbohydrate-terminal-link-cylinder.js +1 -1
- package/lib/mol-repr/structure/visual/gaussian-surface-mesh.js +9 -0
- package/lib/mol-repr/structure/visual/orientation-ellipsoid-mesh.js +4 -4
- package/lib/mol-repr/structure/visual/polymer-direction-wedge.js +1 -1
- package/lib/mol-repr/structure/visual/polymer-trace-mesh.js +2 -2
- package/lib/mol-repr/structure/visual/util/bond.js +2 -2
- package/lib/mol-repr/structure/visual/util/common.js +3 -3
- package/lib/mol-repr/structure/visual/util/link.js +30 -30
- package/lib/mol-repr/structure/visual/util/polymer/backbone.js +6 -6
- package/lib/mol-repr/structure/visual/util/polymer/gap-iterator.js +3 -3
- package/lib/mol-repr/structure/visual/util/polymer/trace-iterator.js +20 -20
- package/lib/mol-repr/structure/visual/util/polymer.js +6 -6
- package/lib/mol-script/language/symbol-table/core.d.ts +2 -2
- package/lib/mol-script/runtime/query/table.js +13 -13
- package/lib/mol-state/object.d.ts +3 -3
- package/lib/mol-task/util/user-timing.js +1 -1
- package/lib/mol-theme/clipping.js +19 -19
- package/lib/mol-theme/color/atom-id.js +1 -1
- package/lib/mol-theme/color/carbohydrate-symbol.js +1 -1
- package/lib/mol-theme/color/chain-id.js +4 -4
- package/lib/mol-theme/color/element-index.js +1 -1
- package/lib/mol-theme/color/element-symbol.js +1 -1
- package/lib/mol-theme/color/entity-id.js +4 -4
- package/lib/mol-theme/color/entity-source.js +5 -4
- package/lib/mol-theme/color/hydrophobicity.js +1 -1
- package/lib/mol-theme/color/illustrative.js +1 -1
- package/lib/mol-theme/color/model-index.js +1 -1
- package/lib/mol-theme/color/molecule-type.js +8 -8
- package/lib/mol-theme/color/occupancy.js +1 -1
- package/lib/mol-theme/color/operator-hkl.js +1 -1
- package/lib/mol-theme/color/operator-name.js +1 -1
- package/lib/mol-theme/color/partial-charge.js +1 -1
- package/lib/mol-theme/color/polymer-id.js +4 -4
- package/lib/mol-theme/color/polymer-index.js +1 -1
- package/lib/mol-theme/color/residue-name.js +1 -1
- package/lib/mol-theme/color/secondary-structure.js +12 -12
- package/lib/mol-theme/color/sequence-id.js +7 -7
- package/lib/mol-theme/color/shape-group.js +1 -1
- package/lib/mol-theme/color/uncertainty.js +1 -1
- package/lib/mol-theme/color/uniform.js +1 -1
- package/lib/mol-theme/color/unit-index.js +1 -1
- package/lib/mol-theme/color/volume-value.js +1 -1
- package/lib/mol-theme/label.js +3 -3
- package/lib/mol-util/binding.js +4 -4
- package/lib/mol-util/debug.d.ts +6 -1
- package/lib/mol-util/debug.js +9 -1
- package/lib/mol-util/input/input-observer.js +20 -20
- package/lib/mol-util/string-builder.js +1 -1
- package/lib/servers/model/preprocess/converter.js +1 -1
- package/lib/servers/model/server/query.js +1 -1
- package/lib/servers/model/utils/fetch-retry.js +3 -2
- package/lib/servers/volume/server/algebra/coordinate.js +6 -6
- package/lib/servers/volume/server/query/encode.js +1 -1
- package/package.json +8 -8
|
@@ -14,6 +14,7 @@ import { ValueCell } from '../../mol-util';
|
|
|
14
14
|
import { ParamDefinition as PD } from '../../mol-util/param-definition';
|
|
15
15
|
import { quad_vert } from '../../mol-gl/shader/quad.vert';
|
|
16
16
|
import { fxaa_frag } from '../../mol-gl/shader/fxaa.frag';
|
|
17
|
+
import { isTimingMode } from '../../mol-util/debug';
|
|
17
18
|
export var FxaaParams = {
|
|
18
19
|
edgeThresholdMin: PD.Numeric(0.0312, { min: 0.0312, max: 0.0833, step: 0.0001 }, { description: 'Trims the algorithm from processing darks.' }),
|
|
19
20
|
edgeThresholdMax: PD.Numeric(0.063, { min: 0.063, max: 0.333, step: 0.001 }, { description: 'The minimum amount of local contrast required to apply algorithm.' }),
|
|
@@ -65,6 +66,8 @@ var FxaaPass = /** @class */ (function () {
|
|
|
65
66
|
}
|
|
66
67
|
};
|
|
67
68
|
FxaaPass.prototype.render = function (viewport, target) {
|
|
69
|
+
if (isTimingMode)
|
|
70
|
+
this.webgl.timer.mark('FxaaPass.render');
|
|
68
71
|
if (target) {
|
|
69
72
|
target.bind();
|
|
70
73
|
}
|
|
@@ -73,6 +76,8 @@ var FxaaPass = /** @class */ (function () {
|
|
|
73
76
|
}
|
|
74
77
|
this.updateState(viewport);
|
|
75
78
|
this.renderable.render();
|
|
79
|
+
if (isTimingMode)
|
|
80
|
+
this.webgl.timer.markEnd('FxaaPass.render');
|
|
76
81
|
};
|
|
77
82
|
return FxaaPass;
|
|
78
83
|
}());
|
|
@@ -16,6 +16,7 @@ import { quad_vert } from '../../mol-gl/shader/quad.vert';
|
|
|
16
16
|
import { overlay_frag } from '../../mol-gl/shader/marking/overlay.frag';
|
|
17
17
|
import { Color } from '../../mol-util/color';
|
|
18
18
|
import { edge_frag } from '../../mol-gl/shader/marking/edge.frag';
|
|
19
|
+
import { isTimingMode } from '../../mol-util/debug';
|
|
19
20
|
export var MarkingParams = {
|
|
20
21
|
enabled: PD.Boolean(true),
|
|
21
22
|
highlightEdgeColor: PD.Color(Color.darken(Color.fromNormalizedRgb(1.0, 0.4, 0.6), 1.0)),
|
|
@@ -88,6 +89,8 @@ var MarkingPass = /** @class */ (function () {
|
|
|
88
89
|
ValueCell.update(overlayValues.uGhostEdgeStrength, ghostEdgeStrength);
|
|
89
90
|
};
|
|
90
91
|
MarkingPass.prototype.render = function (viewport, target) {
|
|
92
|
+
if (isTimingMode)
|
|
93
|
+
this.webgl.timer.mark('MarkingPass.render');
|
|
91
94
|
this.edgesTarget.bind();
|
|
92
95
|
this.setEdgeState(viewport);
|
|
93
96
|
this.edge.render();
|
|
@@ -99,6 +102,8 @@ var MarkingPass = /** @class */ (function () {
|
|
|
99
102
|
}
|
|
100
103
|
this.setOverlayState(viewport);
|
|
101
104
|
this.overlay.render();
|
|
105
|
+
if (isTimingMode)
|
|
106
|
+
this.webgl.timer.markEnd('MarkingPass.render');
|
|
102
107
|
};
|
|
103
108
|
return MarkingPass;
|
|
104
109
|
}());
|
|
@@ -15,6 +15,7 @@ import { ParamDefinition as PD } from '../../mol-util/param-definition';
|
|
|
15
15
|
import { Camera } from '../../mol-canvas3d/camera';
|
|
16
16
|
import { quad_vert } from '../../mol-gl/shader/quad.vert';
|
|
17
17
|
import { compose_frag } from '../../mol-gl/shader/compose.frag';
|
|
18
|
+
import { isTimingMode } from '../../mol-util/debug';
|
|
18
19
|
var ComposeSchema = __assign(__assign({}, QuadSchema), { tColor: TextureSpec('texture', 'rgba', 'ubyte', 'nearest'), uTexSize: UniformSpec('v2'), uWeight: UniformSpec('f') });
|
|
19
20
|
var ComposeShaderCode = ShaderCode('compose', quad_vert, compose_frag);
|
|
20
21
|
function getComposeRenderable(ctx, colorTexture) {
|
|
@@ -76,6 +77,8 @@ var MultiSamplePass = /** @class */ (function () {
|
|
|
76
77
|
var camera = ctx.camera;
|
|
77
78
|
var _a = this, compose = _a.compose, composeTarget = _a.composeTarget, drawPass = _a.drawPass, webgl = _a.webgl;
|
|
78
79
|
var gl = webgl.gl, state = webgl.state;
|
|
80
|
+
if (isTimingMode)
|
|
81
|
+
webgl.timer.mark('MultiSamplePass.renderMultiSample');
|
|
79
82
|
// based on the Multisample Anti-Aliasing Render Pass
|
|
80
83
|
// contributed to three.js by bhouston / http://clara.io/
|
|
81
84
|
//
|
|
@@ -134,11 +137,15 @@ var MultiSamplePass = /** @class */ (function () {
|
|
|
134
137
|
compose.render();
|
|
135
138
|
camera.viewOffset.enabled = false;
|
|
136
139
|
camera.update();
|
|
140
|
+
if (isTimingMode)
|
|
141
|
+
webgl.timer.markEnd('MultiSamplePass.renderMultiSample');
|
|
137
142
|
};
|
|
138
143
|
MultiSamplePass.prototype.renderTemporalMultiSample = function (sampleIndex, ctx, props, toDrawingBuffer) {
|
|
139
144
|
var camera = ctx.camera;
|
|
140
145
|
var _a = this, compose = _a.compose, composeTarget = _a.composeTarget, holdTarget = _a.holdTarget, drawPass = _a.drawPass, webgl = _a.webgl;
|
|
141
146
|
var gl = webgl.gl, state = webgl.state;
|
|
147
|
+
if (isTimingMode)
|
|
148
|
+
webgl.timer.mark('MultiSamplePass.renderTemporalMultiSample');
|
|
142
149
|
// based on the Multisample Anti-Aliasing Render Pass
|
|
143
150
|
// contributed to three.js by bhouston / http://clara.io/
|
|
144
151
|
//
|
|
@@ -226,6 +233,8 @@ var MultiSamplePass = /** @class */ (function () {
|
|
|
226
233
|
}
|
|
227
234
|
camera.viewOffset.enabled = false;
|
|
228
235
|
camera.update();
|
|
236
|
+
if (isTimingMode)
|
|
237
|
+
webgl.timer.markEnd('MultiSamplePass.renderTemporalMultiSample');
|
|
229
238
|
return sampleIndex >= offsetList.length ? -2 : sampleIndex;
|
|
230
239
|
};
|
|
231
240
|
return MultiSamplePass;
|
|
@@ -7,7 +7,6 @@ import { PickingId } from '../../mol-geo/geometry/picking';
|
|
|
7
7
|
import { Renderer } from '../../mol-gl/renderer';
|
|
8
8
|
import { Scene } from '../../mol-gl/scene';
|
|
9
9
|
import { WebGLContext } from '../../mol-gl/webgl/context';
|
|
10
|
-
import { RenderTarget } from '../../mol-gl/webgl/render-target';
|
|
11
10
|
import { Vec3 } from '../../mol-math/linear-algebra';
|
|
12
11
|
import { Camera, ICamera } from '../camera';
|
|
13
12
|
import { StereoCamera } from '../camera/stereo';
|
|
@@ -22,13 +21,27 @@ export declare class PickPass {
|
|
|
22
21
|
private webgl;
|
|
23
22
|
private drawPass;
|
|
24
23
|
readonly pickBaseScale: number;
|
|
25
|
-
readonly objectPickTarget
|
|
26
|
-
readonly instancePickTarget
|
|
27
|
-
readonly groupPickTarget
|
|
28
|
-
readonly depthPickTarget
|
|
24
|
+
private readonly objectPickTarget;
|
|
25
|
+
private readonly instancePickTarget;
|
|
26
|
+
private readonly groupPickTarget;
|
|
27
|
+
private readonly depthPickTarget;
|
|
28
|
+
private readonly framebuffer;
|
|
29
|
+
private readonly objectPickTexture;
|
|
30
|
+
private readonly instancePickTexture;
|
|
31
|
+
private readonly groupPickTexture;
|
|
32
|
+
private readonly depthPickTexture;
|
|
33
|
+
private readonly objectPickFramebuffer;
|
|
34
|
+
private readonly instancePickFramebuffer;
|
|
35
|
+
private readonly groupPickFramebuffer;
|
|
36
|
+
private readonly depthPickFramebuffer;
|
|
37
|
+
private readonly depthRenderbuffer;
|
|
29
38
|
private pickWidth;
|
|
30
39
|
private pickHeight;
|
|
31
40
|
constructor(webgl: WebGLContext, drawPass: DrawPass, pickBaseScale: number);
|
|
41
|
+
bindObject(): void;
|
|
42
|
+
bindInstance(): void;
|
|
43
|
+
bindGroup(): void;
|
|
44
|
+
bindDepth(): void;
|
|
32
45
|
get drawingBufferHeight(): number;
|
|
33
46
|
syncSize(): void;
|
|
34
47
|
private renderVariant;
|
|
@@ -3,8 +3,10 @@
|
|
|
3
3
|
*
|
|
4
4
|
* @author Alexander Rose <alexander.rose@weirdbyte.de>
|
|
5
5
|
*/
|
|
6
|
+
import { isWebGL2 } from '../../mol-gl/webgl/compat';
|
|
6
7
|
import { Vec3 } from '../../mol-math/linear-algebra';
|
|
7
8
|
import { spiral2d } from '../../mol-math/misc';
|
|
9
|
+
import { isTimingMode } from '../../mol-util/debug';
|
|
8
10
|
import { unpackRGBToInt, unpackRGBAToDepth } from '../../mol-util/number-packing';
|
|
9
11
|
import { StereoCamera } from '../camera/stereo';
|
|
10
12
|
import { cameraUnproject } from '../camera/util';
|
|
@@ -18,11 +20,80 @@ var PickPass = /** @class */ (function () {
|
|
|
18
20
|
var pickScale = pickBaseScale / webgl.pixelRatio;
|
|
19
21
|
this.pickWidth = Math.ceil(drawPass.colorTarget.getWidth() * pickScale);
|
|
20
22
|
this.pickHeight = Math.ceil(drawPass.colorTarget.getHeight() * pickScale);
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
23
|
+
var resources = webgl.resources, drawBuffers = webgl.extensions.drawBuffers, gl = webgl.gl;
|
|
24
|
+
if (drawBuffers) {
|
|
25
|
+
this.objectPickTexture = resources.texture('image-uint8', 'rgba', 'ubyte', 'nearest');
|
|
26
|
+
this.objectPickTexture.define(this.pickWidth, this.pickHeight);
|
|
27
|
+
this.instancePickTexture = resources.texture('image-uint8', 'rgba', 'ubyte', 'nearest');
|
|
28
|
+
this.instancePickTexture.define(this.pickWidth, this.pickHeight);
|
|
29
|
+
this.groupPickTexture = resources.texture('image-uint8', 'rgba', 'ubyte', 'nearest');
|
|
30
|
+
this.groupPickTexture.define(this.pickWidth, this.pickHeight);
|
|
31
|
+
this.depthPickTexture = resources.texture('image-uint8', 'rgba', 'ubyte', 'nearest');
|
|
32
|
+
this.depthPickTexture.define(this.pickWidth, this.pickHeight);
|
|
33
|
+
this.framebuffer = resources.framebuffer();
|
|
34
|
+
this.objectPickFramebuffer = resources.framebuffer();
|
|
35
|
+
this.instancePickFramebuffer = resources.framebuffer();
|
|
36
|
+
this.groupPickFramebuffer = resources.framebuffer();
|
|
37
|
+
this.depthPickFramebuffer = resources.framebuffer();
|
|
38
|
+
this.framebuffer.bind();
|
|
39
|
+
drawBuffers.drawBuffers([
|
|
40
|
+
drawBuffers.COLOR_ATTACHMENT0,
|
|
41
|
+
drawBuffers.COLOR_ATTACHMENT1,
|
|
42
|
+
drawBuffers.COLOR_ATTACHMENT2,
|
|
43
|
+
drawBuffers.COLOR_ATTACHMENT3,
|
|
44
|
+
]);
|
|
45
|
+
this.objectPickTexture.attachFramebuffer(this.framebuffer, 'color0');
|
|
46
|
+
this.instancePickTexture.attachFramebuffer(this.framebuffer, 'color1');
|
|
47
|
+
this.groupPickTexture.attachFramebuffer(this.framebuffer, 'color2');
|
|
48
|
+
this.depthPickTexture.attachFramebuffer(this.framebuffer, 'color3');
|
|
49
|
+
this.depthRenderbuffer = isWebGL2(gl)
|
|
50
|
+
? resources.renderbuffer('depth32f', 'depth', this.pickWidth, this.pickHeight)
|
|
51
|
+
: resources.renderbuffer('depth16', 'depth', this.pickWidth, this.pickHeight);
|
|
52
|
+
this.depthRenderbuffer.attachFramebuffer(this.framebuffer);
|
|
53
|
+
this.objectPickTexture.attachFramebuffer(this.objectPickFramebuffer, 'color0');
|
|
54
|
+
this.instancePickTexture.attachFramebuffer(this.instancePickFramebuffer, 'color0');
|
|
55
|
+
this.groupPickTexture.attachFramebuffer(this.groupPickFramebuffer, 'color0');
|
|
56
|
+
this.depthPickTexture.attachFramebuffer(this.depthPickFramebuffer, 'color0');
|
|
57
|
+
}
|
|
58
|
+
else {
|
|
59
|
+
this.objectPickTarget = webgl.createRenderTarget(this.pickWidth, this.pickHeight);
|
|
60
|
+
this.instancePickTarget = webgl.createRenderTarget(this.pickWidth, this.pickHeight);
|
|
61
|
+
this.groupPickTarget = webgl.createRenderTarget(this.pickWidth, this.pickHeight);
|
|
62
|
+
this.depthPickTarget = webgl.createRenderTarget(this.pickWidth, this.pickHeight);
|
|
63
|
+
}
|
|
25
64
|
}
|
|
65
|
+
PickPass.prototype.bindObject = function () {
|
|
66
|
+
if (this.webgl.extensions.drawBuffers) {
|
|
67
|
+
this.objectPickFramebuffer.bind();
|
|
68
|
+
}
|
|
69
|
+
else {
|
|
70
|
+
this.objectPickTarget.bind();
|
|
71
|
+
}
|
|
72
|
+
};
|
|
73
|
+
PickPass.prototype.bindInstance = function () {
|
|
74
|
+
if (this.webgl.extensions.drawBuffers) {
|
|
75
|
+
this.instancePickFramebuffer.bind();
|
|
76
|
+
}
|
|
77
|
+
else {
|
|
78
|
+
this.instancePickTarget.bind();
|
|
79
|
+
}
|
|
80
|
+
};
|
|
81
|
+
PickPass.prototype.bindGroup = function () {
|
|
82
|
+
if (this.webgl.extensions.drawBuffers) {
|
|
83
|
+
this.groupPickFramebuffer.bind();
|
|
84
|
+
}
|
|
85
|
+
else {
|
|
86
|
+
this.groupPickTarget.bind();
|
|
87
|
+
}
|
|
88
|
+
};
|
|
89
|
+
PickPass.prototype.bindDepth = function () {
|
|
90
|
+
if (this.webgl.extensions.drawBuffers) {
|
|
91
|
+
this.depthPickFramebuffer.bind();
|
|
92
|
+
}
|
|
93
|
+
else {
|
|
94
|
+
this.depthPickTarget.bind();
|
|
95
|
+
}
|
|
96
|
+
};
|
|
26
97
|
Object.defineProperty(PickPass.prototype, "drawingBufferHeight", {
|
|
27
98
|
get: function () {
|
|
28
99
|
return this.drawPass.colorTarget.getHeight();
|
|
@@ -37,17 +108,28 @@ var PickPass = /** @class */ (function () {
|
|
|
37
108
|
if (pickWidth !== this.pickWidth || pickHeight !== this.pickHeight) {
|
|
38
109
|
this.pickWidth = pickWidth;
|
|
39
110
|
this.pickHeight = pickHeight;
|
|
40
|
-
this.
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
111
|
+
if (this.webgl.extensions.drawBuffers) {
|
|
112
|
+
this.objectPickTexture.define(this.pickWidth, this.pickHeight);
|
|
113
|
+
this.instancePickTexture.define(this.pickWidth, this.pickHeight);
|
|
114
|
+
this.groupPickTexture.define(this.pickWidth, this.pickHeight);
|
|
115
|
+
this.depthPickTexture.define(this.pickWidth, this.pickHeight);
|
|
116
|
+
this.depthRenderbuffer.setSize(this.pickWidth, this.pickHeight);
|
|
117
|
+
}
|
|
118
|
+
else {
|
|
119
|
+
this.objectPickTarget.setSize(this.pickWidth, this.pickHeight);
|
|
120
|
+
this.instancePickTarget.setSize(this.pickWidth, this.pickHeight);
|
|
121
|
+
this.groupPickTarget.setSize(this.pickWidth, this.pickHeight);
|
|
122
|
+
this.depthPickTarget.setSize(this.pickWidth, this.pickHeight);
|
|
123
|
+
}
|
|
44
124
|
}
|
|
45
125
|
};
|
|
46
126
|
PickPass.prototype.renderVariant = function (renderer, camera, scene, helper, variant, pickType) {
|
|
47
127
|
renderer.clear(false);
|
|
48
128
|
renderer.update(camera);
|
|
49
129
|
renderer.renderPick(scene.primitives, camera, variant, null, pickType);
|
|
50
|
-
|
|
130
|
+
if (helper.handle.isEnabled) {
|
|
131
|
+
renderer.renderPick(helper.handle.scene, camera, variant, null, pickType);
|
|
132
|
+
}
|
|
51
133
|
if (helper.camera.isEnabled) {
|
|
52
134
|
helper.camera.update(camera);
|
|
53
135
|
renderer.update(helper.camera.camera);
|
|
@@ -55,15 +137,21 @@ var PickPass = /** @class */ (function () {
|
|
|
55
137
|
}
|
|
56
138
|
};
|
|
57
139
|
PickPass.prototype.render = function (renderer, camera, scene, helper) {
|
|
58
|
-
this.
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
140
|
+
if (this.webgl.extensions.drawBuffers) {
|
|
141
|
+
this.framebuffer.bind();
|
|
142
|
+
this.renderVariant(renderer, camera, scene, helper, 'pick', 0 /* PickType.None */);
|
|
143
|
+
}
|
|
144
|
+
else {
|
|
145
|
+
this.objectPickTarget.bind();
|
|
146
|
+
this.renderVariant(renderer, camera, scene, helper, 'pick', 1 /* PickType.Object */);
|
|
147
|
+
this.instancePickTarget.bind();
|
|
148
|
+
this.renderVariant(renderer, camera, scene, helper, 'pick', 2 /* PickType.Instance */);
|
|
149
|
+
this.groupPickTarget.bind();
|
|
150
|
+
this.renderVariant(renderer, camera, scene, helper, 'pick', 3 /* PickType.Group */);
|
|
151
|
+
// printTexture(this.webgl, this.groupPickTarget.texture, { id: 'group' })
|
|
152
|
+
this.depthPickTarget.bind();
|
|
153
|
+
this.renderVariant(renderer, camera, scene, helper, 'depth', 0 /* PickType.None */);
|
|
154
|
+
}
|
|
67
155
|
};
|
|
68
156
|
return PickPass;
|
|
69
157
|
}());
|
|
@@ -106,15 +194,19 @@ var PickHelper = /** @class */ (function () {
|
|
|
106
194
|
this.spiral = spiral2d(Math.round(this.pickScale * this.pickPadding));
|
|
107
195
|
};
|
|
108
196
|
PickHelper.prototype.syncBuffers = function () {
|
|
197
|
+
if (isTimingMode)
|
|
198
|
+
this.webgl.timer.mark('PickHelper.syncBuffers');
|
|
109
199
|
var _a = this, pickX = _a.pickX, pickY = _a.pickY, pickWidth = _a.pickWidth, pickHeight = _a.pickHeight;
|
|
110
|
-
this.pickPass.
|
|
200
|
+
this.pickPass.bindObject();
|
|
111
201
|
this.webgl.readPixels(pickX, pickY, pickWidth, pickHeight, this.objectBuffer);
|
|
112
|
-
this.pickPass.
|
|
202
|
+
this.pickPass.bindInstance();
|
|
113
203
|
this.webgl.readPixels(pickX, pickY, pickWidth, pickHeight, this.instanceBuffer);
|
|
114
|
-
this.pickPass.
|
|
204
|
+
this.pickPass.bindGroup();
|
|
115
205
|
this.webgl.readPixels(pickX, pickY, pickWidth, pickHeight, this.groupBuffer);
|
|
116
|
-
this.pickPass.
|
|
206
|
+
this.pickPass.bindDepth();
|
|
117
207
|
this.webgl.readPixels(pickX, pickY, pickWidth, pickHeight, this.depthBuffer);
|
|
208
|
+
if (isTimingMode)
|
|
209
|
+
this.webgl.timer.markEnd('PickHelper.syncBuffers');
|
|
118
210
|
};
|
|
119
211
|
PickHelper.prototype.getBufferIdx = function (x, y) {
|
|
120
212
|
return (y * this.pickWidth + x) * 4;
|
|
@@ -129,10 +221,12 @@ var PickHelper = /** @class */ (function () {
|
|
|
129
221
|
return unpackRGBToInt(buffer[idx], buffer[idx + 1], buffer[idx + 2]);
|
|
130
222
|
};
|
|
131
223
|
PickHelper.prototype.render = function (camera) {
|
|
224
|
+
if (isTimingMode)
|
|
225
|
+
this.webgl.timer.mark('PickHelper.render');
|
|
132
226
|
var _a = this, pickX = _a.pickX, pickY = _a.pickY, pickWidth = _a.pickWidth, pickHeight = _a.pickHeight, halfPickWidth = _a.halfPickWidth;
|
|
133
227
|
var _b = this, renderer = _b.renderer, scene = _b.scene, helper = _b.helper;
|
|
134
228
|
renderer.setTransparentBackground(false);
|
|
135
|
-
renderer.setDrawingBufferSize(
|
|
229
|
+
renderer.setDrawingBufferSize(pickWidth, pickHeight);
|
|
136
230
|
renderer.setPixelRatio(this.pickScale);
|
|
137
231
|
if (StereoCamera.is(camera)) {
|
|
138
232
|
renderer.setViewport(pickX, pickY, halfPickWidth, pickHeight);
|
|
@@ -145,6 +239,8 @@ var PickHelper = /** @class */ (function () {
|
|
|
145
239
|
this.pickPass.render(renderer, camera, scene, helper);
|
|
146
240
|
}
|
|
147
241
|
this.dirty = false;
|
|
242
|
+
if (isTimingMode)
|
|
243
|
+
this.webgl.timer.markEnd('PickHelper.render');
|
|
148
244
|
};
|
|
149
245
|
PickHelper.prototype.identifyInternal = function (x, y, camera) {
|
|
150
246
|
var _a = this, webgl = _a.webgl, pickScale = _a.pickScale;
|
|
@@ -161,8 +257,12 @@ var PickHelper = /** @class */ (function () {
|
|
|
161
257
|
y > viewport.y + viewport.height)
|
|
162
258
|
return;
|
|
163
259
|
if (this.dirty) {
|
|
260
|
+
if (isTimingMode)
|
|
261
|
+
this.webgl.timer.mark('PickHelper.identify');
|
|
164
262
|
this.render(camera);
|
|
165
263
|
this.syncBuffers();
|
|
264
|
+
if (isTimingMode)
|
|
265
|
+
this.webgl.timer.markEnd('PickHelper.identify');
|
|
166
266
|
}
|
|
167
267
|
var xv = x - viewport.x;
|
|
168
268
|
var yv = y - viewport.y;
|
|
@@ -181,6 +281,7 @@ var PickHelper = /** @class */ (function () {
|
|
|
181
281
|
if (groupId === -1 || groupId === NullId)
|
|
182
282
|
return;
|
|
183
283
|
var z = this.getDepth(xp, yp);
|
|
284
|
+
// console.log('z', z);
|
|
184
285
|
var position = Vec3.create(x, viewport.height - y, z);
|
|
185
286
|
if (StereoCamera.is(camera)) {
|
|
186
287
|
var halfWidth = Math.floor(viewport.width / 2);
|
|
@@ -196,7 +297,7 @@ var PickHelper = /** @class */ (function () {
|
|
|
196
297
|
else {
|
|
197
298
|
cameraUnproject(position, position, viewport, camera.inverseProjectionView);
|
|
198
299
|
}
|
|
199
|
-
// console.log({ { objectId, instanceId, groupId }, position}
|
|
300
|
+
// console.log({ id: { objectId, instanceId, groupId }, position });
|
|
200
301
|
return { id: { objectId: objectId, instanceId: instanceId, groupId: groupId }, position: position };
|
|
201
302
|
};
|
|
202
303
|
PickHelper.prototype.identify = function (x, y, camera) {
|
|
@@ -21,6 +21,7 @@ import { postprocessing_frag } from '../../mol-gl/shader/postprocessing.frag';
|
|
|
21
21
|
import { Color } from '../../mol-util/color';
|
|
22
22
|
import { FxaaParams, FxaaPass } from './fxaa';
|
|
23
23
|
import { SmaaParams, SmaaPass } from './smaa';
|
|
24
|
+
import { isTimingMode } from '../../mol-util/debug';
|
|
24
25
|
var OutlinesSchema = __assign(__assign({}, QuadSchema), { tDepthOpaque: TextureSpec('texture', 'rgba', 'ubyte', 'nearest'), tDepthTransparent: TextureSpec('texture', 'rgba', 'ubyte', 'nearest'), uTexSize: UniformSpec('v2'), dOrthographic: DefineSpec('number'), uNear: UniformSpec('f'), uFar: UniformSpec('f'), uMaxPossibleViewZDiff: UniformSpec('f') });
|
|
25
26
|
function getOutlinesRenderable(ctx, depthTextureOpaque, depthTextureTransparent) {
|
|
26
27
|
var width = depthTextureOpaque.getWidth();
|
|
@@ -304,6 +305,8 @@ var PostprocessingPass = /** @class */ (function () {
|
|
|
304
305
|
ValueCell.update(this.renderable.values.uOcclusionOffset, Vec2.set(this.renderable.values.uOcclusionOffset.ref.value, x, y));
|
|
305
306
|
};
|
|
306
307
|
PostprocessingPass.prototype.render = function (camera, toDrawingBuffer, transparentBackground, backgroundColor, props) {
|
|
308
|
+
if (isTimingMode)
|
|
309
|
+
this.webgl.timer.mark('PostprocessingPass.render');
|
|
307
310
|
this.updateState(camera, transparentBackground, backgroundColor, props);
|
|
308
311
|
if (props.outline.name === 'on') {
|
|
309
312
|
this.outlinesTarget.bind();
|
|
@@ -333,6 +336,8 @@ var PostprocessingPass = /** @class */ (function () {
|
|
|
333
336
|
state.clearColor(0, 0, 0, 1);
|
|
334
337
|
gl.clear(gl.COLOR_BUFFER_BIT);
|
|
335
338
|
this.renderable.render();
|
|
339
|
+
if (isTimingMode)
|
|
340
|
+
this.webgl.timer.markEnd('PostprocessingPass.render');
|
|
336
341
|
};
|
|
337
342
|
return PostprocessingPass;
|
|
338
343
|
}());
|
|
@@ -20,7 +20,7 @@ import { weights_frag } from '../../mol-gl/shader/smaa/weights.frag';
|
|
|
20
20
|
import { edges_vert } from '../../mol-gl/shader/smaa/edges.vert';
|
|
21
21
|
import { edges_frag } from '../../mol-gl/shader/smaa/edges.frag';
|
|
22
22
|
import { Viewport } from '../camera/util';
|
|
23
|
-
import { isDebugMode } from '../../mol-util/debug';
|
|
23
|
+
import { isDebugMode, isTimingMode } from '../../mol-util/debug';
|
|
24
24
|
export var SmaaParams = {
|
|
25
25
|
edgeThreshold: PD.Numeric(0.1, { min: 0.05, max: 0.15, step: 0.01 }),
|
|
26
26
|
maxSearchSteps: PD.Numeric(16, { min: 0, max: 32, step: 1 }),
|
|
@@ -98,6 +98,8 @@ var SmaaPass = /** @class */ (function () {
|
|
|
98
98
|
}
|
|
99
99
|
};
|
|
100
100
|
SmaaPass.prototype.render = function (viewport, target) {
|
|
101
|
+
if (isTimingMode)
|
|
102
|
+
this.webgl.timer.mark('SmaaPass.render');
|
|
101
103
|
this.edgesTarget.bind();
|
|
102
104
|
this.updateState(viewport);
|
|
103
105
|
this.edgesRenderable.render();
|
|
@@ -112,6 +114,8 @@ var SmaaPass = /** @class */ (function () {
|
|
|
112
114
|
}
|
|
113
115
|
this.updateState(viewport);
|
|
114
116
|
this.blendRenderable.render();
|
|
117
|
+
if (isTimingMode)
|
|
118
|
+
this.webgl.timer.markEnd('SmaaPass.render');
|
|
115
119
|
};
|
|
116
120
|
return SmaaPass;
|
|
117
121
|
}());
|
|
@@ -14,7 +14,7 @@ import { ValueCell } from '../../mol-util';
|
|
|
14
14
|
import { quad_vert } from '../../mol-gl/shader/quad.vert';
|
|
15
15
|
import { evaluateWboit_frag } from '../../mol-gl/shader/evaluate-wboit.frag';
|
|
16
16
|
import { Vec2 } from '../../mol-math/linear-algebra';
|
|
17
|
-
import { isDebugMode } from '../../mol-util/debug';
|
|
17
|
+
import { isDebugMode, isTimingMode } from '../../mol-util/debug';
|
|
18
18
|
var EvaluateWboitSchema = __assign(__assign({}, QuadSchema), { tWboitA: TextureSpec('texture', 'rgba', 'float', 'nearest'), tWboitB: TextureSpec('texture', 'rgba', 'float', 'nearest'), uTexSize: UniformSpec('v2') });
|
|
19
19
|
var EvaluateWboitShaderCode = ShaderCode('evaluate-wboit', quad_vert, evaluateWboit_frag);
|
|
20
20
|
function getEvaluateWboitRenderable(ctx, wboitATexture, wboitBTexture) {
|
|
@@ -57,11 +57,15 @@ var WboitPass = /** @class */ (function () {
|
|
|
57
57
|
state.enable(gl.BLEND);
|
|
58
58
|
};
|
|
59
59
|
WboitPass.prototype.render = function () {
|
|
60
|
+
if (isTimingMode)
|
|
61
|
+
this.webgl.timer.mark('WboitPass.render');
|
|
60
62
|
var _a = this.webgl, state = _a.state, gl = _a.gl;
|
|
61
63
|
state.blendFuncSeparate(gl.SRC_ALPHA, gl.ONE_MINUS_SRC_ALPHA, gl.ONE, gl.ONE_MINUS_SRC_ALPHA);
|
|
62
64
|
state.enable(gl.BLEND);
|
|
63
65
|
this.renderable.update();
|
|
64
66
|
this.renderable.render();
|
|
67
|
+
if (isTimingMode)
|
|
68
|
+
this.webgl.timer.markEnd('WboitPass.render');
|
|
65
69
|
};
|
|
66
70
|
WboitPass.prototype.setSize = function (width, height) {
|
|
67
71
|
var _a = this.renderable.values.uTexSize.ref.value, w = _a[0], h = _a[1];
|
|
@@ -63,11 +63,11 @@ var Column;
|
|
|
63
63
|
}
|
|
64
64
|
Column.is = is;
|
|
65
65
|
function Undefined(rowCount, schema) {
|
|
66
|
-
return constColumn(schema['T'], rowCount, schema, 1 /* NotPresent */);
|
|
66
|
+
return constColumn(schema['T'], rowCount, schema, 1 /* ValueKind.NotPresent */);
|
|
67
67
|
}
|
|
68
68
|
Column.Undefined = Undefined;
|
|
69
69
|
function ofConst(v, rowCount, type) {
|
|
70
|
-
return constColumn(v, rowCount, type, 0 /* Present */);
|
|
70
|
+
return constColumn(v, rowCount, type, 0 /* ValueKind.Present */);
|
|
71
71
|
}
|
|
72
72
|
Column.ofConst = ofConst;
|
|
73
73
|
function ofLambda(spec) {
|
|
@@ -227,7 +227,7 @@ function constColumn(v, rowCount, schema, valueKind) {
|
|
|
227
227
|
return {
|
|
228
228
|
schema: schema,
|
|
229
229
|
__array: void 0,
|
|
230
|
-
isDefined: valueKind === 0 /* Present */,
|
|
230
|
+
isDefined: valueKind === 0 /* Column.ValueKind.Present */,
|
|
231
231
|
rowCount: rowCount,
|
|
232
232
|
value: value,
|
|
233
233
|
valueKind: function (row) { return valueKind; },
|
|
@@ -248,7 +248,7 @@ function lambdaColumn(_a) {
|
|
|
248
248
|
isDefined: true,
|
|
249
249
|
rowCount: rowCount,
|
|
250
250
|
value: value,
|
|
251
|
-
valueKind: valueKind ? valueKind : function (row) { return 0 /* Present */; },
|
|
251
|
+
valueKind: valueKind ? valueKind : function (row) { return 0 /* Column.ValueKind.Present */; },
|
|
252
252
|
toArray: function (params) {
|
|
253
253
|
var _a = ColumnHelpers.createArray(rowCount, params), array = _a.array, start = _a.start;
|
|
254
254
|
for (var i = 0, _i = array.length; i < _i; i++)
|
|
@@ -276,7 +276,7 @@ function arrayColumn(_a) {
|
|
|
276
276
|
isDefined: true,
|
|
277
277
|
rowCount: rowCount,
|
|
278
278
|
value: value,
|
|
279
|
-
valueKind: valueKind ? valueKind : function (row) { return 0 /* Present */; },
|
|
279
|
+
valueKind: valueKind ? valueKind : function (row) { return 0 /* Column.ValueKind.Present */; },
|
|
280
280
|
toArray: schema.valueType === 'str'
|
|
281
281
|
? schema.transform === 'lowercase'
|
|
282
282
|
? function (params) {
|
package/lib/mol-data/db/table.js
CHANGED
|
@@ -80,7 +80,7 @@ var Table;
|
|
|
80
80
|
rowCount: rowCount,
|
|
81
81
|
schema: schema[k],
|
|
82
82
|
value: function (r) { return rows[r][k]; },
|
|
83
|
-
valueKind: function (r) { return typeof rows[r][k] === 'undefined' ? 1 /* NotPresent */ : 0 /* Present */; }
|
|
83
|
+
valueKind: function (r) { return typeof rows[r][k] === 'undefined' ? 1 /* Column.ValueKind.NotPresent */ : 0 /* Column.ValueKind.Present */; }
|
|
84
84
|
});
|
|
85
85
|
};
|
|
86
86
|
for (var _a = 0, columns_3 = columns; _a < columns_3.length; _a++) {
|
|
@@ -281,7 +281,7 @@ var Table;
|
|
|
281
281
|
StringBuilder.write(sb, '|');
|
|
282
282
|
for (var i = 0; i < cols.length; i++) {
|
|
283
283
|
var c = table[cols[i]];
|
|
284
|
-
if (c.valueKind(r) === 0 /* Present */) {
|
|
284
|
+
if (c.valueKind(r) === 0 /* Column.ValueKind.Present */) {
|
|
285
285
|
StringBuilder.write(sb, c.value(r));
|
|
286
286
|
StringBuilder.write(sb, '|');
|
|
287
287
|
}
|
|
@@ -8,7 +8,7 @@ import { ArrayCtor } from '../../mol-util/type-helpers';
|
|
|
8
8
|
export declare function arrayFind<T>(array: ArrayLike<T>, f: (v: T) => boolean): T | undefined;
|
|
9
9
|
export declare function iterableToArray<T>(it: IterableIterator<T>): T[];
|
|
10
10
|
/** Fills the array so that array[0] = start and array[array.length - 1] = end */
|
|
11
|
-
export declare function createRangeArray(start: number, end: number, ctor?: ArrayCtor<number>): {
|
|
11
|
+
export declare function createRangeArray(start: number, end: number, ctor?: ArrayCtor<number>): Int32Array | {
|
|
12
12
|
[i: number]: number;
|
|
13
13
|
length: number;
|
|
14
14
|
};
|
|
@@ -17,6 +17,7 @@ import { Box3D } from '../../../mol-math/geometry';
|
|
|
17
17
|
import { accumulate_frag } from '../../../mol-gl/shader/compute/color-smoothing/accumulate.frag';
|
|
18
18
|
import { accumulate_vert } from '../../../mol-gl/shader/compute/color-smoothing/accumulate.vert';
|
|
19
19
|
import { isWebGL2 } from '../../../mol-gl/webgl/compat';
|
|
20
|
+
import { isTimingMode } from '../../../mol-util/debug';
|
|
20
21
|
export var ColorAccumulateSchema = {
|
|
21
22
|
drawCount: ValueSpec('number'),
|
|
22
23
|
instanceCount: ValueSpec('number'),
|
|
@@ -185,6 +186,8 @@ export function calcTextureMeshColorSmoothing(input, resolution, stride, webgl,
|
|
|
185
186
|
var drawBuffers = webgl.extensions.drawBuffers;
|
|
186
187
|
if (!drawBuffers)
|
|
187
188
|
throw new Error('need WebGL draw buffers');
|
|
189
|
+
if (isTimingMode)
|
|
190
|
+
webgl.timer.mark('calcTextureMeshColorSmoothing');
|
|
188
191
|
var gl = webgl.gl, resources = webgl.resources, state = webgl.state, _a = webgl.extensions, colorBufferHalfFloat = _a.colorBufferHalfFloat, textureHalfFloat = _a.textureHalfFloat;
|
|
189
192
|
var isInstanceType = input.colorType.endsWith('Instance');
|
|
190
193
|
var box = Box3D.fromSphere3D(Box3D(), isInstanceType ? input.boundingSphere : input.invariantBoundingSphere);
|
|
@@ -237,6 +240,8 @@ export function calcTextureMeshColorSmoothing(input, resolution, stride, webgl,
|
|
|
237
240
|
drawBuffers.COLOR_ATTACHMENT1,
|
|
238
241
|
]);
|
|
239
242
|
var _c = accumulateRenderable.values, uCurrentSlice = _c.uCurrentSlice, uCurrentX = _c.uCurrentX, uCurrentY = _c.uCurrentY;
|
|
243
|
+
if (isTimingMode)
|
|
244
|
+
webgl.timer.mark('ColorAccumulate.render');
|
|
240
245
|
setAccumulateDefaults(webgl);
|
|
241
246
|
gl.viewport(0, 0, width, height);
|
|
242
247
|
gl.scissor(0, 0, width, height);
|
|
@@ -264,6 +269,8 @@ export function calcTextureMeshColorSmoothing(input, resolution, stride, webgl,
|
|
|
264
269
|
accumulateTexture.detachFramebuffer(framebuffer, 0);
|
|
265
270
|
countTexture.detachFramebuffer(framebuffer, 1);
|
|
266
271
|
drawBuffers.drawBuffers([gl.COLOR_ATTACHMENT0, gl.NONE]);
|
|
272
|
+
if (isTimingMode)
|
|
273
|
+
webgl.timer.markEnd('ColorAccumulate.render');
|
|
267
274
|
// const accImage = new Float32Array(width * height * 4);
|
|
268
275
|
// accumulateTexture.attachFramebuffer(framebuffer, 0);
|
|
269
276
|
// webgl.readPixels(0, 0, width, height, accImage);
|
|
@@ -275,6 +282,8 @@ export function calcTextureMeshColorSmoothing(input, resolution, stride, webgl,
|
|
|
275
282
|
// console.log(cntImage);
|
|
276
283
|
// printTextureImage({ array: cntImage, width, height }, { scale: 1 });
|
|
277
284
|
// normalize
|
|
285
|
+
if (isTimingMode)
|
|
286
|
+
webgl.timer.mark('ColorNormalize.render');
|
|
278
287
|
if (!texture)
|
|
279
288
|
texture = resources.texture('image-uint8', 'rgba', 'ubyte', 'linear');
|
|
280
289
|
texture.define(width, height);
|
|
@@ -286,6 +295,8 @@ export function calcTextureMeshColorSmoothing(input, resolution, stride, webgl,
|
|
|
286
295
|
gl.scissor(0, 0, width, height);
|
|
287
296
|
gl.clear(gl.COLOR_BUFFER_BIT);
|
|
288
297
|
normalizeRenderable.render();
|
|
298
|
+
if (isTimingMode)
|
|
299
|
+
webgl.timer.markEnd('ColorNormalize.render');
|
|
289
300
|
// const normImage = new Uint8Array(width * height * 4);
|
|
290
301
|
// texture.attachFramebuffer(framebuffer, 0);
|
|
291
302
|
// webgl.readPixels(0, 0, width, height, normImage);
|
|
@@ -293,6 +304,8 @@ export function calcTextureMeshColorSmoothing(input, resolution, stride, webgl,
|
|
|
293
304
|
// printTextureImage({ array: normImage, width, height }, { scale: 1 });
|
|
294
305
|
var gridTransform = Vec4.create(min[0], min[1], min[2], scaleFactor);
|
|
295
306
|
var type = isInstanceType ? 'volumeInstance' : 'volume';
|
|
307
|
+
if (isTimingMode)
|
|
308
|
+
webgl.timer.markEnd('calcTextureMeshColorSmoothing');
|
|
296
309
|
return { texture: texture, gridDim: gridDim, gridTexDim: Vec2.create(width, height), gridTransform: gridTransform, type: type };
|
|
297
310
|
}
|
|
298
311
|
//
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Copyright (c) 2020 mol* contributors, licensed under MIT, See LICENSE file for more info.
|
|
2
|
+
* Copyright (c) 2020-2022 mol* contributors, licensed under MIT, See LICENSE file for more info.
|
|
3
3
|
*
|
|
4
4
|
* @author David Sehnal <david.sehnal@gmail.com>
|
|
5
5
|
*/
|
|
@@ -7,7 +7,7 @@ import { RenderableSchema, Values, UnboxedValues } from '../renderable/schema';
|
|
|
7
7
|
import { WebGLContext } from '../webgl/context';
|
|
8
8
|
import { RegularGrid3d } from '../../mol-math/geometry/common';
|
|
9
9
|
import { RuntimeContext } from '../../mol-task';
|
|
10
|
-
export declare function canComputeGrid3dOnGPU(webgl?: WebGLContext):
|
|
10
|
+
export declare function canComputeGrid3dOnGPU(webgl?: WebGLContext): webgl is WebGLContext;
|
|
11
11
|
export interface Grid3DComputeRenderableSpec<S extends RenderableSchema, P, CS> {
|
|
12
12
|
schema: S;
|
|
13
13
|
loopBounds?: (keyof S)[];
|