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.
Files changed (516) hide show
  1. package/build/viewer/index.html +4 -1
  2. package/build/viewer/molstar.js +1 -1
  3. package/lib/apps/viewer/app.d.ts +1 -1
  4. package/lib/apps/viewer/app.js +1 -1
  5. package/lib/apps/viewer/index.html +4 -1
  6. package/lib/cli/cif2bcif/converter.js +1 -1
  7. package/lib/commonjs/apps/viewer/app.d.ts +1 -1
  8. package/lib/commonjs/apps/viewer/app.js +2 -1
  9. package/lib/commonjs/cli/cif2bcif/converter.js +1 -1
  10. package/lib/commonjs/examples/alpha-orbitals/index.d.ts +1 -1
  11. package/lib/commonjs/examples/alpha-orbitals/index.js +4 -1
  12. package/lib/commonjs/examples/basic-wrapper/custom-theme.js +1 -1
  13. package/lib/commonjs/examples/proteopedia-wrapper/coloring.js +3 -3
  14. package/lib/commonjs/extensions/alpha-orbitals/density.d.ts +1 -1
  15. package/lib/commonjs/extensions/alpha-orbitals/density.js +6 -2
  16. package/lib/commonjs/extensions/alpha-orbitals/orbitals.d.ts +1 -1
  17. package/lib/commonjs/extensions/alpha-orbitals/orbitals.js +6 -3
  18. package/lib/commonjs/extensions/anvil/algorithm.js +1 -1
  19. package/lib/commonjs/extensions/cellpack/color/generate.js +1 -1
  20. package/lib/commonjs/extensions/cellpack/color/provided.js +1 -1
  21. package/lib/commonjs/extensions/cellpack/state.js +1 -1
  22. package/lib/commonjs/extensions/dnatco/confal-pyramids/color.js +1 -1
  23. package/lib/commonjs/extensions/g3d/model.js +1 -1
  24. package/lib/commonjs/extensions/model-archive/quality-assessment/color/plddt.js +1 -1
  25. package/lib/commonjs/extensions/model-archive/quality-assessment/color/qmean.js +1 -1
  26. package/lib/commonjs/extensions/pdbe/structure-quality-report/color.js +1 -1
  27. package/lib/commonjs/extensions/rcsb/assembly-symmetry/color.js +4 -4
  28. package/lib/commonjs/extensions/rcsb/validation-report/color/density-fit.js +1 -1
  29. package/lib/commonjs/extensions/rcsb/validation-report/color/geometry-quality.js +2 -2
  30. package/lib/commonjs/extensions/rcsb/validation-report/color/random-coil-index.js +1 -1
  31. package/lib/commonjs/extensions/rcsb/validation-report/representation.js +2 -2
  32. package/lib/commonjs/mol-canvas3d/canvas3d.js +4 -0
  33. package/lib/commonjs/mol-canvas3d/controls/trackball.js +7 -7
  34. package/lib/commonjs/mol-canvas3d/helper/camera-helper.js +14 -14
  35. package/lib/commonjs/mol-canvas3d/helper/interaction-events.js +5 -5
  36. package/lib/commonjs/mol-canvas3d/passes/draw.js +34 -5
  37. package/lib/commonjs/mol-canvas3d/passes/fxaa.js +5 -0
  38. package/lib/commonjs/mol-canvas3d/passes/marking.js +5 -0
  39. package/lib/commonjs/mol-canvas3d/passes/multi-sample.js +9 -0
  40. package/lib/commonjs/mol-canvas3d/passes/pick.d.ts +18 -5
  41. package/lib/commonjs/mol-canvas3d/passes/pick.js +125 -24
  42. package/lib/commonjs/mol-canvas3d/passes/postprocessing.js +5 -0
  43. package/lib/commonjs/mol-canvas3d/passes/smaa.js +4 -0
  44. package/lib/commonjs/mol-canvas3d/passes/wboit.js +4 -0
  45. package/lib/commonjs/mol-data/db/column.js +5 -5
  46. package/lib/commonjs/mol-data/db/table.js +2 -2
  47. package/lib/commonjs/mol-data/util/array.d.ts +1 -1
  48. package/lib/commonjs/mol-geo/geometry/texture-mesh/color-smoothing.js +13 -0
  49. package/lib/commonjs/mol-gl/compute/grid3d.d.ts +2 -2
  50. package/lib/commonjs/mol-gl/compute/grid3d.js +30 -8
  51. package/lib/commonjs/mol-gl/compute/histogram-pyramid/reduction.d.ts +1 -1
  52. package/lib/commonjs/mol-gl/compute/histogram-pyramid/reduction.js +6 -1
  53. package/lib/commonjs/mol-gl/compute/histogram-pyramid/sum.d.ts +1 -1
  54. package/lib/commonjs/mol-gl/compute/histogram-pyramid/sum.js +6 -1
  55. package/lib/commonjs/mol-gl/compute/marching-cubes/active-voxels.d.ts +1 -1
  56. package/lib/commonjs/mol-gl/compute/marching-cubes/active-voxels.js +6 -1
  57. package/lib/commonjs/mol-gl/compute/marching-cubes/isosurface.d.ts +1 -1
  58. package/lib/commonjs/mol-gl/compute/marching-cubes/isosurface.js +10 -10
  59. package/lib/commonjs/mol-gl/renderer.js +77 -32
  60. package/lib/commonjs/mol-gl/scene.js +2 -0
  61. package/lib/commonjs/mol-gl/shader/chunks/assign-color-varying.glsl.d.ts +1 -1
  62. package/lib/commonjs/mol-gl/shader/chunks/assign-color-varying.glsl.js +1 -1
  63. package/lib/commonjs/mol-gl/shader/chunks/assign-material-color.glsl.d.ts +1 -1
  64. package/lib/commonjs/mol-gl/shader/chunks/assign-material-color.glsl.js +1 -1
  65. package/lib/commonjs/mol-gl/shader/chunks/color-frag-params.glsl.d.ts +1 -1
  66. package/lib/commonjs/mol-gl/shader/chunks/color-frag-params.glsl.js +1 -1
  67. package/lib/commonjs/mol-gl/shader/chunks/color-vert-params.glsl.d.ts +1 -1
  68. package/lib/commonjs/mol-gl/shader/chunks/color-vert-params.glsl.js +1 -1
  69. package/lib/commonjs/mol-gl/shader/cylinders.frag.d.ts +1 -1
  70. package/lib/commonjs/mol-gl/shader/cylinders.frag.js +1 -1
  71. package/lib/commonjs/mol-gl/shader/direct-volume.frag.d.ts +1 -1
  72. package/lib/commonjs/mol-gl/shader/direct-volume.frag.js +1 -1
  73. package/lib/commonjs/mol-gl/shader/image.frag.d.ts +1 -1
  74. package/lib/commonjs/mol-gl/shader/image.frag.js +1 -1
  75. package/lib/commonjs/mol-gl/shader/lines.frag.d.ts +1 -1
  76. package/lib/commonjs/mol-gl/shader/lines.frag.js +1 -1
  77. package/lib/commonjs/mol-gl/shader/mesh.frag.d.ts +1 -1
  78. package/lib/commonjs/mol-gl/shader/mesh.frag.js +1 -1
  79. package/lib/commonjs/mol-gl/shader/points.frag.d.ts +1 -1
  80. package/lib/commonjs/mol-gl/shader/points.frag.js +1 -1
  81. package/lib/commonjs/mol-gl/shader/spheres.frag.d.ts +1 -1
  82. package/lib/commonjs/mol-gl/shader/spheres.frag.js +1 -1
  83. package/lib/commonjs/mol-gl/shader/text.frag.d.ts +1 -1
  84. package/lib/commonjs/mol-gl/shader/text.frag.js +1 -1
  85. package/lib/commonjs/mol-gl/shader-code.d.ts +1 -1
  86. package/lib/commonjs/mol-gl/shader-code.js +41 -9
  87. package/lib/commonjs/mol-gl/webgl/compat.d.ts +34 -1
  88. package/lib/commonjs/mol-gl/webgl/compat.js +50 -2
  89. package/lib/commonjs/mol-gl/webgl/context.d.ts +2 -0
  90. package/lib/commonjs/mol-gl/webgl/context.js +3 -0
  91. package/lib/commonjs/mol-gl/webgl/extensions.d.ts +3 -2
  92. package/lib/commonjs/mol-gl/webgl/extensions.js +6 -1
  93. package/lib/commonjs/mol-gl/webgl/timer.d.ts +22 -0
  94. package/lib/commonjs/mol-gl/webgl/timer.js +169 -0
  95. package/lib/commonjs/mol-io/common/binary-cif/array-encoder.js +18 -18
  96. package/lib/commonjs/mol-io/common/binary-cif/decoder.js +16 -16
  97. package/lib/commonjs/mol-io/common/binary-cif/encoding.js +9 -9
  98. package/lib/commonjs/mol-io/reader/cif/binary/field.js +3 -3
  99. package/lib/commonjs/mol-io/reader/cif/data-model.js +14 -14
  100. package/lib/commonjs/mol-io/reader/cif/schema.js +1 -1
  101. package/lib/commonjs/mol-io/reader/cif/text/parser.js +23 -23
  102. package/lib/commonjs/mol-io/reader/common/text/column/fixed.js +1 -1
  103. package/lib/commonjs/mol-io/reader/common/text/column/token.js +1 -1
  104. package/lib/commonjs/mol-io/reader/common/text/number-parser.js +6 -6
  105. package/lib/commonjs/mol-io/reader/csv/parser.js +8 -8
  106. package/lib/commonjs/mol-io/writer/cif/encoder/binary.js +10 -10
  107. package/lib/commonjs/mol-io/writer/cif/encoder/text.js +7 -7
  108. package/lib/commonjs/mol-io/writer/cif/encoder.js +8 -8
  109. package/lib/commonjs/mol-io/writer/mol2/encoder.js +4 -4
  110. package/lib/commonjs/mol-math/geometry/gaussian-density/gpu.js +13 -2
  111. package/lib/commonjs/mol-model/sequence/alignment/sequence.js +3 -3
  112. package/lib/commonjs/mol-model/sequence/sequence.js +9 -9
  113. package/lib/commonjs/mol-model/structure/export/categories/atom_site_operator_mapping.js +3 -3
  114. package/lib/commonjs/mol-model/structure/export/categories/secondary-structure.js +2 -2
  115. package/lib/commonjs/mol-model/structure/export/categories/utils.js +1 -1
  116. package/lib/commonjs/mol-model/structure/model/model.js +2 -2
  117. package/lib/commonjs/mol-model/structure/model/properties/custom/indexed.js +6 -6
  118. package/lib/commonjs/mol-model/structure/model/properties/utils/atomic-ranges.js +1 -1
  119. package/lib/commonjs/mol-model/structure/model/types.js +116 -116
  120. package/lib/commonjs/mol-model/structure/query/context.js +1 -1
  121. package/lib/commonjs/mol-model/structure/query/queries/generators.js +5 -5
  122. package/lib/commonjs/mol-model/structure/query/queries/internal.js +4 -4
  123. package/lib/commonjs/mol-model/structure/query/queries/modifiers.js +4 -4
  124. package/lib/commonjs/mol-model/structure/query/utils/structure-distance.d.ts +5 -54
  125. package/lib/commonjs/mol-model/structure/query/utils/structure-distance.js +9 -9
  126. package/lib/commonjs/mol-model/structure/structure/carbohydrates/constants.js +106 -106
  127. package/lib/commonjs/mol-model/structure/structure/element/loci.js +5 -5
  128. package/lib/commonjs/mol-model/structure/structure/element/stats.js +5 -5
  129. package/lib/commonjs/mol-model/structure/structure/properties.js +5 -5
  130. package/lib/commonjs/mol-model/structure/structure/structure.js +11 -11
  131. package/lib/commonjs/mol-model/structure/structure/unit/bonds/inter-compute.js +5 -5
  132. package/lib/commonjs/mol-model/structure/structure/unit/bonds/intra-compute.js +4 -4
  133. package/lib/commonjs/mol-model/structure/structure/unit/bonds.js +2 -2
  134. package/lib/commonjs/mol-model/structure/structure/unit/resonance.js +1 -1
  135. package/lib/commonjs/mol-model/structure/structure/unit/rings/compute.js +6 -6
  136. package/lib/commonjs/mol-model/structure/structure/unit/rings.js +6 -6
  137. package/lib/commonjs/mol-model/structure/structure/unit.js +16 -16
  138. package/lib/commonjs/mol-model/structure/structure/util/superposition-sifts-mapping.js +1 -1
  139. package/lib/commonjs/mol-model/structure/util.js +4 -4
  140. package/lib/commonjs/mol-model-formats/structure/basic/atomic.js +2 -2
  141. package/lib/commonjs/mol-model-formats/structure/basic/parser.js +4 -4
  142. package/lib/commonjs/mol-model-formats/structure/basic/properties.js +1 -1
  143. package/lib/commonjs/mol-model-formats/structure/basic/sort.js +1 -1
  144. package/lib/commonjs/mol-model-formats/structure/basic/util.js +1 -1
  145. package/lib/commonjs/mol-model-formats/structure/cif-core.js +6 -6
  146. package/lib/commonjs/mol-model-formats/structure/common/entity.js +1 -1
  147. package/lib/commonjs/mol-model-formats/structure/cube.js +1 -1
  148. package/lib/commonjs/mol-model-formats/structure/gro.js +1 -1
  149. package/lib/commonjs/mol-model-formats/structure/mol.js +1 -1
  150. package/lib/commonjs/mol-model-formats/structure/mol2.js +4 -4
  151. package/lib/commonjs/mol-model-formats/structure/prmtop.js +1 -1
  152. package/lib/commonjs/mol-model-formats/structure/property/bonds/chem_comp.js +3 -3
  153. package/lib/commonjs/mol-model-formats/structure/property/bonds/index-pair.js +1 -1
  154. package/lib/commonjs/mol-model-formats/structure/property/bonds/struct_conn.js +6 -6
  155. package/lib/commonjs/mol-model-formats/structure/property/secondary-structure.js +8 -8
  156. package/lib/commonjs/mol-model-formats/structure/psf.js +1 -1
  157. package/lib/commonjs/mol-model-formats/structure/top.js +1 -1
  158. package/lib/commonjs/mol-model-formats/structure/xyz.js +1 -1
  159. package/lib/commonjs/mol-model-props/computed/accessible-surface-area/shrake-rupley/radii.js +2 -2
  160. package/lib/commonjs/mol-model-props/computed/accessible-surface-area/shrake-rupley.js +3 -3
  161. package/lib/commonjs/mol-model-props/computed/accessible-surface-area.js +2 -2
  162. package/lib/commonjs/mol-model-props/computed/chemistry/functional-group.js +31 -31
  163. package/lib/commonjs/mol-model-props/computed/chemistry/geometry.js +22 -22
  164. package/lib/commonjs/mol-model-props/computed/chemistry/valence-model.js +32 -32
  165. package/lib/commonjs/mol-model-props/computed/interactions/charged.js +39 -39
  166. package/lib/commonjs/mol-model-props/computed/interactions/common.js +34 -34
  167. package/lib/commonjs/mol-model-props/computed/interactions/contacts-builder.js +1 -1
  168. package/lib/commonjs/mol-model-props/computed/interactions/contacts.js +1 -1
  169. package/lib/commonjs/mol-model-props/computed/interactions/halogen-bonds.js +12 -12
  170. package/lib/commonjs/mol-model-props/computed/interactions/hydrogen-bonds.js +32 -32
  171. package/lib/commonjs/mol-model-props/computed/interactions/hydrophobic.js +9 -9
  172. package/lib/commonjs/mol-model-props/computed/interactions/metal.js +26 -26
  173. package/lib/commonjs/mol-model-props/computed/interactions/refine.js +20 -20
  174. package/lib/commonjs/mol-model-props/computed/representations/interactions-inter-unit-cylinder.js +2 -2
  175. package/lib/commonjs/mol-model-props/computed/representations/interactions-intra-unit-cylinder.js +2 -2
  176. package/lib/commonjs/mol-model-props/computed/secondary-structure/dssp/bends.js +1 -1
  177. package/lib/commonjs/mol-model-props/computed/secondary-structure/dssp/bridges.js +12 -12
  178. package/lib/commonjs/mol-model-props/computed/secondary-structure/dssp/helices.js +6 -6
  179. package/lib/commonjs/mol-model-props/computed/secondary-structure/dssp/ladders.js +3 -3
  180. package/lib/commonjs/mol-model-props/computed/secondary-structure/dssp/sheets.js +11 -11
  181. package/lib/commonjs/mol-model-props/computed/secondary-structure/dssp/turns.js +3 -3
  182. package/lib/commonjs/mol-model-props/computed/secondary-structure/dssp.js +30 -30
  183. package/lib/commonjs/mol-model-props/computed/themes/accessible-surface-area.js +1 -1
  184. package/lib/commonjs/mol-model-props/computed/themes/interaction-type.js +10 -10
  185. package/lib/commonjs/mol-model-props/integrative/cross-link-restraint/color.js +1 -1
  186. package/lib/commonjs/mol-model-props/integrative/cross-link-restraint/format.js +3 -3
  187. package/lib/commonjs/mol-model-props/sequence/sifts-mapping.js +1 -1
  188. package/lib/commonjs/mol-model-props/sequence/themes/sifts-mapping.js +1 -1
  189. package/lib/commonjs/mol-plugin/animation-loop.d.ts +2 -1
  190. package/lib/commonjs/mol-plugin/animation-loop.js +18 -5
  191. package/lib/commonjs/mol-plugin/behavior/dynamic/camera.js +12 -12
  192. package/lib/commonjs/mol-plugin/behavior/dynamic/representation.js +7 -7
  193. package/lib/commonjs/mol-plugin/context.d.ts +2 -2
  194. package/lib/commonjs/mol-plugin/state.d.ts +1 -14
  195. package/lib/commonjs/mol-plugin-state/formats/volume.d.ts +12 -11
  196. package/lib/commonjs/mol-plugin-state/formats/volume.js +20 -13
  197. package/lib/commonjs/mol-plugin-state/helpers/structure-selection-query.js +5 -5
  198. package/lib/commonjs/mol-plugin-state/transforms/representation.js +2 -2
  199. package/lib/commonjs/mol-plugin-ui/controls/parameters.d.ts +1 -1
  200. package/lib/commonjs/mol-plugin-ui/sequence/polymer.js +1 -1
  201. package/lib/commonjs/mol-plugin-ui/sequence/sequence.js +1 -1
  202. package/lib/commonjs/mol-plugin-ui/structure/focus.js +1 -1
  203. package/lib/commonjs/mol-plugin-ui/viewport.d.ts +2 -2
  204. package/lib/commonjs/mol-repr/structure/visual/bond-inter-unit-cylinder.js +10 -10
  205. package/lib/commonjs/mol-repr/structure/visual/bond-inter-unit-line.js +10 -10
  206. package/lib/commonjs/mol-repr/structure/visual/bond-intra-unit-cylinder.js +12 -12
  207. package/lib/commonjs/mol-repr/structure/visual/bond-intra-unit-line.js +12 -12
  208. package/lib/commonjs/mol-repr/structure/visual/carbohydrate-symbol-mesh.js +16 -16
  209. package/lib/commonjs/mol-repr/structure/visual/carbohydrate-terminal-link-cylinder.js +1 -1
  210. package/lib/commonjs/mol-repr/structure/visual/gaussian-surface-mesh.js +9 -0
  211. package/lib/commonjs/mol-repr/structure/visual/orientation-ellipsoid-mesh.js +4 -4
  212. package/lib/commonjs/mol-repr/structure/visual/polymer-direction-wedge.js +1 -1
  213. package/lib/commonjs/mol-repr/structure/visual/polymer-trace-mesh.js +2 -2
  214. package/lib/commonjs/mol-repr/structure/visual/util/bond.js +2 -2
  215. package/lib/commonjs/mol-repr/structure/visual/util/common.js +3 -3
  216. package/lib/commonjs/mol-repr/structure/visual/util/link.js +30 -30
  217. package/lib/commonjs/mol-repr/structure/visual/util/polymer/backbone.js +6 -6
  218. package/lib/commonjs/mol-repr/structure/visual/util/polymer/gap-iterator.js +3 -3
  219. package/lib/commonjs/mol-repr/structure/visual/util/polymer/trace-iterator.js +20 -20
  220. package/lib/commonjs/mol-repr/structure/visual/util/polymer.js +6 -6
  221. package/lib/commonjs/mol-script/language/symbol-table/core.d.ts +2 -2
  222. package/lib/commonjs/mol-script/runtime/query/table.js +13 -13
  223. package/lib/commonjs/mol-state/object.d.ts +3 -3
  224. package/lib/commonjs/mol-task/util/user-timing.js +1 -1
  225. package/lib/commonjs/mol-theme/clipping.js +19 -19
  226. package/lib/commonjs/mol-theme/color/atom-id.js +1 -1
  227. package/lib/commonjs/mol-theme/color/carbohydrate-symbol.js +1 -1
  228. package/lib/commonjs/mol-theme/color/chain-id.js +4 -4
  229. package/lib/commonjs/mol-theme/color/element-index.js +1 -1
  230. package/lib/commonjs/mol-theme/color/element-symbol.js +1 -1
  231. package/lib/commonjs/mol-theme/color/entity-id.js +4 -4
  232. package/lib/commonjs/mol-theme/color/entity-source.js +5 -4
  233. package/lib/commonjs/mol-theme/color/hydrophobicity.js +1 -1
  234. package/lib/commonjs/mol-theme/color/illustrative.js +1 -1
  235. package/lib/commonjs/mol-theme/color/model-index.js +1 -1
  236. package/lib/commonjs/mol-theme/color/molecule-type.js +8 -8
  237. package/lib/commonjs/mol-theme/color/occupancy.js +1 -1
  238. package/lib/commonjs/mol-theme/color/operator-hkl.js +1 -1
  239. package/lib/commonjs/mol-theme/color/operator-name.js +1 -1
  240. package/lib/commonjs/mol-theme/color/partial-charge.js +1 -1
  241. package/lib/commonjs/mol-theme/color/polymer-id.js +4 -4
  242. package/lib/commonjs/mol-theme/color/polymer-index.js +1 -1
  243. package/lib/commonjs/mol-theme/color/residue-name.js +1 -1
  244. package/lib/commonjs/mol-theme/color/secondary-structure.js +12 -12
  245. package/lib/commonjs/mol-theme/color/sequence-id.js +7 -7
  246. package/lib/commonjs/mol-theme/color/shape-group.js +1 -1
  247. package/lib/commonjs/mol-theme/color/uncertainty.js +1 -1
  248. package/lib/commonjs/mol-theme/color/uniform.js +1 -1
  249. package/lib/commonjs/mol-theme/color/unit-index.js +1 -1
  250. package/lib/commonjs/mol-theme/color/volume-value.js +1 -1
  251. package/lib/commonjs/mol-theme/label.js +3 -3
  252. package/lib/commonjs/mol-util/binding.js +4 -4
  253. package/lib/commonjs/mol-util/debug.d.ts +6 -1
  254. package/lib/commonjs/mol-util/debug.js +11 -1
  255. package/lib/commonjs/mol-util/input/input-observer.js +20 -20
  256. package/lib/commonjs/mol-util/string-builder.js +1 -1
  257. package/lib/commonjs/servers/model/preprocess/converter.js +1 -1
  258. package/lib/commonjs/servers/model/server/query.js +1 -1
  259. package/lib/commonjs/servers/model/utils/fetch-retry.js +3 -2
  260. package/lib/commonjs/servers/volume/server/algebra/coordinate.js +6 -6
  261. package/lib/commonjs/servers/volume/server/query/encode.js +1 -1
  262. package/lib/examples/alpha-orbitals/index.d.ts +1 -1
  263. package/lib/examples/alpha-orbitals/index.html +11 -0
  264. package/lib/examples/alpha-orbitals/index.js +4 -1
  265. package/lib/examples/basic-wrapper/custom-theme.js +1 -1
  266. package/lib/examples/proteopedia-wrapper/coloring.js +3 -3
  267. package/lib/extensions/alpha-orbitals/density.d.ts +1 -1
  268. package/lib/extensions/alpha-orbitals/density.js +6 -2
  269. package/lib/extensions/alpha-orbitals/orbitals.d.ts +1 -1
  270. package/lib/extensions/alpha-orbitals/orbitals.js +6 -3
  271. package/lib/extensions/anvil/algorithm.js +1 -1
  272. package/lib/extensions/cellpack/color/generate.js +1 -1
  273. package/lib/extensions/cellpack/color/provided.js +1 -1
  274. package/lib/extensions/cellpack/state.js +1 -1
  275. package/lib/extensions/dnatco/confal-pyramids/color.js +1 -1
  276. package/lib/extensions/g3d/model.js +1 -1
  277. package/lib/extensions/model-archive/quality-assessment/color/plddt.js +1 -1
  278. package/lib/extensions/model-archive/quality-assessment/color/qmean.js +1 -1
  279. package/lib/extensions/pdbe/structure-quality-report/color.js +1 -1
  280. package/lib/extensions/rcsb/assembly-symmetry/color.js +4 -4
  281. package/lib/extensions/rcsb/validation-report/color/density-fit.js +1 -1
  282. package/lib/extensions/rcsb/validation-report/color/geometry-quality.js +2 -2
  283. package/lib/extensions/rcsb/validation-report/color/random-coil-index.js +1 -1
  284. package/lib/extensions/rcsb/validation-report/representation.js +2 -2
  285. package/lib/mol-canvas3d/canvas3d.js +5 -1
  286. package/lib/mol-canvas3d/controls/trackball.js +7 -7
  287. package/lib/mol-canvas3d/helper/camera-helper.js +14 -14
  288. package/lib/mol-canvas3d/helper/interaction-events.js +5 -5
  289. package/lib/mol-canvas3d/passes/draw.js +34 -5
  290. package/lib/mol-canvas3d/passes/fxaa.js +5 -0
  291. package/lib/mol-canvas3d/passes/marking.js +5 -0
  292. package/lib/mol-canvas3d/passes/multi-sample.js +9 -0
  293. package/lib/mol-canvas3d/passes/pick.d.ts +18 -5
  294. package/lib/mol-canvas3d/passes/pick.js +125 -24
  295. package/lib/mol-canvas3d/passes/postprocessing.js +5 -0
  296. package/lib/mol-canvas3d/passes/smaa.js +5 -1
  297. package/lib/mol-canvas3d/passes/wboit.js +5 -1
  298. package/lib/mol-data/db/column.js +5 -5
  299. package/lib/mol-data/db/table.js +2 -2
  300. package/lib/mol-data/util/array.d.ts +1 -1
  301. package/lib/mol-geo/geometry/texture-mesh/color-smoothing.js +13 -0
  302. package/lib/mol-gl/compute/grid3d.d.ts +2 -2
  303. package/lib/mol-gl/compute/grid3d.js +30 -8
  304. package/lib/mol-gl/compute/histogram-pyramid/reduction.d.ts +1 -1
  305. package/lib/mol-gl/compute/histogram-pyramid/reduction.js +6 -1
  306. package/lib/mol-gl/compute/histogram-pyramid/sum.d.ts +1 -1
  307. package/lib/mol-gl/compute/histogram-pyramid/sum.js +6 -1
  308. package/lib/mol-gl/compute/marching-cubes/active-voxels.d.ts +1 -1
  309. package/lib/mol-gl/compute/marching-cubes/active-voxels.js +6 -1
  310. package/lib/mol-gl/compute/marching-cubes/isosurface.d.ts +1 -1
  311. package/lib/mol-gl/compute/marching-cubes/isosurface.js +10 -10
  312. package/lib/mol-gl/renderer.js +77 -32
  313. package/lib/mol-gl/scene.js +2 -0
  314. package/lib/mol-gl/shader/chunks/assign-color-varying.glsl.d.ts +1 -1
  315. package/lib/mol-gl/shader/chunks/assign-color-varying.glsl.js +1 -1
  316. package/lib/mol-gl/shader/chunks/assign-material-color.glsl.d.ts +1 -1
  317. package/lib/mol-gl/shader/chunks/assign-material-color.glsl.js +1 -1
  318. package/lib/mol-gl/shader/chunks/color-frag-params.glsl.d.ts +1 -1
  319. package/lib/mol-gl/shader/chunks/color-frag-params.glsl.js +1 -1
  320. package/lib/mol-gl/shader/chunks/color-vert-params.glsl.d.ts +1 -1
  321. package/lib/mol-gl/shader/chunks/color-vert-params.glsl.js +1 -1
  322. package/lib/mol-gl/shader/cylinders.frag.d.ts +1 -1
  323. package/lib/mol-gl/shader/cylinders.frag.js +1 -1
  324. package/lib/mol-gl/shader/direct-volume.frag.d.ts +1 -1
  325. package/lib/mol-gl/shader/direct-volume.frag.js +1 -1
  326. package/lib/mol-gl/shader/image.frag.d.ts +1 -1
  327. package/lib/mol-gl/shader/image.frag.js +1 -1
  328. package/lib/mol-gl/shader/lines.frag.d.ts +1 -1
  329. package/lib/mol-gl/shader/lines.frag.js +1 -1
  330. package/lib/mol-gl/shader/mesh.frag.d.ts +1 -1
  331. package/lib/mol-gl/shader/mesh.frag.js +1 -1
  332. package/lib/mol-gl/shader/points.frag.d.ts +1 -1
  333. package/lib/mol-gl/shader/points.frag.js +1 -1
  334. package/lib/mol-gl/shader/spheres.frag.d.ts +1 -1
  335. package/lib/mol-gl/shader/spheres.frag.js +1 -1
  336. package/lib/mol-gl/shader/text.frag.d.ts +1 -1
  337. package/lib/mol-gl/shader/text.frag.js +1 -1
  338. package/lib/mol-gl/shader-code.d.ts +1 -1
  339. package/lib/mol-gl/shader-code.js +41 -9
  340. package/lib/mol-gl/webgl/compat.d.ts +34 -1
  341. package/lib/mol-gl/webgl/compat.js +48 -1
  342. package/lib/mol-gl/webgl/context.d.ts +2 -0
  343. package/lib/mol-gl/webgl/context.js +3 -0
  344. package/lib/mol-gl/webgl/extensions.d.ts +3 -2
  345. package/lib/mol-gl/webgl/extensions.js +7 -2
  346. package/lib/mol-gl/webgl/timer.d.ts +22 -0
  347. package/lib/mol-gl/webgl/timer.js +164 -0
  348. package/lib/mol-io/common/binary-cif/array-encoder.js +18 -18
  349. package/lib/mol-io/common/binary-cif/decoder.js +16 -16
  350. package/lib/mol-io/common/binary-cif/encoding.js +9 -9
  351. package/lib/mol-io/reader/cif/binary/field.js +3 -3
  352. package/lib/mol-io/reader/cif/data-model.js +14 -14
  353. package/lib/mol-io/reader/cif/schema.js +1 -1
  354. package/lib/mol-io/reader/cif/text/parser.js +23 -23
  355. package/lib/mol-io/reader/common/text/column/fixed.js +1 -1
  356. package/lib/mol-io/reader/common/text/column/token.js +1 -1
  357. package/lib/mol-io/reader/common/text/number-parser.js +6 -6
  358. package/lib/mol-io/reader/csv/parser.js +8 -8
  359. package/lib/mol-io/writer/cif/encoder/binary.js +10 -10
  360. package/lib/mol-io/writer/cif/encoder/text.js +7 -7
  361. package/lib/mol-io/writer/cif/encoder.js +8 -8
  362. package/lib/mol-io/writer/mol2/encoder.js +4 -4
  363. package/lib/mol-math/geometry/gaussian-density/gpu.js +13 -2
  364. package/lib/mol-model/sequence/alignment/sequence.js +3 -3
  365. package/lib/mol-model/sequence/sequence.js +9 -9
  366. package/lib/mol-model/structure/export/categories/atom_site_operator_mapping.js +3 -3
  367. package/lib/mol-model/structure/export/categories/secondary-structure.js +2 -2
  368. package/lib/mol-model/structure/export/categories/utils.js +1 -1
  369. package/lib/mol-model/structure/model/model.js +2 -2
  370. package/lib/mol-model/structure/model/properties/custom/indexed.js +6 -6
  371. package/lib/mol-model/structure/model/properties/utils/atomic-ranges.js +1 -1
  372. package/lib/mol-model/structure/model/types.js +116 -116
  373. package/lib/mol-model/structure/query/context.js +1 -1
  374. package/lib/mol-model/structure/query/queries/generators.js +5 -5
  375. package/lib/mol-model/structure/query/queries/internal.js +4 -4
  376. package/lib/mol-model/structure/query/queries/modifiers.js +4 -4
  377. package/lib/mol-model/structure/query/utils/structure-distance.d.ts +5 -54
  378. package/lib/mol-model/structure/query/utils/structure-distance.js +9 -9
  379. package/lib/mol-model/structure/structure/carbohydrates/constants.js +106 -106
  380. package/lib/mol-model/structure/structure/element/loci.js +5 -5
  381. package/lib/mol-model/structure/structure/element/stats.js +5 -5
  382. package/lib/mol-model/structure/structure/properties.js +5 -5
  383. package/lib/mol-model/structure/structure/structure.js +11 -11
  384. package/lib/mol-model/structure/structure/unit/bonds/inter-compute.js +5 -5
  385. package/lib/mol-model/structure/structure/unit/bonds/intra-compute.js +4 -4
  386. package/lib/mol-model/structure/structure/unit/bonds.js +2 -2
  387. package/lib/mol-model/structure/structure/unit/resonance.js +1 -1
  388. package/lib/mol-model/structure/structure/unit/rings/compute.js +6 -6
  389. package/lib/mol-model/structure/structure/unit/rings.js +6 -6
  390. package/lib/mol-model/structure/structure/unit.js +16 -16
  391. package/lib/mol-model/structure/structure/util/superposition-sifts-mapping.js +1 -1
  392. package/lib/mol-model/structure/util.js +4 -4
  393. package/lib/mol-model-formats/structure/basic/atomic.js +2 -2
  394. package/lib/mol-model-formats/structure/basic/parser.js +4 -4
  395. package/lib/mol-model-formats/structure/basic/properties.js +1 -1
  396. package/lib/mol-model-formats/structure/basic/sort.js +1 -1
  397. package/lib/mol-model-formats/structure/basic/util.js +1 -1
  398. package/lib/mol-model-formats/structure/cif-core.js +6 -6
  399. package/lib/mol-model-formats/structure/common/entity.js +1 -1
  400. package/lib/mol-model-formats/structure/cube.js +1 -1
  401. package/lib/mol-model-formats/structure/gro.js +1 -1
  402. package/lib/mol-model-formats/structure/mol.js +1 -1
  403. package/lib/mol-model-formats/structure/mol2.js +4 -4
  404. package/lib/mol-model-formats/structure/prmtop.js +1 -1
  405. package/lib/mol-model-formats/structure/property/bonds/chem_comp.js +3 -3
  406. package/lib/mol-model-formats/structure/property/bonds/index-pair.js +1 -1
  407. package/lib/mol-model-formats/structure/property/bonds/struct_conn.js +6 -6
  408. package/lib/mol-model-formats/structure/property/secondary-structure.js +8 -8
  409. package/lib/mol-model-formats/structure/psf.js +1 -1
  410. package/lib/mol-model-formats/structure/top.js +1 -1
  411. package/lib/mol-model-formats/structure/xyz.js +1 -1
  412. package/lib/mol-model-props/computed/accessible-surface-area/shrake-rupley/radii.js +2 -2
  413. package/lib/mol-model-props/computed/accessible-surface-area/shrake-rupley.js +3 -3
  414. package/lib/mol-model-props/computed/accessible-surface-area.js +2 -2
  415. package/lib/mol-model-props/computed/chemistry/functional-group.js +31 -31
  416. package/lib/mol-model-props/computed/chemistry/geometry.js +22 -22
  417. package/lib/mol-model-props/computed/chemistry/valence-model.js +32 -32
  418. package/lib/mol-model-props/computed/interactions/charged.js +39 -39
  419. package/lib/mol-model-props/computed/interactions/common.js +34 -34
  420. package/lib/mol-model-props/computed/interactions/contacts-builder.js +1 -1
  421. package/lib/mol-model-props/computed/interactions/contacts.js +1 -1
  422. package/lib/mol-model-props/computed/interactions/halogen-bonds.js +12 -12
  423. package/lib/mol-model-props/computed/interactions/hydrogen-bonds.js +32 -32
  424. package/lib/mol-model-props/computed/interactions/hydrophobic.js +9 -9
  425. package/lib/mol-model-props/computed/interactions/metal.js +26 -26
  426. package/lib/mol-model-props/computed/interactions/refine.js +20 -20
  427. package/lib/mol-model-props/computed/representations/interactions-inter-unit-cylinder.js +2 -2
  428. package/lib/mol-model-props/computed/representations/interactions-intra-unit-cylinder.js +2 -2
  429. package/lib/mol-model-props/computed/secondary-structure/dssp/bends.js +1 -1
  430. package/lib/mol-model-props/computed/secondary-structure/dssp/bridges.js +12 -12
  431. package/lib/mol-model-props/computed/secondary-structure/dssp/helices.js +6 -6
  432. package/lib/mol-model-props/computed/secondary-structure/dssp/ladders.js +3 -3
  433. package/lib/mol-model-props/computed/secondary-structure/dssp/sheets.js +11 -11
  434. package/lib/mol-model-props/computed/secondary-structure/dssp/turns.js +3 -3
  435. package/lib/mol-model-props/computed/secondary-structure/dssp.js +30 -30
  436. package/lib/mol-model-props/computed/themes/accessible-surface-area.js +1 -1
  437. package/lib/mol-model-props/computed/themes/interaction-type.js +10 -10
  438. package/lib/mol-model-props/integrative/cross-link-restraint/color.js +1 -1
  439. package/lib/mol-model-props/integrative/cross-link-restraint/format.js +3 -3
  440. package/lib/mol-model-props/sequence/sifts-mapping.js +1 -1
  441. package/lib/mol-model-props/sequence/themes/sifts-mapping.js +1 -1
  442. package/lib/mol-plugin/animation-loop.d.ts +2 -1
  443. package/lib/mol-plugin/animation-loop.js +18 -5
  444. package/lib/mol-plugin/behavior/dynamic/camera.js +12 -12
  445. package/lib/mol-plugin/behavior/dynamic/representation.js +7 -7
  446. package/lib/mol-plugin/context.d.ts +2 -2
  447. package/lib/mol-plugin/state.d.ts +1 -14
  448. package/lib/mol-plugin/version.js +2 -2
  449. package/lib/mol-plugin-state/formats/volume.d.ts +12 -11
  450. package/lib/mol-plugin-state/formats/volume.js +20 -13
  451. package/lib/mol-plugin-state/helpers/structure-selection-query.js +5 -5
  452. package/lib/mol-plugin-state/transforms/representation.js +2 -2
  453. package/lib/mol-plugin-ui/controls/parameters.d.ts +1 -1
  454. package/lib/mol-plugin-ui/sequence/polymer.js +1 -1
  455. package/lib/mol-plugin-ui/sequence/sequence.js +1 -1
  456. package/lib/mol-plugin-ui/structure/focus.js +1 -1
  457. package/lib/mol-plugin-ui/viewport.d.ts +2 -2
  458. package/lib/mol-repr/structure/visual/bond-inter-unit-cylinder.js +10 -10
  459. package/lib/mol-repr/structure/visual/bond-inter-unit-line.js +10 -10
  460. package/lib/mol-repr/structure/visual/bond-intra-unit-cylinder.js +12 -12
  461. package/lib/mol-repr/structure/visual/bond-intra-unit-line.js +12 -12
  462. package/lib/mol-repr/structure/visual/carbohydrate-symbol-mesh.js +16 -16
  463. package/lib/mol-repr/structure/visual/carbohydrate-terminal-link-cylinder.js +1 -1
  464. package/lib/mol-repr/structure/visual/gaussian-surface-mesh.js +9 -0
  465. package/lib/mol-repr/structure/visual/orientation-ellipsoid-mesh.js +4 -4
  466. package/lib/mol-repr/structure/visual/polymer-direction-wedge.js +1 -1
  467. package/lib/mol-repr/structure/visual/polymer-trace-mesh.js +2 -2
  468. package/lib/mol-repr/structure/visual/util/bond.js +2 -2
  469. package/lib/mol-repr/structure/visual/util/common.js +3 -3
  470. package/lib/mol-repr/structure/visual/util/link.js +30 -30
  471. package/lib/mol-repr/structure/visual/util/polymer/backbone.js +6 -6
  472. package/lib/mol-repr/structure/visual/util/polymer/gap-iterator.js +3 -3
  473. package/lib/mol-repr/structure/visual/util/polymer/trace-iterator.js +20 -20
  474. package/lib/mol-repr/structure/visual/util/polymer.js +6 -6
  475. package/lib/mol-script/language/symbol-table/core.d.ts +2 -2
  476. package/lib/mol-script/runtime/query/table.js +13 -13
  477. package/lib/mol-state/object.d.ts +3 -3
  478. package/lib/mol-task/util/user-timing.js +1 -1
  479. package/lib/mol-theme/clipping.js +19 -19
  480. package/lib/mol-theme/color/atom-id.js +1 -1
  481. package/lib/mol-theme/color/carbohydrate-symbol.js +1 -1
  482. package/lib/mol-theme/color/chain-id.js +4 -4
  483. package/lib/mol-theme/color/element-index.js +1 -1
  484. package/lib/mol-theme/color/element-symbol.js +1 -1
  485. package/lib/mol-theme/color/entity-id.js +4 -4
  486. package/lib/mol-theme/color/entity-source.js +5 -4
  487. package/lib/mol-theme/color/hydrophobicity.js +1 -1
  488. package/lib/mol-theme/color/illustrative.js +1 -1
  489. package/lib/mol-theme/color/model-index.js +1 -1
  490. package/lib/mol-theme/color/molecule-type.js +8 -8
  491. package/lib/mol-theme/color/occupancy.js +1 -1
  492. package/lib/mol-theme/color/operator-hkl.js +1 -1
  493. package/lib/mol-theme/color/operator-name.js +1 -1
  494. package/lib/mol-theme/color/partial-charge.js +1 -1
  495. package/lib/mol-theme/color/polymer-id.js +4 -4
  496. package/lib/mol-theme/color/polymer-index.js +1 -1
  497. package/lib/mol-theme/color/residue-name.js +1 -1
  498. package/lib/mol-theme/color/secondary-structure.js +12 -12
  499. package/lib/mol-theme/color/sequence-id.js +7 -7
  500. package/lib/mol-theme/color/shape-group.js +1 -1
  501. package/lib/mol-theme/color/uncertainty.js +1 -1
  502. package/lib/mol-theme/color/uniform.js +1 -1
  503. package/lib/mol-theme/color/unit-index.js +1 -1
  504. package/lib/mol-theme/color/volume-value.js +1 -1
  505. package/lib/mol-theme/label.js +3 -3
  506. package/lib/mol-util/binding.js +4 -4
  507. package/lib/mol-util/debug.d.ts +6 -1
  508. package/lib/mol-util/debug.js +9 -1
  509. package/lib/mol-util/input/input-observer.js +20 -20
  510. package/lib/mol-util/string-builder.js +1 -1
  511. package/lib/servers/model/preprocess/converter.js +1 -1
  512. package/lib/servers/model/server/query.js +1 -1
  513. package/lib/servers/model/utils/fetch-retry.js +3 -2
  514. package/lib/servers/volume/server/algebra/coordinate.js +6 -6
  515. package/lib/servers/volume/server/query/encode.js +1 -1
  516. 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: RenderTarget;
26
- readonly instancePickTarget: RenderTarget;
27
- readonly groupPickTarget: RenderTarget;
28
- readonly depthPickTarget: RenderTarget;
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
- this.objectPickTarget = webgl.createRenderTarget(this.pickWidth, this.pickHeight);
22
- this.instancePickTarget = webgl.createRenderTarget(this.pickWidth, this.pickHeight);
23
- this.groupPickTarget = webgl.createRenderTarget(this.pickWidth, this.pickHeight);
24
- this.depthPickTarget = webgl.createRenderTarget(this.pickWidth, this.pickHeight);
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.objectPickTarget.setSize(this.pickWidth, this.pickHeight);
41
- this.instancePickTarget.setSize(this.pickWidth, this.pickHeight);
42
- this.groupPickTarget.setSize(this.pickWidth, this.pickHeight);
43
- this.depthPickTarget.setSize(this.pickWidth, this.pickHeight);
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
- renderer.renderPick(helper.handle.scene, camera, variant, null, pickType);
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.objectPickTarget.bind();
59
- this.renderVariant(renderer, camera, scene, helper, 'pick', 1 /* Object */);
60
- this.instancePickTarget.bind();
61
- this.renderVariant(renderer, camera, scene, helper, 'pick', 2 /* Instance */);
62
- this.groupPickTarget.bind();
63
- this.renderVariant(renderer, camera, scene, helper, 'pick', 3 /* Group */);
64
- // printTexture(this.webgl, this.groupPickTarget.texture, { id: 'group' })
65
- this.depthPickTarget.bind();
66
- this.renderVariant(renderer, camera, scene, helper, 'depth', 0 /* None */);
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.objectPickTarget.bind();
200
+ this.pickPass.bindObject();
111
201
  this.webgl.readPixels(pickX, pickY, pickWidth, pickHeight, this.objectBuffer);
112
- this.pickPass.instancePickTarget.bind();
202
+ this.pickPass.bindInstance();
113
203
  this.webgl.readPixels(pickX, pickY, pickWidth, pickHeight, this.instanceBuffer);
114
- this.pickPass.groupPickTarget.bind();
204
+ this.pickPass.bindGroup();
115
205
  this.webgl.readPixels(pickX, pickY, pickWidth, pickHeight, this.groupBuffer);
116
- this.pickPass.depthPickTarget.bind();
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(this.pickPass.objectPickTarget.getWidth(), this.pickPass.objectPickTarget.getHeight());
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) {
@@ -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): boolean;
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)[];