molstar 4.2.0 → 4.4.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 (1216) hide show
  1. package/build/viewer/molstar.css +1 -1
  2. package/build/viewer/molstar.js +1 -1
  3. package/lib/apps/docking-viewer/viewport.d.ts +1 -1
  4. package/lib/apps/docking-viewer/viewport.js +2 -1
  5. package/lib/apps/mesoscale-explorer/app.d.ts +3 -1
  6. package/lib/apps/mesoscale-explorer/app.js +12 -1
  7. package/lib/apps/mesoscale-explorer/behavior/camera.d.ts +12 -0
  8. package/lib/apps/mesoscale-explorer/behavior/camera.js +32 -6
  9. package/lib/apps/mesoscale-explorer/behavior/select.d.ts +1 -0
  10. package/lib/apps/mesoscale-explorer/behavior/select.js +58 -9
  11. package/lib/apps/mesoscale-explorer/data/cellpack/model.js +4 -6
  12. package/lib/apps/mesoscale-explorer/data/cellpack/preset.js +8 -5
  13. package/lib/apps/mesoscale-explorer/data/generic/model.d.ts +1 -0
  14. package/lib/apps/mesoscale-explorer/data/generic/model.js +2 -1
  15. package/lib/apps/mesoscale-explorer/data/generic/preset.js +7 -6
  16. package/lib/apps/mesoscale-explorer/data/mmcif/model.js +3 -1
  17. package/lib/apps/mesoscale-explorer/data/mmcif/preset.js +6 -3
  18. package/lib/apps/mesoscale-explorer/data/petworld/model.js +3 -1
  19. package/lib/apps/mesoscale-explorer/data/petworld/preset.js +6 -3
  20. package/lib/apps/mesoscale-explorer/data/state.d.ts +48 -10
  21. package/lib/apps/mesoscale-explorer/data/state.js +83 -8
  22. package/lib/apps/mesoscale-explorer/index.html +6 -1
  23. package/lib/apps/mesoscale-explorer/style.scss +33 -0
  24. package/lib/apps/mesoscale-explorer/ui/entities.d.ts +23 -1
  25. package/lib/apps/mesoscale-explorer/ui/entities.js +301 -32
  26. package/lib/apps/mesoscale-explorer/ui/panels.d.ts +1 -0
  27. package/lib/apps/mesoscale-explorer/ui/panels.js +42 -5
  28. package/lib/apps/mesoscale-explorer/ui/states.d.ts +60 -2
  29. package/lib/apps/mesoscale-explorer/ui/states.js +471 -11
  30. package/lib/apps/viewer/app.d.ts +12 -5
  31. package/lib/apps/viewer/app.js +30 -1
  32. package/lib/commonjs/apps/docking-viewer/viewport.d.ts +1 -1
  33. package/lib/commonjs/apps/docking-viewer/viewport.js +2 -1
  34. package/lib/commonjs/apps/mesoscale-explorer/app.d.ts +3 -1
  35. package/lib/commonjs/apps/mesoscale-explorer/app.js +12 -1
  36. package/lib/commonjs/apps/mesoscale-explorer/behavior/camera.d.ts +12 -0
  37. package/lib/commonjs/apps/mesoscale-explorer/behavior/camera.js +34 -8
  38. package/lib/commonjs/apps/mesoscale-explorer/behavior/select.d.ts +1 -0
  39. package/lib/commonjs/apps/mesoscale-explorer/behavior/select.js +58 -9
  40. package/lib/commonjs/apps/mesoscale-explorer/data/cellpack/model.js +4 -6
  41. package/lib/commonjs/apps/mesoscale-explorer/data/cellpack/preset.js +8 -6
  42. package/lib/commonjs/apps/mesoscale-explorer/data/generic/model.d.ts +1 -0
  43. package/lib/commonjs/apps/mesoscale-explorer/data/generic/model.js +2 -1
  44. package/lib/commonjs/apps/mesoscale-explorer/data/generic/preset.js +9 -9
  45. package/lib/commonjs/apps/mesoscale-explorer/data/mmcif/model.js +3 -1
  46. package/lib/commonjs/apps/mesoscale-explorer/data/mmcif/preset.js +6 -4
  47. package/lib/commonjs/apps/mesoscale-explorer/data/petworld/model.js +3 -1
  48. package/lib/commonjs/apps/mesoscale-explorer/data/petworld/preset.js +6 -4
  49. package/lib/commonjs/apps/mesoscale-explorer/data/state.d.ts +48 -10
  50. package/lib/commonjs/apps/mesoscale-explorer/data/state.js +107 -28
  51. package/lib/commonjs/apps/mesoscale-explorer/data/util.js +2 -3
  52. package/lib/commonjs/apps/mesoscale-explorer/ui/entities.d.ts +23 -1
  53. package/lib/commonjs/apps/mesoscale-explorer/ui/entities.js +302 -30
  54. package/lib/commonjs/apps/mesoscale-explorer/ui/panels.d.ts +1 -0
  55. package/lib/commonjs/apps/mesoscale-explorer/ui/panels.js +39 -2
  56. package/lib/commonjs/apps/mesoscale-explorer/ui/states.d.ts +60 -2
  57. package/lib/commonjs/apps/mesoscale-explorer/ui/states.js +477 -13
  58. package/lib/commonjs/apps/viewer/app.d.ts +12 -5
  59. package/lib/commonjs/apps/viewer/app.js +29 -0
  60. package/lib/commonjs/cli/chem-comp-dict/util.js +7 -7
  61. package/lib/commonjs/cli/cif2bcif/converter.js +1 -2
  62. package/lib/commonjs/cli/cifschema/util/cif-dic.js +2 -3
  63. package/lib/commonjs/cli/cifschema/util/generate.js +1 -2
  64. package/lib/commonjs/cli/cifschema/util/helper.js +1 -2
  65. package/lib/commonjs/cli/cifschema/util/schema.js +9 -10
  66. package/lib/commonjs/cli/state-docs/pd-to-md.js +1 -2
  67. package/lib/commonjs/cli/structure-info/helpers.js +2 -3
  68. package/lib/commonjs/cli/structure-info/model.js +11 -12
  69. package/lib/commonjs/examples/alpha-orbitals/controls.js +1 -2
  70. package/lib/commonjs/examples/basic-wrapper/custom-theme.js +2 -2
  71. package/lib/commonjs/examples/basic-wrapper/superposition.js +3 -3
  72. package/lib/commonjs/examples/domain-annotation-server/mapping.js +1 -2
  73. package/lib/commonjs/examples/lighting/index.d.ts +1 -1
  74. package/lib/commonjs/examples/lighting/index.js +2 -1
  75. package/lib/commonjs/examples/proteopedia-wrapper/coloring.d.ts +5 -20
  76. package/lib/commonjs/examples/proteopedia-wrapper/coloring.js +1 -2
  77. package/lib/commonjs/examples/proteopedia-wrapper/ui/controls.js +1 -2
  78. package/lib/commonjs/examples/task.js +6 -6
  79. package/lib/commonjs/extensions/alpha-orbitals/collocation.js +1 -2
  80. package/lib/commonjs/extensions/alpha-orbitals/data-model.js +4 -5
  81. package/lib/commonjs/extensions/alpha-orbitals/density.js +2 -3
  82. package/lib/commonjs/extensions/alpha-orbitals/gpu/compute.js +2 -3
  83. package/lib/commonjs/extensions/alpha-orbitals/orbitals.js +2 -3
  84. package/lib/commonjs/extensions/alpha-orbitals/spherical-functions.js +2 -2
  85. package/lib/commonjs/extensions/alpha-orbitals/transforms.d.ts +3 -3
  86. package/lib/commonjs/extensions/anvil/algorithm.js +5 -5
  87. package/lib/commonjs/extensions/anvil/behavior.d.ts +1 -0
  88. package/lib/commonjs/extensions/anvil/behavior.js +2 -2
  89. package/lib/commonjs/extensions/anvil/representation.d.ts +4 -0
  90. package/lib/commonjs/extensions/anvil/representation.js +3 -3
  91. package/lib/commonjs/extensions/assembly-symmetry/behavior.d.ts +1 -0
  92. package/lib/commonjs/extensions/assembly-symmetry/behavior.js +3 -3
  93. package/lib/commonjs/extensions/assembly-symmetry/color.d.ts +2 -2
  94. package/lib/commonjs/extensions/assembly-symmetry/color.js +3 -3
  95. package/lib/commonjs/extensions/assembly-symmetry/prop.js +3 -3
  96. package/lib/commonjs/extensions/assembly-symmetry/representation.d.ts +1 -0
  97. package/lib/commonjs/extensions/assembly-symmetry/representation.js +2 -2
  98. package/lib/commonjs/extensions/dnatco/confal-pyramids/behavior.js +2 -2
  99. package/lib/commonjs/extensions/dnatco/confal-pyramids/color.js +3 -3
  100. package/lib/commonjs/extensions/dnatco/confal-pyramids/representation.d.ts +3 -0
  101. package/lib/commonjs/extensions/dnatco/confal-pyramids/representation.js +3 -3
  102. package/lib/commonjs/extensions/dnatco/ntc-tube/behavior.js +2 -2
  103. package/lib/commonjs/extensions/dnatco/ntc-tube/color.js +3 -3
  104. package/lib/commonjs/extensions/dnatco/ntc-tube/representation.d.ts +3 -0
  105. package/lib/commonjs/extensions/dnatco/ntc-tube/representation.js +3 -3
  106. package/lib/commonjs/extensions/g3d/data.js +2 -3
  107. package/lib/commonjs/extensions/g3d/format.d.ts +3 -3
  108. package/lib/commonjs/extensions/g3d/model.js +5 -5
  109. package/lib/commonjs/extensions/geo-export/mesh-exporter.d.ts +2 -2
  110. package/lib/commonjs/extensions/geo-export/ui.d.ts +0 -1
  111. package/lib/commonjs/extensions/meshes/examples.js +9 -9
  112. package/lib/commonjs/extensions/meshes/mesh-extension.d.ts +3 -5
  113. package/lib/commonjs/extensions/meshes/mesh-extension.js +2 -2
  114. package/lib/commonjs/extensions/meshes/mesh-streaming/behavior.d.ts +3 -3
  115. package/lib/commonjs/extensions/meshes/mesh-streaming/server-info.d.ts +3 -3
  116. package/lib/commonjs/extensions/meshes/mesh-utils.js +9 -9
  117. package/lib/commonjs/extensions/model-archive/quality-assessment/color/plddt.d.ts +1 -1
  118. package/lib/commonjs/extensions/model-archive/quality-assessment/color/plddt.js +11 -8
  119. package/lib/commonjs/extensions/model-archive/quality-assessment/color/qmean.js +3 -3
  120. package/lib/commonjs/extensions/model-export/export.js +2 -2
  121. package/lib/commonjs/extensions/model-export/ui.d.ts +0 -1
  122. package/lib/commonjs/extensions/mp4-export/controls.d.ts +1 -1
  123. package/lib/commonjs/extensions/mp4-export/encoder.js +2 -3
  124. package/lib/commonjs/extensions/mp4-export/ui.d.ts +0 -1
  125. package/lib/commonjs/extensions/mvs/camera.js +4 -5
  126. package/lib/commonjs/extensions/mvs/components/annotation-color-theme.js +2 -2
  127. package/lib/commonjs/extensions/mvs/components/annotation-label/representation.d.ts +32 -34
  128. package/lib/commonjs/extensions/mvs/components/annotation-label/representation.js +2 -2
  129. package/lib/commonjs/extensions/mvs/components/annotation-label/visual.d.ts +16 -16
  130. package/lib/commonjs/extensions/mvs/components/annotation-label/visual.js +2 -2
  131. package/lib/commonjs/extensions/mvs/components/annotation-prop.js +2 -2
  132. package/lib/commonjs/extensions/mvs/components/annotation-structure-component.js +4 -4
  133. package/lib/commonjs/extensions/mvs/components/custom-label/representation.d.ts +32 -32
  134. package/lib/commonjs/extensions/mvs/components/custom-label/representation.js +2 -2
  135. package/lib/commonjs/extensions/mvs/components/custom-label/visual.d.ts +16 -16
  136. package/lib/commonjs/extensions/mvs/components/custom-label/visual.js +2 -2
  137. package/lib/commonjs/extensions/mvs/components/formats.d.ts +6 -6
  138. package/lib/commonjs/extensions/mvs/components/formats.js +2 -2
  139. package/lib/commonjs/extensions/mvs/components/is-mvs-model-prop.js +3 -3
  140. package/lib/commonjs/extensions/mvs/components/multilayer-color-theme.js +3 -3
  141. package/lib/commonjs/extensions/mvs/components/selector.js +3 -3
  142. package/lib/commonjs/extensions/mvs/helpers/indexing.d.ts +2 -2
  143. package/lib/commonjs/extensions/mvs/helpers/label-text.js +1 -2
  144. package/lib/commonjs/extensions/mvs/helpers/param-definition.js +2 -3
  145. package/lib/commonjs/extensions/mvs/helpers/schemas.d.ts +1 -1
  146. package/lib/commonjs/extensions/mvs/helpers/schemas.js +2 -2
  147. package/lib/commonjs/extensions/mvs/helpers/selections.js +6 -7
  148. package/lib/commonjs/extensions/mvs/helpers/utils.d.ts +1 -1
  149. package/lib/commonjs/extensions/mvs/helpers/utils.js +7 -7
  150. package/lib/commonjs/extensions/mvs/load-helpers.d.ts +1 -1
  151. package/lib/commonjs/extensions/mvs/load-helpers.js +17 -17
  152. package/lib/commonjs/extensions/mvs/load.js +1 -2
  153. package/lib/commonjs/extensions/mvs/tree/generic/params-schema.js +8 -8
  154. package/lib/commonjs/extensions/mvs/tree/generic/tree-schema.js +8 -9
  155. package/lib/commonjs/extensions/mvs/tree/generic/tree-utils.js +10 -11
  156. package/lib/commonjs/extensions/mvs/tree/molstar/conversion.js +4 -4
  157. package/lib/commonjs/extensions/mvs/tree/mvs/mvs-builder.d.ts +0 -2
  158. package/lib/commonjs/extensions/mvs/tree/mvs/mvs-builder.js +3 -3
  159. package/lib/commonjs/extensions/pdbe/structure-quality-report/color.js +2 -2
  160. package/lib/commonjs/extensions/rcsb/validation-report/color/density-fit.js +2 -2
  161. package/lib/commonjs/extensions/rcsb/validation-report/color/geometry-quality.js +3 -3
  162. package/lib/commonjs/extensions/rcsb/validation-report/color/random-coil-index.js +2 -2
  163. package/lib/commonjs/extensions/rcsb/validation-report/representation.d.ts +5 -0
  164. package/lib/commonjs/extensions/rcsb/validation-report/representation.js +5 -5
  165. package/lib/commonjs/extensions/sb-ncbr/index.d.ts +8 -0
  166. package/lib/commonjs/extensions/sb-ncbr/index.js +14 -1
  167. package/lib/commonjs/extensions/sb-ncbr/partial-charges/color.js +3 -3
  168. package/lib/commonjs/extensions/sb-ncbr/partial-charges/labels.js +1 -2
  169. package/lib/commonjs/extensions/sb-ncbr/partial-charges/property.js +2 -2
  170. package/lib/commonjs/extensions/sb-ncbr/tunnels/actions.d.ts +20 -0
  171. package/lib/commonjs/extensions/sb-ncbr/tunnels/actions.js +89 -0
  172. package/lib/commonjs/extensions/sb-ncbr/tunnels/algorithm.d.ts +26 -0
  173. package/lib/commonjs/extensions/sb-ncbr/tunnels/algorithm.js +473 -0
  174. package/lib/commonjs/extensions/sb-ncbr/tunnels/behavior.d.ts +40 -0
  175. package/lib/commonjs/extensions/sb-ncbr/tunnels/behavior.js +96 -0
  176. package/lib/commonjs/extensions/sb-ncbr/tunnels/data-model.d.ts +146 -0
  177. package/lib/commonjs/extensions/sb-ncbr/tunnels/data-model.js +28 -0
  178. package/lib/commonjs/extensions/sb-ncbr/tunnels/examples.d.ts +12 -0
  179. package/lib/commonjs/extensions/sb-ncbr/tunnels/examples.js +54 -0
  180. package/lib/commonjs/extensions/sb-ncbr/tunnels/props.d.ts +19 -0
  181. package/lib/commonjs/extensions/sb-ncbr/tunnels/props.js +26 -0
  182. package/lib/commonjs/extensions/sb-ncbr/tunnels/representation.d.ts +29 -0
  183. package/lib/commonjs/extensions/sb-ncbr/tunnels/representation.js +99 -0
  184. package/lib/commonjs/extensions/volumes-and-segmentations/entry-root.d.ts +3 -3
  185. package/lib/commonjs/extensions/volumes-and-segmentations/entry-root.js +3 -3
  186. package/lib/commonjs/extensions/volumes-and-segmentations/entry-state.d.ts +3 -3
  187. package/lib/commonjs/extensions/volumes-and-segmentations/external-api.js +2 -3
  188. package/lib/commonjs/extensions/volumes-and-segmentations/global-state.d.ts +3 -3
  189. package/lib/commonjs/extensions/volumes-and-segmentations/helpers.js +6 -6
  190. package/lib/commonjs/extensions/volumes-and-segmentations/ui.d.ts +0 -1
  191. package/lib/commonjs/extensions/zenodo/ui.d.ts +0 -1
  192. package/lib/commonjs/mol-canvas3d/camera/transition.d.ts +1 -1
  193. package/lib/commonjs/mol-canvas3d/camera/transition.js +23 -6
  194. package/lib/commonjs/mol-canvas3d/camera/util.js +3 -4
  195. package/lib/commonjs/mol-canvas3d/canvas3d.d.ts +26 -1
  196. package/lib/commonjs/mol-canvas3d/canvas3d.js +4 -0
  197. package/lib/commonjs/mol-canvas3d/helper/bounding-sphere-helper.d.ts +1 -6
  198. package/lib/commonjs/mol-canvas3d/helper/camera-helper.js +2 -2
  199. package/lib/commonjs/mol-canvas3d/helper/handle-helper.d.ts +1 -0
  200. package/lib/commonjs/mol-canvas3d/helper/handle-helper.js +2 -2
  201. package/lib/commonjs/mol-canvas3d/helper/helper.d.ts +2 -0
  202. package/lib/commonjs/mol-canvas3d/passes/dof.d.ts +34 -0
  203. package/lib/commonjs/mol-canvas3d/passes/dof.js +167 -0
  204. package/lib/commonjs/mol-canvas3d/passes/draw.d.ts +2 -0
  205. package/lib/commonjs/mol-canvas3d/passes/draw.js +31 -8
  206. package/lib/commonjs/mol-canvas3d/passes/image.d.ts +10 -0
  207. package/lib/commonjs/mol-canvas3d/passes/multi-sample.d.ts +2 -1
  208. package/lib/commonjs/mol-canvas3d/passes/multi-sample.js +4 -3
  209. package/lib/commonjs/mol-canvas3d/passes/postprocessing.d.ts +9 -0
  210. package/lib/commonjs/mol-canvas3d/passes/postprocessing.js +12 -2
  211. package/lib/commonjs/mol-canvas3d/util.js +3 -4
  212. package/lib/commonjs/mol-data/db/column-helpers.js +6 -7
  213. package/lib/commonjs/mol-data/db/column.d.ts +1 -1
  214. package/lib/commonjs/mol-data/generic/hash-set.js +1 -2
  215. package/lib/commonjs/mol-data/generic/linked-list.js +1 -2
  216. package/lib/commonjs/mol-data/int/impl/interval.js +15 -15
  217. package/lib/commonjs/mol-data/int/impl/ordered-set.js +25 -25
  218. package/lib/commonjs/mol-data/int/impl/segmentation.js +7 -7
  219. package/lib/commonjs/mol-data/int/impl/sorted-array.js +31 -31
  220. package/lib/commonjs/mol-data/int/linked-index.js +1 -2
  221. package/lib/commonjs/mol-data/util/array.js +5 -6
  222. package/lib/commonjs/mol-data/util/buckets.js +1 -2
  223. package/lib/commonjs/mol-data/util/combination.js +2 -2
  224. package/lib/commonjs/mol-data/util/equivalence-classes.js +2 -2
  225. package/lib/commonjs/mol-data/util/grouping.js +2 -3
  226. package/lib/commonjs/mol-data/util/hash-functions.js +9 -10
  227. package/lib/commonjs/mol-data/util/sort.js +5 -6
  228. package/lib/commonjs/mol-geo/geometry/base.d.ts +1 -1
  229. package/lib/commonjs/mol-geo/geometry/base.js +3 -3
  230. package/lib/commonjs/mol-geo/geometry/clipping-data.js +4 -5
  231. package/lib/commonjs/mol-geo/geometry/color-data.js +4 -5
  232. package/lib/commonjs/mol-geo/geometry/cylinders/cylinders.d.ts +1 -0
  233. package/lib/commonjs/mol-geo/geometry/cylinders/cylinders.js +3 -0
  234. package/lib/commonjs/mol-geo/geometry/direct-volume/direct-volume.d.ts +1 -0
  235. package/lib/commonjs/mol-geo/geometry/direct-volume/direct-volume.js +3 -0
  236. package/lib/commonjs/mol-geo/geometry/direct-volume/transfer-function.js +3 -4
  237. package/lib/commonjs/mol-geo/geometry/emissive-data.js +5 -6
  238. package/lib/commonjs/mol-geo/geometry/image/image.d.ts +1 -1
  239. package/lib/commonjs/mol-geo/geometry/lines/lines.d.ts +0 -1
  240. package/lib/commonjs/mol-geo/geometry/marker-data.js +3 -4
  241. package/lib/commonjs/mol-geo/geometry/mesh/builder/axes.js +1 -2
  242. package/lib/commonjs/mol-geo/geometry/mesh/builder/box.js +2 -3
  243. package/lib/commonjs/mol-geo/geometry/mesh/builder/cylinder.js +4 -5
  244. package/lib/commonjs/mol-geo/geometry/mesh/builder/ellipsoid.js +1 -2
  245. package/lib/commonjs/mol-geo/geometry/mesh/builder/ribbon.js +1 -2
  246. package/lib/commonjs/mol-geo/geometry/mesh/builder/sheet.js +1 -2
  247. package/lib/commonjs/mol-geo/geometry/mesh/builder/sphere.js +2 -3
  248. package/lib/commonjs/mol-geo/geometry/mesh/builder/tube.js +1 -2
  249. package/lib/commonjs/mol-geo/geometry/mesh/color-smoothing.js +7 -8
  250. package/lib/commonjs/mol-geo/geometry/mesh/mesh.d.ts +1 -0
  251. package/lib/commonjs/mol-geo/geometry/mesh/mesh.js +3 -0
  252. package/lib/commonjs/mol-geo/geometry/overpaint-data.js +4 -5
  253. package/lib/commonjs/mol-geo/geometry/points/points.d.ts +1 -1
  254. package/lib/commonjs/mol-geo/geometry/size-data.js +9 -9
  255. package/lib/commonjs/mol-geo/geometry/spheres/spheres.d.ts +1 -0
  256. package/lib/commonjs/mol-geo/geometry/spheres/spheres.js +3 -0
  257. package/lib/commonjs/mol-geo/geometry/substance-data.js +4 -5
  258. package/lib/commonjs/mol-geo/geometry/text/font-atlas.js +3 -3
  259. package/lib/commonjs/mol-geo/geometry/texture-mesh/color-smoothing.js +7 -7
  260. package/lib/commonjs/mol-geo/geometry/texture-mesh/texture-mesh.d.ts +1 -0
  261. package/lib/commonjs/mol-geo/geometry/texture-mesh/texture-mesh.js +3 -0
  262. package/lib/commonjs/mol-geo/geometry/transform-data.js +4 -5
  263. package/lib/commonjs/mol-geo/geometry/transparency-data.js +5 -6
  264. package/lib/commonjs/mol-geo/primitive/box.js +3 -4
  265. package/lib/commonjs/mol-geo/primitive/cage.js +3 -4
  266. package/lib/commonjs/mol-geo/primitive/circle.js +2 -2
  267. package/lib/commonjs/mol-geo/primitive/cylinder.js +2 -2
  268. package/lib/commonjs/mol-geo/primitive/dodecahedron.js +3 -3
  269. package/lib/commonjs/mol-geo/primitive/icosahedron.js +2 -3
  270. package/lib/commonjs/mol-geo/primitive/octahedron.js +4 -4
  271. package/lib/commonjs/mol-geo/primitive/plane.js +2 -3
  272. package/lib/commonjs/mol-geo/primitive/polygon.js +1 -2
  273. package/lib/commonjs/mol-geo/primitive/polyhedron.js +2 -2
  274. package/lib/commonjs/mol-geo/primitive/primitive.js +4 -5
  275. package/lib/commonjs/mol-geo/primitive/prism.js +11 -11
  276. package/lib/commonjs/mol-geo/primitive/pyramid.js +6 -7
  277. package/lib/commonjs/mol-geo/primitive/sphere.js +2 -3
  278. package/lib/commonjs/mol-geo/primitive/spiked-ball.js +1 -2
  279. package/lib/commonjs/mol-geo/primitive/star.js +2 -2
  280. package/lib/commonjs/mol-geo/primitive/tetrahedron.js +3 -3
  281. package/lib/commonjs/mol-geo/primitive/torus.js +2 -2
  282. package/lib/commonjs/mol-geo/primitive/wedge.js +3 -4
  283. package/lib/commonjs/mol-geo/util/location-iterator.js +3 -4
  284. package/lib/commonjs/mol-geo/util/marching-cubes/algorithm.js +2 -3
  285. package/lib/commonjs/mol-geo/util/marching-cubes/builder.js +2 -3
  286. package/lib/commonjs/mol-geo/util/marching-cubes/tables.js +3 -3
  287. package/lib/commonjs/mol-geo/util.js +7 -8
  288. package/lib/commonjs/mol-gl/compute/grid3d.js +2 -3
  289. package/lib/commonjs/mol-gl/compute/hi-z.js +1 -2
  290. package/lib/commonjs/mol-gl/compute/histogram-pyramid/reduction.js +1 -2
  291. package/lib/commonjs/mol-gl/compute/histogram-pyramid/sum.js +1 -2
  292. package/lib/commonjs/mol-gl/compute/marching-cubes/active-voxels.js +1 -2
  293. package/lib/commonjs/mol-gl/compute/marching-cubes/isosurface.js +2 -3
  294. package/lib/commonjs/mol-gl/compute/marching-cubes/tables.js +2 -3
  295. package/lib/commonjs/mol-gl/compute/util.js +5 -5
  296. package/lib/commonjs/mol-gl/render-object.js +3 -3
  297. package/lib/commonjs/mol-gl/renderable/cylinders.d.ts +1 -0
  298. package/lib/commonjs/mol-gl/renderable/cylinders.js +3 -2
  299. package/lib/commonjs/mol-gl/renderable/direct-volume.d.ts +1 -0
  300. package/lib/commonjs/mol-gl/renderable/direct-volume.js +3 -2
  301. package/lib/commonjs/mol-gl/renderable/image.js +2 -2
  302. package/lib/commonjs/mol-gl/renderable/lines.js +2 -2
  303. package/lib/commonjs/mol-gl/renderable/mesh.d.ts +1 -0
  304. package/lib/commonjs/mol-gl/renderable/mesh.js +3 -2
  305. package/lib/commonjs/mol-gl/renderable/points.js +2 -2
  306. package/lib/commonjs/mol-gl/renderable/schema.d.ts +1 -0
  307. package/lib/commonjs/mol-gl/renderable/schema.js +10 -9
  308. package/lib/commonjs/mol-gl/renderable/spheres.d.ts +1 -0
  309. package/lib/commonjs/mol-gl/renderable/spheres.js +3 -2
  310. package/lib/commonjs/mol-gl/renderable/text.js +2 -2
  311. package/lib/commonjs/mol-gl/renderable/texture-mesh.d.ts +1 -0
  312. package/lib/commonjs/mol-gl/renderable/texture-mesh.js +3 -2
  313. package/lib/commonjs/mol-gl/renderable/util.js +7 -8
  314. package/lib/commonjs/mol-gl/renderable.js +2 -3
  315. package/lib/commonjs/mol-gl/renderer.d.ts +1 -0
  316. package/lib/commonjs/mol-gl/renderer.js +6 -0
  317. package/lib/commonjs/mol-gl/shader/chunks/apply-light-color.glsl.d.ts +2 -1
  318. package/lib/commonjs/mol-gl/shader/chunks/apply-light-color.glsl.js +57 -24
  319. package/lib/commonjs/mol-gl/shader/chunks/common-frag-params.glsl.d.ts +1 -1
  320. package/lib/commonjs/mol-gl/shader/chunks/common-frag-params.glsl.js +1 -0
  321. package/lib/commonjs/mol-gl/shader/chunks/common.glsl.d.ts +1 -1
  322. package/lib/commonjs/mol-gl/shader/chunks/common.glsl.js +6 -0
  323. package/lib/commonjs/mol-gl/shader/cylinders.frag.d.ts +2 -1
  324. package/lib/commonjs/mol-gl/shader/cylinders.frag.js +11 -2
  325. package/lib/commonjs/mol-gl/shader/direct-volume.frag.d.ts +1 -1
  326. package/lib/commonjs/mol-gl/shader/direct-volume.frag.js +1 -0
  327. package/lib/commonjs/mol-gl/shader/dof.frag.d.ts +7 -0
  328. package/lib/commonjs/mol-gl/shader/dof.frag.js +122 -0
  329. package/lib/commonjs/mol-gl/shader/ssao-blur.frag.d.ts +1 -1
  330. package/lib/commonjs/mol-gl/shader/ssao-blur.frag.js +9 -6
  331. package/lib/commonjs/mol-gl/shader-code.js +4 -4
  332. package/lib/commonjs/mol-gl/webgl/buffer.js +8 -9
  333. package/lib/commonjs/mol-gl/webgl/compat.js +32 -33
  334. package/lib/commonjs/mol-gl/webgl/context.js +7 -7
  335. package/lib/commonjs/mol-gl/webgl/extensions.js +1 -2
  336. package/lib/commonjs/mol-gl/webgl/framebuffer.js +3 -4
  337. package/lib/commonjs/mol-gl/webgl/program.js +2 -3
  338. package/lib/commonjs/mol-gl/webgl/render-item.d.ts +2 -2
  339. package/lib/commonjs/mol-gl/webgl/render-item.js +5 -5
  340. package/lib/commonjs/mol-gl/webgl/render-target.js +2 -3
  341. package/lib/commonjs/mol-gl/webgl/renderbuffer.js +3 -4
  342. package/lib/commonjs/mol-gl/webgl/resources.js +1 -2
  343. package/lib/commonjs/mol-gl/webgl/shader.js +2 -3
  344. package/lib/commonjs/mol-gl/webgl/state.js +1 -2
  345. package/lib/commonjs/mol-gl/webgl/texture.js +13 -14
  346. package/lib/commonjs/mol-gl/webgl/timer.d.ts +1 -1
  347. package/lib/commonjs/mol-gl/webgl/timer.js +10 -4
  348. package/lib/commonjs/mol-gl/webgl/uniform.js +6 -7
  349. package/lib/commonjs/mol-gl/webgl/vertex-array.js +1 -2
  350. package/lib/commonjs/mol-io/common/ascii.js +1 -2
  351. package/lib/commonjs/mol-io/common/binary-cif/classifier.js +2 -3
  352. package/lib/commonjs/mol-io/common/binary-cif/decoder.js +1 -2
  353. package/lib/commonjs/mol-io/common/binary.js +3 -3
  354. package/lib/commonjs/mol-io/common/msgpack/decode.js +1 -2
  355. package/lib/commonjs/mol-io/common/msgpack/encode.js +1 -2
  356. package/lib/commonjs/mol-io/common/simple-buffer.d.ts +0 -1
  357. package/lib/commonjs/mol-io/common/typed-array.js +6 -6
  358. package/lib/commonjs/mol-io/common/utf8.js +3 -4
  359. package/lib/commonjs/mol-io/reader/ccp4/parser.js +6 -7
  360. package/lib/commonjs/mol-io/reader/cif/binary/field.js +1 -2
  361. package/lib/commonjs/mol-io/reader/cif/binary/parser.js +1 -2
  362. package/lib/commonjs/mol-io/reader/cif/data-model.js +8 -8
  363. package/lib/commonjs/mol-io/reader/cif/schema/bird.d.ts +1 -1
  364. package/lib/commonjs/mol-io/reader/cif/schema/bird.js +1 -1
  365. package/lib/commonjs/mol-io/reader/cif/schema/ccd.d.ts +1 -1
  366. package/lib/commonjs/mol-io/reader/cif/schema/ccd.js +1 -1
  367. package/lib/commonjs/mol-io/reader/cif/schema/mmcif.d.ts +9 -1
  368. package/lib/commonjs/mol-io/reader/cif/schema/mmcif.js +9 -1
  369. package/lib/commonjs/mol-io/reader/cif/schema.js +4 -4
  370. package/lib/commonjs/mol-io/reader/cif/text/parser.js +1 -2
  371. package/lib/commonjs/mol-io/reader/common/text/column/fixed.d.ts +1 -1
  372. package/lib/commonjs/mol-io/reader/common/text/column/fixed.js +2 -3
  373. package/lib/commonjs/mol-io/reader/common/text/column/token.d.ts +1 -1
  374. package/lib/commonjs/mol-io/reader/common/text/column/token.js +4 -5
  375. package/lib/commonjs/mol-io/reader/common/text/number-parser.js +6 -6
  376. package/lib/commonjs/mol-io/reader/common/text/tokenizer.js +3 -3
  377. package/lib/commonjs/mol-io/reader/csv/data-model.js +3 -3
  378. package/lib/commonjs/mol-io/reader/csv/parser.js +1 -2
  379. package/lib/commonjs/mol-io/reader/cube/parser.js +1 -2
  380. package/lib/commonjs/mol-io/reader/dcd/parser.js +2 -3
  381. package/lib/commonjs/mol-io/reader/dsn6/parser.js +6 -6
  382. package/lib/commonjs/mol-io/reader/dx/parser.js +1 -2
  383. package/lib/commonjs/mol-io/reader/gro/parser.js +1 -2
  384. package/lib/commonjs/mol-io/reader/mol/parser.js +6 -7
  385. package/lib/commonjs/mol-io/reader/mol2/parser.js +1 -2
  386. package/lib/commonjs/mol-io/reader/nctraj/parser.js +1 -2
  387. package/lib/commonjs/mol-io/reader/obj/parser.js +1 -2
  388. package/lib/commonjs/mol-io/reader/pdb/parser.js +1 -2
  389. package/lib/commonjs/mol-io/reader/ply/parser.js +1 -2
  390. package/lib/commonjs/mol-io/reader/ply/schema.d.ts +1 -1
  391. package/lib/commonjs/mol-io/reader/ply/schema.js +3 -3
  392. package/lib/commonjs/mol-io/reader/prmtop/parser.js +1 -2
  393. package/lib/commonjs/mol-io/reader/psf/parser.js +1 -2
  394. package/lib/commonjs/mol-io/reader/sdf/parser-v3-util.js +4 -5
  395. package/lib/commonjs/mol-io/reader/sdf/parser.js +1 -2
  396. package/lib/commonjs/mol-io/reader/top/parser.js +1 -2
  397. package/lib/commonjs/mol-io/reader/trr/parser.js +1 -2
  398. package/lib/commonjs/mol-io/reader/xtc/parser.js +1 -2
  399. package/lib/commonjs/mol-io/reader/xyz/parser.js +1 -2
  400. package/lib/commonjs/mol-io/writer/cif/encoder/util.js +3 -4
  401. package/lib/commonjs/mol-math/approx.js +24 -25
  402. package/lib/commonjs/mol-math/easing.js +18 -19
  403. package/lib/commonjs/mol-math/geometry/boundary.js +2 -3
  404. package/lib/commonjs/mol-math/geometry/common.js +2 -3
  405. package/lib/commonjs/mol-math/geometry/distance-transform.js +1 -2
  406. package/lib/commonjs/mol-math/geometry/gaussian-density/cpu.js +1 -2
  407. package/lib/commonjs/mol-math/geometry/gaussian-density/gpu.js +4 -5
  408. package/lib/commonjs/mol-math/geometry/gaussian-density.js +5 -5
  409. package/lib/commonjs/mol-math/geometry/instance-grid.js +2 -3
  410. package/lib/commonjs/mol-math/geometry/lookup3d/grid.js +1 -2
  411. package/lib/commonjs/mol-math/geometry/molecular-surface.js +2 -2
  412. package/lib/commonjs/mol-math/geometry/polygon.js +1 -2
  413. package/lib/commonjs/mol-math/geometry/primitives/axes3d.js +1 -2
  414. package/lib/commonjs/mol-math/geometry/primitives/box3d.js +1 -2
  415. package/lib/commonjs/mol-math/geometry/primitives/frustum3d.js +1 -2
  416. package/lib/commonjs/mol-math/geometry/primitives/plane3d.js +1 -2
  417. package/lib/commonjs/mol-math/geometry/primitives/sphere3d.js +1 -2
  418. package/lib/commonjs/mol-math/geometry/spacegroup/cell.js +1 -2
  419. package/lib/commonjs/mol-math/geometry/spacegroup/tables.js +4 -4
  420. package/lib/commonjs/mol-math/histogram.js +1 -2
  421. package/lib/commonjs/mol-math/interpolate.js +12 -13
  422. package/lib/commonjs/mol-math/linear-algebra/3d/common.js +2 -2
  423. package/lib/commonjs/mol-math/linear-algebra/3d/euler.js +1 -2
  424. package/lib/commonjs/mol-math/linear-algebra/3d/mat3.js +1 -2
  425. package/lib/commonjs/mol-math/linear-algebra/3d/mat4.js +1 -2
  426. package/lib/commonjs/mol-math/linear-algebra/3d/minimize-rmsd.js +2 -1
  427. package/lib/commonjs/mol-math/linear-algebra/3d/quat.js +1 -2
  428. package/lib/commonjs/mol-math/linear-algebra/3d/vec2.js +1 -2
  429. package/lib/commonjs/mol-math/linear-algebra/3d/vec3.js +1 -2
  430. package/lib/commonjs/mol-math/linear-algebra/3d/vec4.js +1 -2
  431. package/lib/commonjs/mol-math/linear-algebra/matrix/svd.js +4 -5
  432. package/lib/commonjs/mol-math/misc.js +7 -7
  433. package/lib/commonjs/mol-model/custom-property.js +2 -2
  434. package/lib/commonjs/mol-model/location.js +4 -4
  435. package/lib/commonjs/mol-model/loci.d.ts +1 -1
  436. package/lib/commonjs/mol-model/loci.js +7 -7
  437. package/lib/commonjs/mol-model/sequence/alignment/alignment.d.ts +2 -1
  438. package/lib/commonjs/mol-model/sequence/alignment/alignment.js +1 -2
  439. package/lib/commonjs/mol-model/sequence/alignment/sequence.js +3 -3
  440. package/lib/commonjs/mol-model/sequence/constants.js +3 -4
  441. package/lib/commonjs/mol-model/structure/coordinates/coordinates.js +2 -2
  442. package/lib/commonjs/mol-model/structure/export/categories/atom_site.js +5 -5
  443. package/lib/commonjs/mol-model/structure/export/categories/atom_site_operator_mapping.js +2 -2
  444. package/lib/commonjs/mol-model/structure/export/categories/utils.js +6 -7
  445. package/lib/commonjs/mol-model/structure/export/mmcif.js +3 -3
  446. package/lib/commonjs/mol-model/structure/model/properties/atomic/bonds.js +2 -3
  447. package/lib/commonjs/mol-model/structure/model/properties/atomic/measures.js +4 -4
  448. package/lib/commonjs/mol-model/structure/model/properties/atomic/types.js +14 -14
  449. package/lib/commonjs/mol-model/structure/model/properties/secondary-structure.js +1 -2
  450. package/lib/commonjs/mol-model/structure/model/properties/utils/atomic-derived.js +1 -2
  451. package/lib/commonjs/mol-model/structure/model/properties/utils/atomic-index.js +1 -2
  452. package/lib/commonjs/mol-model/structure/model/properties/utils/atomic-ranges.js +1 -2
  453. package/lib/commonjs/mol-model/structure/model/properties/utils/coarse-keys.js +1 -2
  454. package/lib/commonjs/mol-model/structure/model/properties/utils/coarse-ranges.js +1 -2
  455. package/lib/commonjs/mol-model/structure/model/types/saccharides.js +1 -1
  456. package/lib/commonjs/mol-model/structure/model/types.d.ts +3 -3
  457. package/lib/commonjs/mol-model/structure/model/types.js +12 -12
  458. package/lib/commonjs/mol-model/structure/model/util.js +2 -3
  459. package/lib/commonjs/mol-model/structure/query/queries/atom-set.js +3 -4
  460. package/lib/commonjs/mol-model/structure/query/queries/combinators.js +2 -3
  461. package/lib/commonjs/mol-model/structure/query/queries/filters.js +7 -8
  462. package/lib/commonjs/mol-model/structure/query/queries/generators.js +9 -9
  463. package/lib/commonjs/mol-model/structure/query/queries/internal.js +7 -8
  464. package/lib/commonjs/mol-model/structure/query/queries/modifiers.js +9 -10
  465. package/lib/commonjs/mol-model/structure/query/utils/structure-distance.js +2 -3
  466. package/lib/commonjs/mol-model/structure/query/utils/structure-set.js +5 -6
  467. package/lib/commonjs/mol-model/structure/structure/carbohydrates/compute.js +1 -2
  468. package/lib/commonjs/mol-model/structure/structure/carbohydrates/constants.js +4 -4
  469. package/lib/commonjs/mol-model/structure/structure/element/loci.js +1 -2
  470. package/lib/commonjs/mol-model/structure/structure/element/util.js +6 -7
  471. package/lib/commonjs/mol-model/structure/structure/properties.d.ts +1 -0
  472. package/lib/commonjs/mol-model/structure/structure/properties.js +1 -0
  473. package/lib/commonjs/mol-model/structure/structure/unit/bonds/common.js +6 -6
  474. package/lib/commonjs/mol-model/structure/structure/unit/bonds/inter-compute.js +1 -2
  475. package/lib/commonjs/mol-model/structure/structure/unit/bonds/intra-compute.js +1 -2
  476. package/lib/commonjs/mol-model/structure/structure/unit/resonance.js +1 -2
  477. package/lib/commonjs/mol-model/structure/structure/unit/rings/compute.js +3 -4
  478. package/lib/commonjs/mol-model/structure/structure/util/boundary.js +1 -2
  479. package/lib/commonjs/mol-model/structure/structure/util/lookup3d.js +2 -2
  480. package/lib/commonjs/mol-model/structure/structure/util/polymer.js +6 -7
  481. package/lib/commonjs/mol-model/structure/structure/util/principal-axes.js +2 -3
  482. package/lib/commonjs/mol-model/structure/structure/util/superposition-sifts-mapping.js +1 -2
  483. package/lib/commonjs/mol-model/structure/structure/util/superposition.js +3 -4
  484. package/lib/commonjs/mol-model/structure/util.js +5 -6
  485. package/lib/commonjs/mol-model/volume/volume.d.ts +6 -6
  486. package/lib/commonjs/mol-model-formats/shape/ply.d.ts +2 -0
  487. package/lib/commonjs/mol-model-formats/shape/ply.js +2 -2
  488. package/lib/commonjs/mol-model-formats/structure/basic/atomic.js +1 -2
  489. package/lib/commonjs/mol-model-formats/structure/basic/coarse.js +2 -2
  490. package/lib/commonjs/mol-model-formats/structure/basic/entities.js +2 -3
  491. package/lib/commonjs/mol-model-formats/structure/basic/parser.js +1 -2
  492. package/lib/commonjs/mol-model-formats/structure/basic/properties.js +4 -5
  493. package/lib/commonjs/mol-model-formats/structure/basic/schema.d.ts +1 -0
  494. package/lib/commonjs/mol-model-formats/structure/basic/schema.js +2 -2
  495. package/lib/commonjs/mol-model-formats/structure/basic/sequence.js +1 -2
  496. package/lib/commonjs/mol-model-formats/structure/basic/sort.js +1 -2
  497. package/lib/commonjs/mol-model-formats/structure/basic/util.js +2 -3
  498. package/lib/commonjs/mol-model-formats/structure/cif-core.js +2 -2
  499. package/lib/commonjs/mol-model-formats/structure/common/entity.d.ts +1 -0
  500. package/lib/commonjs/mol-model-formats/structure/cube.js +1 -2
  501. package/lib/commonjs/mol-model-formats/structure/dcd.js +1 -2
  502. package/lib/commonjs/mol-model-formats/structure/gro.js +2 -2
  503. package/lib/commonjs/mol-model-formats/structure/mmcif.js +3 -3
  504. package/lib/commonjs/mol-model-formats/structure/mol.js +3 -3
  505. package/lib/commonjs/mol-model-formats/structure/mol2.js +2 -2
  506. package/lib/commonjs/mol-model-formats/structure/nctraj.js +1 -2
  507. package/lib/commonjs/mol-model-formats/structure/pdb/anisotropic.js +3 -4
  508. package/lib/commonjs/mol-model-formats/structure/pdb/assembly.js +3 -4
  509. package/lib/commonjs/mol-model-formats/structure/pdb/atom-site.js +3 -4
  510. package/lib/commonjs/mol-model-formats/structure/pdb/conect.js +1 -2
  511. package/lib/commonjs/mol-model-formats/structure/pdb/entity.js +2 -3
  512. package/lib/commonjs/mol-model-formats/structure/pdb/header.js +1 -2
  513. package/lib/commonjs/mol-model-formats/structure/pdb/secondary-structure.js +2 -3
  514. package/lib/commonjs/mol-model-formats/structure/pdb/to-cif.js +1 -2
  515. package/lib/commonjs/mol-model-formats/structure/pdb.js +2 -2
  516. package/lib/commonjs/mol-model-formats/structure/prmtop.js +2 -2
  517. package/lib/commonjs/mol-model-formats/structure/property/assembly.js +3 -4
  518. package/lib/commonjs/mol-model-formats/structure/psf.js +2 -2
  519. package/lib/commonjs/mol-model-formats/structure/sdf.js +2 -2
  520. package/lib/commonjs/mol-model-formats/structure/top.js +2 -2
  521. package/lib/commonjs/mol-model-formats/structure/trr.js +1 -2
  522. package/lib/commonjs/mol-model-formats/structure/util.js +2 -3
  523. package/lib/commonjs/mol-model-formats/structure/xtc.js +1 -2
  524. package/lib/commonjs/mol-model-formats/structure/xyz.js +2 -2
  525. package/lib/commonjs/mol-model-formats/volume/ccp4.js +3 -3
  526. package/lib/commonjs/mol-model-formats/volume/cube.js +2 -2
  527. package/lib/commonjs/mol-model-formats/volume/density-server.js +2 -2
  528. package/lib/commonjs/mol-model-formats/volume/dsn6.js +2 -2
  529. package/lib/commonjs/mol-model-formats/volume/dx.js +2 -2
  530. package/lib/commonjs/mol-model-formats/volume/segmentation.js +2 -2
  531. package/lib/commonjs/mol-model-props/computed/accessible-surface-area/shrake-rupley/area.js +1 -2
  532. package/lib/commonjs/mol-model-props/computed/accessible-surface-area/shrake-rupley/radii.js +1 -2
  533. package/lib/commonjs/mol-model-props/computed/chemistry/functional-group.js +16 -17
  534. package/lib/commonjs/mol-model-props/computed/chemistry/geometry.js +5 -5
  535. package/lib/commonjs/mol-model-props/computed/chemistry/util.js +16 -17
  536. package/lib/commonjs/mol-model-props/computed/chemistry/valence-model.js +4 -4
  537. package/lib/commonjs/mol-model-props/computed/helix-orientation/helix-orientation.js +1 -2
  538. package/lib/commonjs/mol-model-props/computed/interactions/common.js +4 -4
  539. package/lib/commonjs/mol-model-props/computed/interactions/contacts.js +3 -3
  540. package/lib/commonjs/mol-model-props/computed/interactions/interactions.js +2 -2
  541. package/lib/commonjs/mol-model-props/computed/interactions/refine.js +1 -2
  542. package/lib/commonjs/mol-model-props/computed/representations/interactions-inter-unit-cylinder.d.ts +1 -0
  543. package/lib/commonjs/mol-model-props/computed/representations/interactions-inter-unit-cylinder.js +2 -2
  544. package/lib/commonjs/mol-model-props/computed/representations/interactions-intra-unit-cylinder.d.ts +1 -0
  545. package/lib/commonjs/mol-model-props/computed/representations/interactions-intra-unit-cylinder.js +2 -2
  546. package/lib/commonjs/mol-model-props/computed/representations/interactions.d.ts +3 -0
  547. package/lib/commonjs/mol-model-props/computed/representations/interactions.js +3 -3
  548. package/lib/commonjs/mol-model-props/computed/secondary-structure/dssp/backbone-hbonds.js +1 -2
  549. package/lib/commonjs/mol-model-props/computed/secondary-structure/dssp/bends.js +1 -2
  550. package/lib/commonjs/mol-model-props/computed/secondary-structure/dssp/bridges.js +1 -2
  551. package/lib/commonjs/mol-model-props/computed/secondary-structure/dssp/dihedral-angles.js +1 -2
  552. package/lib/commonjs/mol-model-props/computed/secondary-structure/dssp/helices.js +1 -2
  553. package/lib/commonjs/mol-model-props/computed/secondary-structure/dssp/ladders.js +1 -2
  554. package/lib/commonjs/mol-model-props/computed/secondary-structure/dssp/protein-info.js +1 -2
  555. package/lib/commonjs/mol-model-props/computed/secondary-structure/dssp/sheets.js +1 -2
  556. package/lib/commonjs/mol-model-props/computed/secondary-structure/dssp/trace-lookup.js +1 -2
  557. package/lib/commonjs/mol-model-props/computed/secondary-structure/dssp/turns.js +1 -2
  558. package/lib/commonjs/mol-model-props/computed/secondary-structure/dssp.js +2 -2
  559. package/lib/commonjs/mol-model-props/computed/themes/accessible-surface-area.js +3 -3
  560. package/lib/commonjs/mol-model-props/computed/themes/interaction-type.js +3 -3
  561. package/lib/commonjs/mol-model-props/integrative/cross-link-restraint/color.js +3 -3
  562. package/lib/commonjs/mol-model-props/integrative/cross-link-restraint/representation.d.ts +4 -0
  563. package/lib/commonjs/mol-model-props/integrative/cross-link-restraint/representation.js +4 -4
  564. package/lib/commonjs/mol-model-props/sequence/themes/sifts-mapping.d.ts +2 -2
  565. package/lib/commonjs/mol-model-props/sequence/themes/sifts-mapping.js +3 -3
  566. package/lib/commonjs/mol-plugin/animation-loop.d.ts +1 -0
  567. package/lib/commonjs/mol-plugin/behavior/behavior.d.ts +9 -9
  568. package/lib/commonjs/mol-plugin/behavior/dynamic/volume-streaming/behavior.d.ts +9 -9
  569. package/lib/commonjs/mol-plugin/behavior/dynamic/volume-streaming/model.d.ts +3 -3
  570. package/lib/commonjs/mol-plugin/behavior/dynamic/volume-streaming/transformers.d.ts +3 -3
  571. package/lib/commonjs/mol-plugin/behavior/dynamic/volume-streaming/util.js +8 -9
  572. package/lib/commonjs/mol-plugin/behavior/static/camera.js +6 -7
  573. package/lib/commonjs/mol-plugin/behavior/static/misc.js +2 -3
  574. package/lib/commonjs/mol-plugin/behavior/static/representation.js +4 -5
  575. package/lib/commonjs/mol-plugin/behavior/static/state.js +12 -13
  576. package/lib/commonjs/mol-plugin/command.js +2 -2
  577. package/lib/commonjs/mol-plugin/commands.d.ts +23 -87
  578. package/lib/commonjs/mol-plugin/context.d.ts +3 -2
  579. package/lib/commonjs/mol-plugin/context.js +4 -2
  580. package/lib/commonjs/mol-plugin/state.d.ts +7 -7
  581. package/lib/commonjs/mol-plugin/util/headless-screenshot.d.ts +1 -1
  582. package/lib/commonjs/mol-plugin/util/headless-screenshot.js +7 -5
  583. package/lib/commonjs/mol-plugin/util/viewport-screenshot.d.ts +1 -1
  584. package/lib/commonjs/mol-plugin/util/viewport-screenshot.js +2 -1
  585. package/lib/commonjs/mol-plugin-state/actions/volume.d.ts +1 -1
  586. package/lib/commonjs/mol-plugin-state/actions/volume.js +4 -12
  587. package/lib/commonjs/mol-plugin-state/animation/built-in/model-index.d.ts +2 -2
  588. package/lib/commonjs/mol-plugin-state/animation/built-in/state-snapshots.js +7 -3
  589. package/lib/commonjs/mol-plugin-state/animation/helpers.js +5 -5
  590. package/lib/commonjs/mol-plugin-state/builder/structure/hierarchy-preset.js +2 -2
  591. package/lib/commonjs/mol-plugin-state/builder/structure/representation-preset.js +4 -4
  592. package/lib/commonjs/mol-plugin-state/formats/provider.js +2 -3
  593. package/lib/commonjs/mol-plugin-state/formats/registry.d.ts +1 -1
  594. package/lib/commonjs/mol-plugin-state/formats/trajectory.d.ts +9 -9
  595. package/lib/commonjs/mol-plugin-state/formats/volume.d.ts +0 -1
  596. package/lib/commonjs/mol-plugin-state/helpers/structure-clipping.js +1 -2
  597. package/lib/commonjs/mol-plugin-state/helpers/structure-component.js +3 -3
  598. package/lib/commonjs/mol-plugin-state/helpers/structure-emissive.js +2 -3
  599. package/lib/commonjs/mol-plugin-state/helpers/structure-overpaint.js +2 -3
  600. package/lib/commonjs/mol-plugin-state/helpers/structure-representation-params.js +4 -5
  601. package/lib/commonjs/mol-plugin-state/helpers/structure-selection-query.js +9 -9
  602. package/lib/commonjs/mol-plugin-state/helpers/structure-substance.js +2 -3
  603. package/lib/commonjs/mol-plugin-state/helpers/structure-transparency.js +2 -3
  604. package/lib/commonjs/mol-plugin-state/helpers/volume-representation-params.js +4 -5
  605. package/lib/commonjs/mol-plugin-state/manager/focus-camera/focus-first-residue.js +2 -3
  606. package/lib/commonjs/mol-plugin-state/manager/focus-camera/orient-axes.js +4 -4
  607. package/lib/commonjs/mol-plugin-state/manager/structure/hierarchy-state.js +2 -3
  608. package/lib/commonjs/mol-plugin-state/manager/structure/hierarchy.d.ts +3 -3
  609. package/lib/commonjs/mol-plugin-state/manager/structure/measurement.d.ts +4 -0
  610. package/lib/commonjs/mol-plugin-state/manager/volume/hierarchy-state.js +2 -3
  611. package/lib/commonjs/mol-plugin-state/objects.d.ts +97 -97
  612. package/lib/commonjs/mol-plugin-state/transforms/data.d.ts +10 -1
  613. package/lib/commonjs/mol-plugin-state/transforms/data.js +31 -2
  614. package/lib/commonjs/mol-plugin-state/transforms/helpers.js +6 -7
  615. package/lib/commonjs/mol-plugin-state/transforms/representation.d.ts +6 -0
  616. package/lib/commonjs/mol-plugin-state/transforms/shape.js +2 -2
  617. package/lib/commonjs/mol-plugin-ui/base.js +2 -1
  618. package/lib/commonjs/mol-plugin-ui/controls/color.js +3 -3
  619. package/lib/commonjs/mol-plugin-ui/controls/common.js +5 -5
  620. package/lib/commonjs/mol-plugin-ui/controls/icons.d.ts +5 -0
  621. package/lib/commonjs/mol-plugin-ui/controls/icons.js +87 -73
  622. package/lib/commonjs/mol-plugin-ui/controls/legend.js +2 -2
  623. package/lib/commonjs/mol-plugin-ui/controls/parameters.d.ts +3 -3
  624. package/lib/commonjs/mol-plugin-ui/controls/parameters.js +2 -2
  625. package/lib/commonjs/mol-plugin-ui/controls.js +3 -3
  626. package/lib/commonjs/mol-plugin-ui/hooks/use-behavior.js +1 -2
  627. package/lib/commonjs/mol-plugin-ui/index.js +1 -2
  628. package/lib/commonjs/mol-plugin-ui/left-panel.d.ts +0 -1
  629. package/lib/commonjs/mol-plugin-ui/plugin.js +5 -4
  630. package/lib/commonjs/mol-plugin-ui/react18.js +1 -2
  631. package/lib/commonjs/mol-plugin-ui/sequence.js +8 -8
  632. package/lib/commonjs/mol-plugin-ui/spec.d.ts +10 -10
  633. package/lib/commonjs/mol-plugin-ui/spec.js +1 -1
  634. package/lib/commonjs/mol-plugin-ui/state/apply-action.d.ts +1 -1
  635. package/lib/commonjs/mol-plugin-ui/state/update-transform.d.ts +1 -1
  636. package/lib/commonjs/mol-plugin-ui/structure/quick-styles.d.ts +2 -1
  637. package/lib/commonjs/mol-plugin-ui/structure/quick-styles.js +5 -2
  638. package/lib/commonjs/mol-plugin-ui/structure/selection.d.ts +2 -2
  639. package/lib/commonjs/mol-plugin-ui/task.js +2 -3
  640. package/lib/commonjs/mol-plugin-ui/viewport/simple-settings.js +3 -0
  641. package/lib/commonjs/mol-repr/representation.d.ts +3 -3
  642. package/lib/commonjs/mol-repr/shape/loci/angle.d.ts +1 -0
  643. package/lib/commonjs/mol-repr/shape/loci/angle.js +2 -2
  644. package/lib/commonjs/mol-repr/shape/loci/dihedral.d.ts +1 -0
  645. package/lib/commonjs/mol-repr/shape/loci/dihedral.js +2 -2
  646. package/lib/commonjs/mol-repr/shape/loci/distance.js +2 -2
  647. package/lib/commonjs/mol-repr/shape/loci/label.js +2 -2
  648. package/lib/commonjs/mol-repr/shape/loci/orientation.d.ts +1 -0
  649. package/lib/commonjs/mol-repr/shape/loci/orientation.js +2 -2
  650. package/lib/commonjs/mol-repr/shape/loci/plane.d.ts +1 -0
  651. package/lib/commonjs/mol-repr/shape/loci/plane.js +2 -2
  652. package/lib/commonjs/mol-repr/shape/model/unitcell.d.ts +1 -0
  653. package/lib/commonjs/mol-repr/shape/model/unitcell.js +3 -3
  654. package/lib/commonjs/mol-repr/shape/representation.js +1 -2
  655. package/lib/commonjs/mol-repr/structure/complex-representation.js +1 -2
  656. package/lib/commonjs/mol-repr/structure/complex-visual.d.ts +5 -0
  657. package/lib/commonjs/mol-repr/structure/complex-visual.js +9 -9
  658. package/lib/commonjs/mol-repr/structure/params.d.ts +5 -0
  659. package/lib/commonjs/mol-repr/structure/params.js +2 -2
  660. package/lib/commonjs/mol-repr/structure/registry.d.ts +11 -0
  661. package/lib/commonjs/mol-repr/structure/representation/backbone.d.ts +3 -0
  662. package/lib/commonjs/mol-repr/structure/representation/backbone.js +3 -3
  663. package/lib/commonjs/mol-repr/structure/representation/ball-and-stick.d.ts +3 -0
  664. package/lib/commonjs/mol-repr/structure/representation/ball-and-stick.js +3 -3
  665. package/lib/commonjs/mol-repr/structure/representation/carbohydrate.d.ts +3 -0
  666. package/lib/commonjs/mol-repr/structure/representation/carbohydrate.js +3 -3
  667. package/lib/commonjs/mol-repr/structure/representation/cartoon.d.ts +3 -0
  668. package/lib/commonjs/mol-repr/structure/representation/cartoon.js +3 -3
  669. package/lib/commonjs/mol-repr/structure/representation/ellipsoid.d.ts +3 -0
  670. package/lib/commonjs/mol-repr/structure/representation/ellipsoid.js +3 -3
  671. package/lib/commonjs/mol-repr/structure/representation/gaussian-surface.d.ts +3 -0
  672. package/lib/commonjs/mol-repr/structure/representation/gaussian-surface.js +3 -3
  673. package/lib/commonjs/mol-repr/structure/representation/gaussian-volume.d.ts +3 -0
  674. package/lib/commonjs/mol-repr/structure/representation/gaussian-volume.js +3 -3
  675. package/lib/commonjs/mol-repr/structure/representation/label.js +3 -3
  676. package/lib/commonjs/mol-repr/structure/representation/line.js +3 -3
  677. package/lib/commonjs/mol-repr/structure/representation/molecular-surface.d.ts +3 -0
  678. package/lib/commonjs/mol-repr/structure/representation/molecular-surface.js +3 -3
  679. package/lib/commonjs/mol-repr/structure/representation/orientation.d.ts +3 -0
  680. package/lib/commonjs/mol-repr/structure/representation/orientation.js +3 -3
  681. package/lib/commonjs/mol-repr/structure/representation/point.js +3 -3
  682. package/lib/commonjs/mol-repr/structure/representation/putty.d.ts +3 -0
  683. package/lib/commonjs/mol-repr/structure/representation/putty.js +3 -3
  684. package/lib/commonjs/mol-repr/structure/representation/spacefill.d.ts +3 -0
  685. package/lib/commonjs/mol-repr/structure/representation/spacefill.js +3 -3
  686. package/lib/commonjs/mol-repr/structure/representation.js +2 -2
  687. package/lib/commonjs/mol-repr/structure/units-representation.js +1 -2
  688. package/lib/commonjs/mol-repr/structure/units-visual.d.ts +5 -0
  689. package/lib/commonjs/mol-repr/structure/units-visual.js +10 -10
  690. package/lib/commonjs/mol-repr/structure/visual/bond-inter-unit-cylinder.d.ts +2 -0
  691. package/lib/commonjs/mol-repr/structure/visual/bond-inter-unit-cylinder.js +4 -4
  692. package/lib/commonjs/mol-repr/structure/visual/bond-inter-unit-line.js +2 -2
  693. package/lib/commonjs/mol-repr/structure/visual/bond-intra-unit-cylinder.d.ts +2 -0
  694. package/lib/commonjs/mol-repr/structure/visual/bond-intra-unit-cylinder.js +4 -4
  695. package/lib/commonjs/mol-repr/structure/visual/bond-intra-unit-line.js +2 -2
  696. package/lib/commonjs/mol-repr/structure/visual/carbohydrate-link-cylinder.d.ts +1 -0
  697. package/lib/commonjs/mol-repr/structure/visual/carbohydrate-link-cylinder.js +2 -2
  698. package/lib/commonjs/mol-repr/structure/visual/carbohydrate-symbol-mesh.d.ts +1 -0
  699. package/lib/commonjs/mol-repr/structure/visual/carbohydrate-symbol-mesh.js +2 -2
  700. package/lib/commonjs/mol-repr/structure/visual/carbohydrate-terminal-link-cylinder.d.ts +1 -0
  701. package/lib/commonjs/mol-repr/structure/visual/carbohydrate-terminal-link-cylinder.js +2 -2
  702. package/lib/commonjs/mol-repr/structure/visual/element-cross.js +3 -3
  703. package/lib/commonjs/mol-repr/structure/visual/element-point.js +3 -3
  704. package/lib/commonjs/mol-repr/structure/visual/element-sphere.d.ts +4 -0
  705. package/lib/commonjs/mol-repr/structure/visual/element-sphere.js +7 -7
  706. package/lib/commonjs/mol-repr/structure/visual/ellipsoid-mesh.d.ts +1 -0
  707. package/lib/commonjs/mol-repr/structure/visual/ellipsoid-mesh.js +3 -3
  708. package/lib/commonjs/mol-repr/structure/visual/gaussian-density-volume.d.ts +2 -0
  709. package/lib/commonjs/mol-repr/structure/visual/gaussian-density-volume.js +3 -3
  710. package/lib/commonjs/mol-repr/structure/visual/gaussian-surface-mesh.d.ts +4 -0
  711. package/lib/commonjs/mol-repr/structure/visual/gaussian-surface-mesh.js +7 -7
  712. package/lib/commonjs/mol-repr/structure/visual/gaussian-surface-wireframe.js +2 -2
  713. package/lib/commonjs/mol-repr/structure/visual/label-text.js +2 -2
  714. package/lib/commonjs/mol-repr/structure/visual/molecular-surface-mesh.d.ts +1 -0
  715. package/lib/commonjs/mol-repr/structure/visual/molecular-surface-mesh.js +3 -3
  716. package/lib/commonjs/mol-repr/structure/visual/molecular-surface-wireframe.js +2 -2
  717. package/lib/commonjs/mol-repr/structure/visual/nucleotide-atomic-bond.d.ts +2 -0
  718. package/lib/commonjs/mol-repr/structure/visual/nucleotide-atomic-bond.js +4 -4
  719. package/lib/commonjs/mol-repr/structure/visual/nucleotide-atomic-element.d.ts +2 -0
  720. package/lib/commonjs/mol-repr/structure/visual/nucleotide-atomic-element.js +4 -4
  721. package/lib/commonjs/mol-repr/structure/visual/nucleotide-atomic-ring-fill.d.ts +1 -0
  722. package/lib/commonjs/mol-repr/structure/visual/nucleotide-atomic-ring-fill.js +2 -2
  723. package/lib/commonjs/mol-repr/structure/visual/nucleotide-block-mesh.d.ts +1 -0
  724. package/lib/commonjs/mol-repr/structure/visual/nucleotide-block-mesh.js +2 -2
  725. package/lib/commonjs/mol-repr/structure/visual/nucleotide-ring-mesh.d.ts +1 -0
  726. package/lib/commonjs/mol-repr/structure/visual/nucleotide-ring-mesh.js +2 -2
  727. package/lib/commonjs/mol-repr/structure/visual/orientation-ellipsoid-mesh.d.ts +1 -0
  728. package/lib/commonjs/mol-repr/structure/visual/orientation-ellipsoid-mesh.js +3 -3
  729. package/lib/commonjs/mol-repr/structure/visual/polymer-backbone-cylinder.d.ts +2 -0
  730. package/lib/commonjs/mol-repr/structure/visual/polymer-backbone-cylinder.js +4 -4
  731. package/lib/commonjs/mol-repr/structure/visual/polymer-backbone-sphere.d.ts +2 -0
  732. package/lib/commonjs/mol-repr/structure/visual/polymer-backbone-sphere.js +4 -4
  733. package/lib/commonjs/mol-repr/structure/visual/polymer-direction-wedge.d.ts +1 -0
  734. package/lib/commonjs/mol-repr/structure/visual/polymer-direction-wedge.js +2 -2
  735. package/lib/commonjs/mol-repr/structure/visual/polymer-gap-cylinder.d.ts +1 -0
  736. package/lib/commonjs/mol-repr/structure/visual/polymer-gap-cylinder.js +2 -2
  737. package/lib/commonjs/mol-repr/structure/visual/polymer-trace-mesh.d.ts +1 -0
  738. package/lib/commonjs/mol-repr/structure/visual/polymer-trace-mesh.js +2 -2
  739. package/lib/commonjs/mol-repr/structure/visual/polymer-tube-mesh.d.ts +1 -0
  740. package/lib/commonjs/mol-repr/structure/visual/polymer-tube-mesh.js +2 -2
  741. package/lib/commonjs/mol-repr/structure/visual/util/bond.js +8 -8
  742. package/lib/commonjs/mol-repr/structure/visual/util/common.js +14 -14
  743. package/lib/commonjs/mol-repr/structure/visual/util/element.js +10 -10
  744. package/lib/commonjs/mol-repr/structure/visual/util/gaussian.js +8 -8
  745. package/lib/commonjs/mol-repr/structure/visual/util/link.js +5 -5
  746. package/lib/commonjs/mol-repr/structure/visual/util/molecular-surface.js +2 -3
  747. package/lib/commonjs/mol-repr/structure/visual/util/nucleotide.d.ts +60 -60
  748. package/lib/commonjs/mol-repr/structure/visual/util/nucleotide.js +11 -11
  749. package/lib/commonjs/mol-repr/structure/visual/util/polymer/backbone.js +3 -4
  750. package/lib/commonjs/mol-repr/structure/visual/util/polymer/curve-segment.js +5 -6
  751. package/lib/commonjs/mol-repr/structure/visual/util/polymer/gap-iterator.js +2 -2
  752. package/lib/commonjs/mol-repr/structure/visual/util/polymer/trace-iterator.js +2 -2
  753. package/lib/commonjs/mol-repr/structure/visual/util/polymer.js +8 -8
  754. package/lib/commonjs/mol-repr/util.js +3 -3
  755. package/lib/commonjs/mol-repr/volume/direct-volume.d.ts +48 -45
  756. package/lib/commonjs/mol-repr/volume/direct-volume.js +9 -9
  757. package/lib/commonjs/mol-repr/volume/isosurface.d.ts +95 -90
  758. package/lib/commonjs/mol-repr/volume/isosurface.js +10 -10
  759. package/lib/commonjs/mol-repr/volume/registry.d.ts +63 -60
  760. package/lib/commonjs/mol-repr/volume/representation.js +4 -4
  761. package/lib/commonjs/mol-repr/volume/segment.d.ts +80 -75
  762. package/lib/commonjs/mol-repr/volume/segment.js +8 -8
  763. package/lib/commonjs/mol-repr/volume/slice.d.ts +45 -45
  764. package/lib/commonjs/mol-repr/volume/slice.js +5 -5
  765. package/lib/commonjs/mol-repr/volume/util.js +5 -6
  766. package/lib/commonjs/mol-script/language/expression-formatter.js +1 -2
  767. package/lib/commonjs/mol-script/language/helpers.js +3 -4
  768. package/lib/commonjs/mol-script/language/parser.js +1 -2
  769. package/lib/commonjs/mol-script/language/symbol-table/core.d.ts +1 -1
  770. package/lib/commonjs/mol-script/language/symbol.js +5 -5
  771. package/lib/commonjs/mol-script/runtime/query/base.js +2 -2
  772. package/lib/commonjs/mol-script/script/mol-script/script-macro.js +4 -5
  773. package/lib/commonjs/mol-script/script/mol-script/symbols.js +3 -3
  774. package/lib/commonjs/mol-script/script.js +1 -2
  775. package/lib/commonjs/mol-script/transpile.js +1 -2
  776. package/lib/commonjs/mol-script/transpilers/helper.js +28 -28
  777. package/lib/commonjs/mol-script/transpilers/jmol/properties.js +2 -2
  778. package/lib/commonjs/mol-script/transpilers/vmd/properties.js +2 -2
  779. package/lib/commonjs/mol-script/util/id-list.js +1 -2
  780. package/lib/commonjs/mol-state/object.d.ts +4 -4
  781. package/lib/commonjs/mol-state/state.d.ts +4 -4
  782. package/lib/commonjs/mol-state/transform.d.ts +1 -1
  783. package/lib/commonjs/mol-state/transformer.d.ts +1 -1
  784. package/lib/commonjs/mol-task/execution/observable.js +4 -5
  785. package/lib/commonjs/mol-task/util/chunked.js +1 -2
  786. package/lib/commonjs/mol-task/util/multistep.js +1 -2
  787. package/lib/commonjs/mol-task/util/scheduler.d.ts +0 -1
  788. package/lib/commonjs/mol-theme/clipping.js +1 -2
  789. package/lib/commonjs/mol-theme/color/atom-id.d.ts +2 -2
  790. package/lib/commonjs/mol-theme/color/atom-id.js +3 -3
  791. package/lib/commonjs/mol-theme/color/carbohydrate-symbol.js +3 -3
  792. package/lib/commonjs/mol-theme/color/cartoon.js +3 -3
  793. package/lib/commonjs/mol-theme/color/chain-id.d.ts +2 -2
  794. package/lib/commonjs/mol-theme/color/chain-id.js +3 -3
  795. package/lib/commonjs/mol-theme/color/element-index.d.ts +2 -2
  796. package/lib/commonjs/mol-theme/color/element-index.js +3 -3
  797. package/lib/commonjs/mol-theme/color/element-symbol.js +4 -4
  798. package/lib/commonjs/mol-theme/color/entity-id.d.ts +2 -2
  799. package/lib/commonjs/mol-theme/color/entity-id.js +3 -3
  800. package/lib/commonjs/mol-theme/color/entity-source.d.ts +2 -2
  801. package/lib/commonjs/mol-theme/color/entity-source.js +3 -3
  802. package/lib/commonjs/mol-theme/color/external-volume.d.ts +2 -2
  803. package/lib/commonjs/mol-theme/color/external-volume.js +2 -2
  804. package/lib/commonjs/mol-theme/color/hydrophobicity.js +4 -4
  805. package/lib/commonjs/mol-theme/color/illustrative.js +3 -3
  806. package/lib/commonjs/mol-theme/color/model-index.d.ts +2 -2
  807. package/lib/commonjs/mol-theme/color/model-index.js +3 -3
  808. package/lib/commonjs/mol-theme/color/molecule-type.js +4 -4
  809. package/lib/commonjs/mol-theme/color/occupancy.js +4 -4
  810. package/lib/commonjs/mol-theme/color/operator-hkl.d.ts +2 -2
  811. package/lib/commonjs/mol-theme/color/operator-hkl.js +3 -3
  812. package/lib/commonjs/mol-theme/color/operator-name.d.ts +2 -2
  813. package/lib/commonjs/mol-theme/color/operator-name.js +3 -3
  814. package/lib/commonjs/mol-theme/color/partial-charge.js +3 -3
  815. package/lib/commonjs/mol-theme/color/polymer-id.d.ts +2 -2
  816. package/lib/commonjs/mol-theme/color/polymer-id.js +3 -3
  817. package/lib/commonjs/mol-theme/color/polymer-index.d.ts +2 -2
  818. package/lib/commonjs/mol-theme/color/polymer-index.js +3 -3
  819. package/lib/commonjs/mol-theme/color/residue-name.js +4 -4
  820. package/lib/commonjs/mol-theme/color/secondary-structure.js +4 -4
  821. package/lib/commonjs/mol-theme/color/sequence-id.js +3 -3
  822. package/lib/commonjs/mol-theme/color/shape-group.js +3 -3
  823. package/lib/commonjs/mol-theme/color/structure-index.d.ts +2 -2
  824. package/lib/commonjs/mol-theme/color/structure-index.js +3 -3
  825. package/lib/commonjs/mol-theme/color/trajectory-index.d.ts +2 -2
  826. package/lib/commonjs/mol-theme/color/trajectory-index.js +3 -3
  827. package/lib/commonjs/mol-theme/color/uncertainty.js +4 -4
  828. package/lib/commonjs/mol-theme/color/uniform.js +3 -3
  829. package/lib/commonjs/mol-theme/color/unit-index.d.ts +2 -2
  830. package/lib/commonjs/mol-theme/color/unit-index.js +3 -3
  831. package/lib/commonjs/mol-theme/color/volume-segment.d.ts +2 -2
  832. package/lib/commonjs/mol-theme/color/volume-segment.js +3 -3
  833. package/lib/commonjs/mol-theme/color/volume-value.js +3 -3
  834. package/lib/commonjs/mol-theme/color.d.ts +16 -16
  835. package/lib/commonjs/mol-theme/color.js +2 -2
  836. package/lib/commonjs/mol-theme/emissive.js +1 -2
  837. package/lib/commonjs/mol-theme/label.js +11 -11
  838. package/lib/commonjs/mol-theme/overpaint.js +1 -2
  839. package/lib/commonjs/mol-theme/size/physical.js +4 -4
  840. package/lib/commonjs/mol-theme/size/shape-group.js +3 -3
  841. package/lib/commonjs/mol-theme/size/uncertainty.js +4 -4
  842. package/lib/commonjs/mol-theme/size/uniform.js +3 -3
  843. package/lib/commonjs/mol-theme/substance.js +1 -2
  844. package/lib/commonjs/mol-theme/theme.d.ts +3 -3
  845. package/lib/commonjs/mol-theme/transparency.js +1 -2
  846. package/lib/commonjs/mol-util/array.js +22 -23
  847. package/lib/commonjs/mol-util/binding.js +1 -2
  848. package/lib/commonjs/mol-util/clip.js +1 -2
  849. package/lib/commonjs/mol-util/color/color.js +6 -7
  850. package/lib/commonjs/mol-util/color/distinct.js +2 -2
  851. package/lib/commonjs/mol-util/color/lists.js +2 -2
  852. package/lib/commonjs/mol-util/color/palette.d.ts +4 -3
  853. package/lib/commonjs/mol-util/color/palette.js +2 -3
  854. package/lib/commonjs/mol-util/color/params.js +1 -2
  855. package/lib/commonjs/mol-util/color/scale.d.ts +2 -1
  856. package/lib/commonjs/mol-util/color/spaces/hcl.js +1 -2
  857. package/lib/commonjs/mol-util/color/spaces/lab.js +1 -2
  858. package/lib/commonjs/mol-util/data-source.d.ts +0 -1
  859. package/lib/commonjs/mol-util/data-source.js +7 -7
  860. package/lib/commonjs/mol-util/date.js +2 -3
  861. package/lib/commonjs/mol-util/debug.js +7 -7
  862. package/lib/commonjs/mol-util/download.js +1 -2
  863. package/lib/commonjs/mol-util/file-info.js +1 -2
  864. package/lib/commonjs/mol-util/id-factory.js +1 -2
  865. package/lib/commonjs/mol-util/index.js +13 -13
  866. package/lib/commonjs/mol-util/input/event-offset.js +1 -2
  867. package/lib/commonjs/mol-util/input/input-observer.js +4 -4
  868. package/lib/commonjs/mol-util/is-little-endian.js +1 -2
  869. package/lib/commonjs/mol-util/json.js +2 -3
  870. package/lib/commonjs/mol-util/legend.js +2 -3
  871. package/lib/commonjs/mol-util/make-dir.js +1 -2
  872. package/lib/commonjs/mol-util/map.js +1 -2
  873. package/lib/commonjs/mol-util/marker-action.js +6 -6
  874. package/lib/commonjs/mol-util/mask.js +2 -2
  875. package/lib/commonjs/mol-util/material.js +1 -2
  876. package/lib/commonjs/mol-util/memoize.js +2 -3
  877. package/lib/commonjs/mol-util/nodejs-shims.d.ts +1 -1
  878. package/lib/commonjs/mol-util/now.js +2 -2
  879. package/lib/commonjs/mol-util/number-packing.js +3 -4
  880. package/lib/commonjs/mol-util/number.js +7 -8
  881. package/lib/commonjs/mol-util/object.js +14 -15
  882. package/lib/commonjs/mol-util/param-mapping.js +1 -2
  883. package/lib/commonjs/mol-util/read.js +6 -7
  884. package/lib/commonjs/mol-util/reference-cache.js +3 -4
  885. package/lib/commonjs/mol-util/retry-if.js +1 -2
  886. package/lib/commonjs/mol-util/sleep.js +1 -2
  887. package/lib/commonjs/mol-util/string.js +18 -18
  888. package/lib/commonjs/mol-util/type-helpers.js +3 -4
  889. package/lib/commonjs/mol-util/url.js +2 -3
  890. package/lib/commonjs/mol-util/zip/bin.js +9 -10
  891. package/lib/commonjs/mol-util/zip/checksum.js +2 -3
  892. package/lib/commonjs/mol-util/zip/deflate.js +1 -2
  893. package/lib/commonjs/mol-util/zip/huffman.js +1 -2
  894. package/lib/commonjs/mol-util/zip/inflate.js +1 -2
  895. package/lib/commonjs/mol-util/zip/util.js +4 -4
  896. package/lib/commonjs/mol-util/zip/zip.js +8 -9
  897. package/lib/commonjs/servers/common/file-handle.js +1 -2
  898. package/lib/commonjs/servers/common/swagger-ui/index.js +2 -3
  899. package/lib/commonjs/servers/common/util.js +1 -2
  900. package/lib/commonjs/servers/model/config.d.ts +4 -4
  901. package/lib/commonjs/servers/model/config.js +2 -2
  902. package/lib/commonjs/servers/model/preprocess/converter.js +1 -2
  903. package/lib/commonjs/servers/model/preprocess/parallel.js +2 -3
  904. package/lib/commonjs/servers/model/preprocess/preprocess.js +1 -2
  905. package/lib/commonjs/servers/model/preprocess/util.js +2 -3
  906. package/lib/commonjs/servers/model/property-provider.js +2 -3
  907. package/lib/commonjs/servers/model/query/atoms.js +1 -2
  908. package/lib/commonjs/servers/model/server/api-local.js +1 -2
  909. package/lib/commonjs/servers/model/server/api-schema.js +2 -2
  910. package/lib/commonjs/servers/model/server/api-web-multiple.js +1 -2
  911. package/lib/commonjs/servers/model/server/api-web.js +2 -3
  912. package/lib/commonjs/servers/model/server/api.js +4 -4
  913. package/lib/commonjs/servers/model/server/jobs.js +3 -3
  914. package/lib/commonjs/servers/model/server/query.js +2 -3
  915. package/lib/commonjs/servers/model/server/structure-wrapper.js +6 -6
  916. package/lib/commonjs/servers/model/utils/fetch-retry.js +1 -2
  917. package/lib/commonjs/servers/model/utils/tar.d.ts +0 -1
  918. package/lib/commonjs/servers/model/utils/tar.js +2 -2
  919. package/lib/commonjs/servers/plugin-state/api-schema.js +2 -2
  920. package/lib/commonjs/servers/plugin-state/config.js +1 -2
  921. package/lib/commonjs/servers/volume/common/binary-schema.d.ts +0 -1
  922. package/lib/commonjs/servers/volume/common/binary-schema.js +5 -5
  923. package/lib/commonjs/servers/volume/common/data-format.d.ts +0 -1
  924. package/lib/commonjs/servers/volume/common/data-format.js +2 -3
  925. package/lib/commonjs/servers/volume/common/file.js +4 -5
  926. package/lib/commonjs/servers/volume/config.d.ts +1 -5
  927. package/lib/commonjs/servers/volume/config.js +3 -3
  928. package/lib/commonjs/servers/volume/pack/data-model.js +2 -3
  929. package/lib/commonjs/servers/volume/pack/downsampling.js +2 -3
  930. package/lib/commonjs/servers/volume/pack/format/ccp4.js +2 -2
  931. package/lib/commonjs/servers/volume/pack/format/dsn6.js +2 -2
  932. package/lib/commonjs/servers/volume/pack/format.js +4 -5
  933. package/lib/commonjs/servers/volume/pack/main.js +1 -2
  934. package/lib/commonjs/servers/volume/pack/sampling.js +2 -3
  935. package/lib/commonjs/servers/volume/pack/writer.js +1 -2
  936. package/lib/commonjs/servers/volume/server/algebra/box.js +14 -15
  937. package/lib/commonjs/servers/volume/server/algebra/coordinate.js +17 -18
  938. package/lib/commonjs/servers/volume/server/api.js +3 -4
  939. package/lib/commonjs/servers/volume/server/local-api.js +1 -2
  940. package/lib/commonjs/servers/volume/server/query/compose.js +1 -2
  941. package/lib/commonjs/servers/volume/server/query/encode.js +1 -2
  942. package/lib/commonjs/servers/volume/server/query/execute.js +1 -2
  943. package/lib/commonjs/servers/volume/server/query/identify.js +1 -2
  944. package/lib/commonjs/servers/volume/server/web-api.js +1 -2
  945. package/lib/commonjs/servers/volume/server/web-schema.js +2 -2
  946. package/lib/examples/lighting/index.d.ts +1 -1
  947. package/lib/examples/lighting/index.js +2 -1
  948. package/lib/examples/proteopedia-wrapper/coloring.d.ts +5 -20
  949. package/lib/extensions/alpha-orbitals/transforms.d.ts +3 -3
  950. package/lib/extensions/anvil/behavior.d.ts +1 -0
  951. package/lib/extensions/anvil/representation.d.ts +4 -0
  952. package/lib/extensions/assembly-symmetry/behavior.d.ts +1 -0
  953. package/lib/extensions/assembly-symmetry/color.d.ts +2 -2
  954. package/lib/extensions/assembly-symmetry/representation.d.ts +1 -0
  955. package/lib/extensions/dnatco/confal-pyramids/representation.d.ts +3 -0
  956. package/lib/extensions/dnatco/ntc-tube/representation.d.ts +3 -0
  957. package/lib/extensions/g3d/format.d.ts +3 -3
  958. package/lib/extensions/geo-export/mesh-exporter.d.ts +2 -2
  959. package/lib/extensions/geo-export/ui.d.ts +0 -1
  960. package/lib/extensions/meshes/mesh-extension.d.ts +3 -5
  961. package/lib/extensions/meshes/mesh-streaming/behavior.d.ts +3 -3
  962. package/lib/extensions/meshes/mesh-streaming/server-info.d.ts +3 -3
  963. package/lib/extensions/model-archive/quality-assessment/color/plddt.d.ts +1 -1
  964. package/lib/extensions/model-archive/quality-assessment/color/plddt.js +8 -5
  965. package/lib/extensions/model-export/ui.d.ts +0 -1
  966. package/lib/extensions/mp4-export/controls.d.ts +1 -1
  967. package/lib/extensions/mp4-export/encoder.js +1 -1
  968. package/lib/extensions/mp4-export/ui.d.ts +0 -1
  969. package/lib/extensions/mvs/components/annotation-label/representation.d.ts +32 -34
  970. package/lib/extensions/mvs/components/annotation-label/visual.d.ts +16 -16
  971. package/lib/extensions/mvs/components/custom-label/representation.d.ts +32 -32
  972. package/lib/extensions/mvs/components/custom-label/visual.d.ts +16 -16
  973. package/lib/extensions/mvs/components/formats.d.ts +6 -6
  974. package/lib/extensions/mvs/helpers/indexing.d.ts +2 -2
  975. package/lib/extensions/mvs/helpers/schemas.d.ts +1 -1
  976. package/lib/extensions/mvs/helpers/utils.d.ts +1 -1
  977. package/lib/extensions/mvs/load-helpers.d.ts +1 -1
  978. package/lib/extensions/mvs/tree/mvs/mvs-builder.d.ts +0 -2
  979. package/lib/extensions/rcsb/validation-report/representation.d.ts +5 -0
  980. package/lib/extensions/sb-ncbr/index.d.ts +8 -0
  981. package/lib/extensions/sb-ncbr/index.js +8 -0
  982. package/lib/extensions/sb-ncbr/tunnels/actions.d.ts +20 -0
  983. package/lib/extensions/sb-ncbr/tunnels/actions.js +86 -0
  984. package/lib/extensions/sb-ncbr/tunnels/algorithm.d.ts +26 -0
  985. package/lib/extensions/sb-ncbr/tunnels/algorithm.js +469 -0
  986. package/lib/extensions/sb-ncbr/tunnels/behavior.d.ts +40 -0
  987. package/lib/extensions/sb-ncbr/tunnels/behavior.js +92 -0
  988. package/lib/extensions/sb-ncbr/tunnels/data-model.d.ts +146 -0
  989. package/lib/extensions/sb-ncbr/tunnels/data-model.js +23 -0
  990. package/lib/extensions/sb-ncbr/tunnels/examples.d.ts +12 -0
  991. package/lib/extensions/sb-ncbr/tunnels/examples.js +49 -0
  992. package/lib/extensions/sb-ncbr/tunnels/props.d.ts +19 -0
  993. package/lib/extensions/sb-ncbr/tunnels/props.js +22 -0
  994. package/lib/extensions/sb-ncbr/tunnels/representation.d.ts +29 -0
  995. package/lib/extensions/sb-ncbr/tunnels/representation.js +96 -0
  996. package/lib/extensions/volumes-and-segmentations/entry-root.d.ts +3 -3
  997. package/lib/extensions/volumes-and-segmentations/entry-state.d.ts +3 -3
  998. package/lib/extensions/volumes-and-segmentations/global-state.d.ts +3 -3
  999. package/lib/extensions/volumes-and-segmentations/ui.d.ts +0 -1
  1000. package/lib/extensions/zenodo/ui.d.ts +0 -1
  1001. package/lib/mol-canvas3d/camera/transition.d.ts +1 -1
  1002. package/lib/mol-canvas3d/camera/transition.js +23 -6
  1003. package/lib/mol-canvas3d/canvas3d.d.ts +26 -1
  1004. package/lib/mol-canvas3d/canvas3d.js +4 -0
  1005. package/lib/mol-canvas3d/helper/bounding-sphere-helper.d.ts +1 -6
  1006. package/lib/mol-canvas3d/helper/handle-helper.d.ts +1 -0
  1007. package/lib/mol-canvas3d/helper/helper.d.ts +2 -0
  1008. package/lib/mol-canvas3d/passes/dof.d.ts +34 -0
  1009. package/lib/mol-canvas3d/passes/dof.js +163 -0
  1010. package/lib/mol-canvas3d/passes/draw.d.ts +2 -0
  1011. package/lib/mol-canvas3d/passes/draw.js +31 -8
  1012. package/lib/mol-canvas3d/passes/image.d.ts +10 -0
  1013. package/lib/mol-canvas3d/passes/multi-sample.d.ts +2 -1
  1014. package/lib/mol-canvas3d/passes/multi-sample.js +4 -3
  1015. package/lib/mol-canvas3d/passes/postprocessing.d.ts +9 -0
  1016. package/lib/mol-canvas3d/passes/postprocessing.js +10 -0
  1017. package/lib/mol-data/db/column.d.ts +1 -1
  1018. package/lib/mol-geo/geometry/base.d.ts +1 -1
  1019. package/lib/mol-geo/geometry/cylinders/cylinders.d.ts +1 -0
  1020. package/lib/mol-geo/geometry/cylinders/cylinders.js +3 -0
  1021. package/lib/mol-geo/geometry/direct-volume/direct-volume.d.ts +1 -0
  1022. package/lib/mol-geo/geometry/direct-volume/direct-volume.js +3 -0
  1023. package/lib/mol-geo/geometry/image/image.d.ts +1 -1
  1024. package/lib/mol-geo/geometry/lines/lines.d.ts +0 -1
  1025. package/lib/mol-geo/geometry/mesh/mesh.d.ts +1 -0
  1026. package/lib/mol-geo/geometry/mesh/mesh.js +3 -0
  1027. package/lib/mol-geo/geometry/points/points.d.ts +1 -1
  1028. package/lib/mol-geo/geometry/spheres/spheres.d.ts +1 -0
  1029. package/lib/mol-geo/geometry/spheres/spheres.js +3 -0
  1030. package/lib/mol-geo/geometry/texture-mesh/texture-mesh.d.ts +1 -0
  1031. package/lib/mol-geo/geometry/texture-mesh/texture-mesh.js +3 -0
  1032. package/lib/mol-gl/renderable/cylinders.d.ts +1 -0
  1033. package/lib/mol-gl/renderable/cylinders.js +1 -0
  1034. package/lib/mol-gl/renderable/direct-volume.d.ts +1 -0
  1035. package/lib/mol-gl/renderable/direct-volume.js +1 -0
  1036. package/lib/mol-gl/renderable/mesh.d.ts +1 -0
  1037. package/lib/mol-gl/renderable/mesh.js +1 -0
  1038. package/lib/mol-gl/renderable/schema.d.ts +1 -0
  1039. package/lib/mol-gl/renderable/schema.js +1 -0
  1040. package/lib/mol-gl/renderable/spheres.d.ts +1 -0
  1041. package/lib/mol-gl/renderable/spheres.js +1 -0
  1042. package/lib/mol-gl/renderable/texture-mesh.d.ts +1 -0
  1043. package/lib/mol-gl/renderable/texture-mesh.js +1 -0
  1044. package/lib/mol-gl/renderer.d.ts +1 -0
  1045. package/lib/mol-gl/renderer.js +6 -0
  1046. package/lib/mol-gl/shader/chunks/apply-light-color.glsl.d.ts +2 -1
  1047. package/lib/mol-gl/shader/chunks/apply-light-color.glsl.js +57 -24
  1048. package/lib/mol-gl/shader/chunks/common-frag-params.glsl.d.ts +1 -1
  1049. package/lib/mol-gl/shader/chunks/common-frag-params.glsl.js +1 -0
  1050. package/lib/mol-gl/shader/chunks/common.glsl.d.ts +1 -1
  1051. package/lib/mol-gl/shader/chunks/common.glsl.js +6 -0
  1052. package/lib/mol-gl/shader/cylinders.frag.d.ts +2 -1
  1053. package/lib/mol-gl/shader/cylinders.frag.js +11 -2
  1054. package/lib/mol-gl/shader/direct-volume.frag.d.ts +1 -1
  1055. package/lib/mol-gl/shader/direct-volume.frag.js +1 -0
  1056. package/lib/mol-gl/shader/dof.frag.d.ts +7 -0
  1057. package/lib/mol-gl/shader/dof.frag.js +119 -0
  1058. package/lib/mol-gl/shader/ssao-blur.frag.d.ts +1 -1
  1059. package/lib/mol-gl/shader/ssao-blur.frag.js +9 -6
  1060. package/lib/mol-gl/shader-code.js +1 -1
  1061. package/lib/mol-gl/webgl/context.js +1 -0
  1062. package/lib/mol-gl/webgl/render-item.d.ts +2 -2
  1063. package/lib/mol-gl/webgl/timer.d.ts +1 -1
  1064. package/lib/mol-gl/webgl/timer.js +8 -1
  1065. package/lib/mol-io/common/simple-buffer.d.ts +0 -1
  1066. package/lib/mol-io/reader/cif/schema/bird.d.ts +1 -1
  1067. package/lib/mol-io/reader/cif/schema/bird.js +1 -1
  1068. package/lib/mol-io/reader/cif/schema/ccd.d.ts +1 -1
  1069. package/lib/mol-io/reader/cif/schema/ccd.js +1 -1
  1070. package/lib/mol-io/reader/cif/schema/mmcif.d.ts +9 -1
  1071. package/lib/mol-io/reader/cif/schema/mmcif.js +9 -1
  1072. package/lib/mol-io/reader/common/text/column/fixed.d.ts +1 -1
  1073. package/lib/mol-io/reader/common/text/column/token.d.ts +1 -1
  1074. package/lib/mol-io/reader/ply/schema.d.ts +1 -1
  1075. package/lib/mol-math/linear-algebra/3d/minimize-rmsd.js +2 -1
  1076. package/lib/mol-model/loci.d.ts +1 -1
  1077. package/lib/mol-model/sequence/alignment/alignment.d.ts +2 -1
  1078. package/lib/mol-model/structure/model/types/saccharides.js +1 -1
  1079. package/lib/mol-model/structure/model/types.d.ts +3 -3
  1080. package/lib/mol-model/structure/query/queries/generators.js +2 -2
  1081. package/lib/mol-model/structure/structure/properties.d.ts +1 -0
  1082. package/lib/mol-model/structure/structure/properties.js +1 -0
  1083. package/lib/mol-model/volume/volume.d.ts +6 -6
  1084. package/lib/mol-model-formats/shape/ply.d.ts +2 -0
  1085. package/lib/mol-model-formats/structure/basic/schema.d.ts +1 -0
  1086. package/lib/mol-model-formats/structure/common/entity.d.ts +1 -0
  1087. package/lib/mol-model-props/computed/representations/interactions-inter-unit-cylinder.d.ts +1 -0
  1088. package/lib/mol-model-props/computed/representations/interactions-intra-unit-cylinder.d.ts +1 -0
  1089. package/lib/mol-model-props/computed/representations/interactions.d.ts +3 -0
  1090. package/lib/mol-model-props/integrative/cross-link-restraint/representation.d.ts +4 -0
  1091. package/lib/mol-model-props/sequence/themes/sifts-mapping.d.ts +2 -2
  1092. package/lib/mol-plugin/animation-loop.d.ts +1 -0
  1093. package/lib/mol-plugin/behavior/behavior.d.ts +9 -9
  1094. package/lib/mol-plugin/behavior/dynamic/volume-streaming/behavior.d.ts +9 -9
  1095. package/lib/mol-plugin/behavior/dynamic/volume-streaming/model.d.ts +3 -3
  1096. package/lib/mol-plugin/behavior/dynamic/volume-streaming/transformers.d.ts +3 -3
  1097. package/lib/mol-plugin/commands.d.ts +23 -87
  1098. package/lib/mol-plugin/context.d.ts +3 -2
  1099. package/lib/mol-plugin/context.js +4 -2
  1100. package/lib/mol-plugin/state.d.ts +7 -7
  1101. package/lib/mol-plugin/util/headless-screenshot.d.ts +1 -1
  1102. package/lib/mol-plugin/util/headless-screenshot.js +3 -1
  1103. package/lib/mol-plugin/util/viewport-screenshot.d.ts +1 -1
  1104. package/lib/mol-plugin/util/viewport-screenshot.js +2 -1
  1105. package/lib/mol-plugin/version.js +2 -2
  1106. package/lib/mol-plugin-state/actions/volume.d.ts +1 -1
  1107. package/lib/mol-plugin-state/actions/volume.js +4 -12
  1108. package/lib/mol-plugin-state/animation/built-in/model-index.d.ts +2 -2
  1109. package/lib/mol-plugin-state/animation/built-in/state-snapshots.js +7 -3
  1110. package/lib/mol-plugin-state/formats/registry.d.ts +1 -1
  1111. package/lib/mol-plugin-state/formats/trajectory.d.ts +9 -9
  1112. package/lib/mol-plugin-state/formats/volume.d.ts +0 -1
  1113. package/lib/mol-plugin-state/manager/structure/hierarchy.d.ts +3 -3
  1114. package/lib/mol-plugin-state/manager/structure/measurement.d.ts +4 -0
  1115. package/lib/mol-plugin-state/objects.d.ts +97 -97
  1116. package/lib/mol-plugin-state/transforms/data.d.ts +10 -1
  1117. package/lib/mol-plugin-state/transforms/data.js +30 -1
  1118. package/lib/mol-plugin-state/transforms/representation.d.ts +6 -0
  1119. package/lib/mol-plugin-ui/base.js +2 -1
  1120. package/lib/mol-plugin-ui/controls/icons.d.ts +5 -0
  1121. package/lib/mol-plugin-ui/controls/icons.js +10 -0
  1122. package/lib/mol-plugin-ui/controls/parameters.d.ts +3 -3
  1123. package/lib/mol-plugin-ui/controls.js +1 -1
  1124. package/lib/mol-plugin-ui/left-panel.d.ts +0 -1
  1125. package/lib/mol-plugin-ui/plugin.js +3 -2
  1126. package/lib/mol-plugin-ui/skin/base/components/controls.scss +6 -0
  1127. package/lib/mol-plugin-ui/spec.d.ts +10 -10
  1128. package/lib/mol-plugin-ui/spec.js +1 -1
  1129. package/lib/mol-plugin-ui/state/apply-action.d.ts +1 -1
  1130. package/lib/mol-plugin-ui/state/update-transform.d.ts +1 -1
  1131. package/lib/mol-plugin-ui/structure/quick-styles.d.ts +2 -1
  1132. package/lib/mol-plugin-ui/structure/quick-styles.js +5 -2
  1133. package/lib/mol-plugin-ui/structure/selection.d.ts +2 -2
  1134. package/lib/mol-plugin-ui/viewport/simple-settings.js +3 -0
  1135. package/lib/mol-repr/representation.d.ts +3 -3
  1136. package/lib/mol-repr/shape/loci/angle.d.ts +1 -0
  1137. package/lib/mol-repr/shape/loci/dihedral.d.ts +1 -0
  1138. package/lib/mol-repr/shape/loci/orientation.d.ts +1 -0
  1139. package/lib/mol-repr/shape/loci/plane.d.ts +1 -0
  1140. package/lib/mol-repr/shape/model/unitcell.d.ts +1 -0
  1141. package/lib/mol-repr/structure/complex-visual.d.ts +5 -0
  1142. package/lib/mol-repr/structure/params.d.ts +5 -0
  1143. package/lib/mol-repr/structure/registry.d.ts +11 -0
  1144. package/lib/mol-repr/structure/representation/backbone.d.ts +3 -0
  1145. package/lib/mol-repr/structure/representation/ball-and-stick.d.ts +3 -0
  1146. package/lib/mol-repr/structure/representation/carbohydrate.d.ts +3 -0
  1147. package/lib/mol-repr/structure/representation/cartoon.d.ts +3 -0
  1148. package/lib/mol-repr/structure/representation/ellipsoid.d.ts +3 -0
  1149. package/lib/mol-repr/structure/representation/gaussian-surface.d.ts +3 -0
  1150. package/lib/mol-repr/structure/representation/gaussian-volume.d.ts +3 -0
  1151. package/lib/mol-repr/structure/representation/molecular-surface.d.ts +3 -0
  1152. package/lib/mol-repr/structure/representation/orientation.d.ts +3 -0
  1153. package/lib/mol-repr/structure/representation/putty.d.ts +3 -0
  1154. package/lib/mol-repr/structure/representation/spacefill.d.ts +3 -0
  1155. package/lib/mol-repr/structure/units-visual.d.ts +5 -0
  1156. package/lib/mol-repr/structure/visual/bond-inter-unit-cylinder.d.ts +2 -0
  1157. package/lib/mol-repr/structure/visual/bond-intra-unit-cylinder.d.ts +2 -0
  1158. package/lib/mol-repr/structure/visual/carbohydrate-link-cylinder.d.ts +1 -0
  1159. package/lib/mol-repr/structure/visual/carbohydrate-symbol-mesh.d.ts +1 -0
  1160. package/lib/mol-repr/structure/visual/carbohydrate-terminal-link-cylinder.d.ts +1 -0
  1161. package/lib/mol-repr/structure/visual/element-sphere.d.ts +4 -0
  1162. package/lib/mol-repr/structure/visual/ellipsoid-mesh.d.ts +1 -0
  1163. package/lib/mol-repr/structure/visual/gaussian-density-volume.d.ts +2 -0
  1164. package/lib/mol-repr/structure/visual/gaussian-surface-mesh.d.ts +4 -0
  1165. package/lib/mol-repr/structure/visual/molecular-surface-mesh.d.ts +1 -0
  1166. package/lib/mol-repr/structure/visual/nucleotide-atomic-bond.d.ts +2 -0
  1167. package/lib/mol-repr/structure/visual/nucleotide-atomic-element.d.ts +2 -0
  1168. package/lib/mol-repr/structure/visual/nucleotide-atomic-ring-fill.d.ts +1 -0
  1169. package/lib/mol-repr/structure/visual/nucleotide-block-mesh.d.ts +1 -0
  1170. package/lib/mol-repr/structure/visual/nucleotide-ring-mesh.d.ts +1 -0
  1171. package/lib/mol-repr/structure/visual/orientation-ellipsoid-mesh.d.ts +1 -0
  1172. package/lib/mol-repr/structure/visual/polymer-backbone-cylinder.d.ts +2 -0
  1173. package/lib/mol-repr/structure/visual/polymer-backbone-sphere.d.ts +2 -0
  1174. package/lib/mol-repr/structure/visual/polymer-direction-wedge.d.ts +1 -0
  1175. package/lib/mol-repr/structure/visual/polymer-gap-cylinder.d.ts +1 -0
  1176. package/lib/mol-repr/structure/visual/polymer-trace-mesh.d.ts +1 -0
  1177. package/lib/mol-repr/structure/visual/polymer-tube-mesh.d.ts +1 -0
  1178. package/lib/mol-repr/structure/visual/util/nucleotide.d.ts +60 -60
  1179. package/lib/mol-repr/volume/direct-volume.d.ts +48 -45
  1180. package/lib/mol-repr/volume/isosurface.d.ts +95 -90
  1181. package/lib/mol-repr/volume/registry.d.ts +63 -60
  1182. package/lib/mol-repr/volume/segment.d.ts +80 -75
  1183. package/lib/mol-repr/volume/slice.d.ts +45 -45
  1184. package/lib/mol-script/language/symbol-table/core.d.ts +1 -1
  1185. package/lib/mol-state/object.d.ts +4 -4
  1186. package/lib/mol-state/state.d.ts +4 -4
  1187. package/lib/mol-state/transform.d.ts +1 -1
  1188. package/lib/mol-state/transformer.d.ts +1 -1
  1189. package/lib/mol-task/util/scheduler.d.ts +0 -1
  1190. package/lib/mol-theme/color/atom-id.d.ts +2 -2
  1191. package/lib/mol-theme/color/chain-id.d.ts +2 -2
  1192. package/lib/mol-theme/color/element-index.d.ts +2 -2
  1193. package/lib/mol-theme/color/entity-id.d.ts +2 -2
  1194. package/lib/mol-theme/color/entity-source.d.ts +2 -2
  1195. package/lib/mol-theme/color/external-volume.d.ts +2 -2
  1196. package/lib/mol-theme/color/model-index.d.ts +2 -2
  1197. package/lib/mol-theme/color/operator-hkl.d.ts +2 -2
  1198. package/lib/mol-theme/color/operator-name.d.ts +2 -2
  1199. package/lib/mol-theme/color/polymer-id.d.ts +2 -2
  1200. package/lib/mol-theme/color/polymer-index.d.ts +2 -2
  1201. package/lib/mol-theme/color/structure-index.d.ts +2 -2
  1202. package/lib/mol-theme/color/trajectory-index.d.ts +2 -2
  1203. package/lib/mol-theme/color/unit-index.d.ts +2 -2
  1204. package/lib/mol-theme/color/volume-segment.d.ts +2 -2
  1205. package/lib/mol-theme/color.d.ts +16 -16
  1206. package/lib/mol-theme/theme.d.ts +3 -3
  1207. package/lib/mol-util/color/palette.d.ts +4 -3
  1208. package/lib/mol-util/color/scale.d.ts +2 -1
  1209. package/lib/mol-util/data-source.d.ts +0 -1
  1210. package/lib/mol-util/nodejs-shims.d.ts +1 -1
  1211. package/lib/servers/model/config.d.ts +4 -4
  1212. package/lib/servers/model/utils/tar.d.ts +0 -1
  1213. package/lib/servers/volume/common/binary-schema.d.ts +0 -1
  1214. package/lib/servers/volume/common/data-format.d.ts +0 -1
  1215. package/lib/servers/volume/config.d.ts +1 -5
  1216. package/package.json +18 -16
@@ -549,6 +549,7 @@ export var Mesh;
549
549
  flipSided: PD.Boolean(false, BaseGeometry.ShadingCategory),
550
550
  flatShaded: PD.Boolean(false, BaseGeometry.ShadingCategory),
551
551
  ignoreLight: PD.Boolean(false, BaseGeometry.ShadingCategory),
552
+ celShaded: PD.Boolean(false, BaseGeometry.ShadingCategory),
552
553
  xrayShaded: PD.Select(false, [[false, 'Off'], [true, 'On'], ['inverted', 'Inverted']], BaseGeometry.ShadingCategory),
553
554
  transparentBackfaces: PD.Select('off', PD.arrayToOptions(['off', 'on', 'opaque']), BaseGeometry.ShadingCategory),
554
555
  bumpFrequency: PD.Numeric(0, { min: 0, max: 10, step: 0.1 }, BaseGeometry.ShadingCategory),
@@ -625,6 +626,7 @@ export var Mesh;
625
626
  dFlatShaded: ValueCell.create(props.flatShaded),
626
627
  dFlipSided: ValueCell.create(props.flipSided),
627
628
  dIgnoreLight: ValueCell.create(props.ignoreLight),
629
+ dCelShaded: ValueCell.create(props.celShaded),
628
630
  dXrayShaded: ValueCell.create(props.xrayShaded === 'inverted' ? 'inverted' : props.xrayShaded === true ? 'on' : 'off'),
629
631
  dTransparentBackfaces: ValueCell.create(props.transparentBackfaces),
630
632
  uBumpFrequency: ValueCell.create(props.bumpFrequency),
@@ -643,6 +645,7 @@ export var Mesh;
643
645
  ValueCell.updateIfChanged(values.dFlatShaded, props.flatShaded);
644
646
  ValueCell.updateIfChanged(values.dFlipSided, props.flipSided);
645
647
  ValueCell.updateIfChanged(values.dIgnoreLight, props.ignoreLight);
648
+ ValueCell.updateIfChanged(values.dCelShaded, props.celShaded);
646
649
  ValueCell.updateIfChanged(values.dXrayShaded, props.xrayShaded === 'inverted' ? 'inverted' : props.xrayShaded === true ? 'on' : 'off');
647
650
  ValueCell.updateIfChanged(values.dTransparentBackfaces, props.transparentBackfaces);
648
651
  ValueCell.updateIfChanged(values.uBumpFrequency, props.bumpFrequency);
@@ -34,7 +34,7 @@ export declare namespace Points {
34
34
  fuzzy: string;
35
35
  };
36
36
  type StyleTypes = keyof typeof StyleTypes;
37
- const StyleTypeNames: ("circle" | "square" | "fuzzy")[];
37
+ const StyleTypeNames: StyleTypes[];
38
38
  const Params: {
39
39
  sizeFactor: PD.Numeric;
40
40
  pointSizeAttenuation: PD.BooleanParam;
@@ -50,6 +50,7 @@ export declare namespace Spheres {
50
50
  sizeFactor: PD.Numeric;
51
51
  doubleSided: PD.BooleanParam;
52
52
  ignoreLight: PD.BooleanParam;
53
+ celShaded: PD.BooleanParam;
53
54
  xrayShaded: PD.Select<boolean | "inverted">;
54
55
  transparentBackfaces: PD.Select<"on" | "off" | "opaque">;
55
56
  solidInterior: PD.BooleanParam;
@@ -191,6 +191,7 @@ export var Spheres;
191
191
  sizeFactor: PD.Numeric(1, { min: 0, max: 10, step: 0.1 }),
192
192
  doubleSided: PD.Boolean(false, BaseGeometry.CustomQualityParamInfo),
193
193
  ignoreLight: PD.Boolean(false, BaseGeometry.ShadingCategory),
194
+ celShaded: PD.Boolean(false, BaseGeometry.ShadingCategory),
194
195
  xrayShaded: PD.Select(false, [[false, 'Off'], [true, 'On'], ['inverted', 'Inverted']], BaseGeometry.ShadingCategory),
195
196
  transparentBackfaces: PD.Select('off', PD.arrayToOptions(['off', 'on', 'opaque']), BaseGeometry.ShadingCategory),
196
197
  solidInterior: PD.Boolean(true, BaseGeometry.ShadingCategory),
@@ -278,6 +279,7 @@ export var Spheres;
278
279
  uSizeFactor: spheres.shaderData.sizeFactor,
279
280
  uDoubleSided: ValueCell.create(props.doubleSided),
280
281
  dIgnoreLight: ValueCell.create(props.ignoreLight),
282
+ dCelShaded: ValueCell.create(props.celShaded),
281
283
  dXrayShaded: ValueCell.create(props.xrayShaded === 'inverted' ? 'inverted' : props.xrayShaded === true ? 'on' : 'off'),
282
284
  dTransparentBackfaces: ValueCell.create(props.transparentBackfaces),
283
285
  dSolidInterior: ValueCell.create(props.solidInterior),
@@ -301,6 +303,7 @@ export var Spheres;
301
303
  ValueCell.updateIfChanged(values.uSizeFactor, props.sizeFactor);
302
304
  ValueCell.updateIfChanged(values.uDoubleSided, props.doubleSided);
303
305
  ValueCell.updateIfChanged(values.dIgnoreLight, props.ignoreLight);
306
+ ValueCell.updateIfChanged(values.dCelShaded, props.celShaded);
304
307
  ValueCell.updateIfChanged(values.dXrayShaded, props.xrayShaded === 'inverted' ? 'inverted' : props.xrayShaded === true ? 'on' : 'off');
305
308
  ValueCell.updateIfChanged(values.dTransparentBackfaces, props.transparentBackfaces);
306
309
  ValueCell.updateIfChanged(values.dSolidInterior, props.solidInterior);
@@ -48,6 +48,7 @@ export declare namespace TextureMesh {
48
48
  flipSided: PD.BooleanParam;
49
49
  flatShaded: PD.BooleanParam;
50
50
  ignoreLight: PD.BooleanParam;
51
+ celShaded: PD.BooleanParam;
51
52
  xrayShaded: PD.Select<boolean | "inverted">;
52
53
  transparentBackfaces: PD.Select<"on" | "off" | "opaque">;
53
54
  bumpFrequency: PD.Numeric;
@@ -90,6 +90,7 @@ export var TextureMesh;
90
90
  flipSided: PD.Boolean(false, BaseGeometry.ShadingCategory),
91
91
  flatShaded: PD.Boolean(false, BaseGeometry.ShadingCategory),
92
92
  ignoreLight: PD.Boolean(false, BaseGeometry.ShadingCategory),
93
+ celShaded: PD.Boolean(false, BaseGeometry.ShadingCategory),
93
94
  xrayShaded: PD.Select(false, [[false, 'Off'], [true, 'On'], ['inverted', 'Inverted']], BaseGeometry.ShadingCategory),
94
95
  transparentBackfaces: PD.Select('off', PD.arrayToOptions(['off', 'on', 'opaque']), BaseGeometry.ShadingCategory),
95
96
  bumpFrequency: PD.Numeric(0, { min: 0, max: 10, step: 0.1 }, BaseGeometry.ShadingCategory),
@@ -181,6 +182,7 @@ export var TextureMesh;
181
182
  dFlatShaded: ValueCell.create(props.flatShaded),
182
183
  dFlipSided: ValueCell.create(props.flipSided),
183
184
  dIgnoreLight: ValueCell.create(props.ignoreLight),
185
+ dCelShaded: ValueCell.create(props.celShaded),
184
186
  dXrayShaded: ValueCell.create(props.xrayShaded === 'inverted' ? 'inverted' : props.xrayShaded === true ? 'on' : 'off'),
185
187
  dTransparentBackfaces: ValueCell.create(props.transparentBackfaces),
186
188
  uBumpFrequency: ValueCell.create(props.bumpFrequency),
@@ -199,6 +201,7 @@ export var TextureMesh;
199
201
  ValueCell.updateIfChanged(values.dFlatShaded, props.flatShaded);
200
202
  ValueCell.updateIfChanged(values.dFlipSided, props.flipSided);
201
203
  ValueCell.updateIfChanged(values.dIgnoreLight, props.ignoreLight);
204
+ ValueCell.updateIfChanged(values.dCelShaded, props.celShaded);
202
205
  ValueCell.updateIfChanged(values.dXrayShaded, props.xrayShaded === 'inverted' ? 'inverted' : props.xrayShaded === true ? 'on' : 'off');
203
206
  ValueCell.updateIfChanged(values.dTransparentBackfaces, props.transparentBackfaces);
204
207
  ValueCell.updateIfChanged(values.uBumpFrequency, props.bumpFrequency);
@@ -19,6 +19,7 @@ export declare const CylindersSchema: {
19
19
  padding: ValueSpec<"number">;
20
20
  uDoubleSided: UniformSpec<"b">;
21
21
  dIgnoreLight: DefineSpec<"boolean">;
22
+ dCelShaded: DefineSpec<"boolean">;
22
23
  dXrayShaded: DefineSpec<"string">;
23
24
  dTransparentBackfaces: DefineSpec<"string">;
24
25
  dSolidInterior: DefineSpec<"boolean">;
@@ -22,6 +22,7 @@ export const CylindersSchema = {
22
22
  padding: ValueSpec('number'),
23
23
  uDoubleSided: UniformSpec('b', 'material'),
24
24
  dIgnoreLight: DefineSpec('boolean'),
25
+ dCelShaded: DefineSpec('boolean'),
25
26
  dXrayShaded: DefineSpec('string', ['off', 'on', 'inverted']),
26
27
  dTransparentBackfaces: DefineSpec('string', ['off', 'on', 'opaque']),
27
28
  dSolidInterior: DefineSpec('boolean'),
@@ -30,6 +30,7 @@ export declare const DirectVolumeSchema: {
30
30
  dPackedGroup: DefineSpec<"boolean">;
31
31
  dAxisOrder: DefineSpec<"string">;
32
32
  dIgnoreLight: DefineSpec<"boolean">;
33
+ dCelShaded: DefineSpec<"boolean">;
33
34
  dXrayShaded: DefineSpec<"string">;
34
35
  dLightCount: DefineSpec<"number">;
35
36
  dColorMarker: DefineSpec<"boolean">;
@@ -32,6 +32,7 @@ export const DirectVolumeSchema = {
32
32
  dPackedGroup: DefineSpec('boolean'),
33
33
  dAxisOrder: DefineSpec('string', ['012', '021', '102', '120', '201', '210']),
34
34
  dIgnoreLight: DefineSpec('boolean'),
35
+ dCelShaded: DefineSpec('boolean'),
35
36
  dXrayShaded: DefineSpec('string', ['off', 'on', 'inverted']),
36
37
  };
37
38
  export function DirectVolumeRenderable(ctx, id, values, state, materialId, transparency) {
@@ -17,6 +17,7 @@ export declare const MeshSchema: {
17
17
  readonly uDoubleSided: UniformSpec<"b">;
18
18
  readonly dFlipSided: DefineSpec<"boolean">;
19
19
  readonly dIgnoreLight: DefineSpec<"boolean">;
20
+ readonly dCelShaded: DefineSpec<"boolean">;
20
21
  readonly dXrayShaded: DefineSpec<"string">;
21
22
  readonly dTransparentBackfaces: DefineSpec<"string">;
22
23
  readonly uBumpFrequency: UniformSpec<"f">;
@@ -19,6 +19,7 @@ export const MeshSchema = {
19
19
  uDoubleSided: UniformSpec('b', 'material'),
20
20
  dFlipSided: DefineSpec('boolean'),
21
21
  dIgnoreLight: DefineSpec('boolean'),
22
+ dCelShaded: DefineSpec('boolean'),
22
23
  dXrayShaded: DefineSpec('string', ['off', 'on', 'inverted']),
23
24
  dTransparentBackfaces: DefineSpec('string', ['off', 'on', 'opaque']),
24
25
  uBumpFrequency: UniformSpec('f', 'material'),
@@ -133,6 +133,7 @@ export declare const GlobalUniformSchema: {
133
133
  readonly uMarkerPriority: UniformSpec<"i">;
134
134
  readonly uMarkerAverage: UniformSpec<"f">;
135
135
  readonly uXrayEdgeFalloff: UniformSpec<"f">;
136
+ readonly uCelSteps: UniformSpec<"f">;
136
137
  readonly uExposure: UniformSpec<"f">;
137
138
  readonly uRenderMask: UniformSpec<"i">;
138
139
  readonly uMarkingDepthTest: UniformSpec<"b">;
@@ -105,6 +105,7 @@ export const GlobalUniformSchema = {
105
105
  uMarkerPriority: UniformSpec('i'),
106
106
  uMarkerAverage: UniformSpec('f'),
107
107
  uXrayEdgeFalloff: UniformSpec('f'),
108
+ uCelSteps: UniformSpec('f'),
108
109
  uExposure: UniformSpec('f'),
109
110
  uRenderMask: UniformSpec('i'),
110
111
  uMarkingDepthTest: UniformSpec('b'),
@@ -13,6 +13,7 @@ export declare const SpheresSchema: {
13
13
  padding: ValueSpec<"number">;
14
14
  uDoubleSided: UniformSpec<"b">;
15
15
  dIgnoreLight: DefineSpec<"boolean">;
16
+ dCelShaded: DefineSpec<"boolean">;
16
17
  dXrayShaded: DefineSpec<"string">;
17
18
  dTransparentBackfaces: DefineSpec<"string">;
18
19
  dSolidInterior: DefineSpec<"boolean">;
@@ -16,6 +16,7 @@ export const SpheresSchema = {
16
16
  padding: ValueSpec('number'),
17
17
  uDoubleSided: UniformSpec('b', 'material'),
18
18
  dIgnoreLight: DefineSpec('boolean'),
19
+ dCelShaded: DefineSpec('boolean'),
19
20
  dXrayShaded: DefineSpec('string', ['off', 'on', 'inverted']),
20
21
  dTransparentBackfaces: DefineSpec('string', ['off', 'on', 'opaque']),
21
22
  dSolidInterior: DefineSpec('boolean'),
@@ -17,6 +17,7 @@ export declare const TextureMeshSchema: {
17
17
  uDoubleSided: UniformSpec<"b">;
18
18
  dFlipSided: DefineSpec<"boolean">;
19
19
  dIgnoreLight: DefineSpec<"boolean">;
20
+ dCelShaded: DefineSpec<"boolean">;
20
21
  dXrayShaded: DefineSpec<"string">;
21
22
  dTransparentBackfaces: DefineSpec<"string">;
22
23
  uBumpFrequency: UniformSpec<"f">;
@@ -19,6 +19,7 @@ export const TextureMeshSchema = {
19
19
  uDoubleSided: UniformSpec('b', 'material'),
20
20
  dFlipSided: DefineSpec('boolean'),
21
21
  dIgnoreLight: DefineSpec('boolean'),
22
+ dCelShaded: DefineSpec('boolean'),
22
23
  dXrayShaded: DefineSpec('string', ['off', 'on', 'inverted']),
23
24
  dTransparentBackfaces: DefineSpec('string', ['off', 'on', 'opaque']),
24
25
  uBumpFrequency: UniformSpec('f', 'material'),
@@ -85,6 +85,7 @@ export declare const RendererParams: {
85
85
  dimStrength: PD.Numeric;
86
86
  markerPriority: PD.Select<number>;
87
87
  xrayEdgeFalloff: PD.Numeric;
88
+ celSteps: PD.Numeric;
88
89
  exposure: PD.Numeric;
89
90
  light: PD.ObjectList<PD.Normalize<{
90
91
  inclination: number;
@@ -43,6 +43,7 @@ export const RendererParams = {
43
43
  dimStrength: PD.Numeric(0.0, { min: 0.0, max: 1.0, step: 0.1 }),
44
44
  markerPriority: PD.Select(1, [[1, 'Highlight'], [2, 'Select']]),
45
45
  xrayEdgeFalloff: PD.Numeric(1, { min: 0.0, max: 3.0, step: 0.1 }),
46
+ celSteps: PD.Numeric(5, { min: 2, max: 16, step: 1 }),
46
47
  exposure: PD.Numeric(1, { min: 0.0, max: 3.0, step: 0.01 }),
47
48
  light: PD.ObjectList({
48
49
  inclination: PD.Numeric(150, { min: 0, max: 180, step: 1 }),
@@ -152,6 +153,7 @@ var Renderer;
152
153
  uMarkerPriority: ValueCell.create(p.markerPriority),
153
154
  uMarkerAverage: ValueCell.create(0),
154
155
  uXrayEdgeFalloff: ValueCell.create(p.xrayEdgeFalloff),
156
+ uCelSteps: ValueCell.create(p.celSteps),
155
157
  uExposure: ValueCell.create(p.exposure),
156
158
  };
157
159
  const globalUniformList = Object.entries(globalUniforms);
@@ -706,6 +708,10 @@ var Renderer;
706
708
  p.xrayEdgeFalloff = props.xrayEdgeFalloff;
707
709
  ValueCell.update(globalUniforms.uXrayEdgeFalloff, p.xrayEdgeFalloff);
708
710
  }
711
+ if (props.celSteps !== undefined && props.celSteps !== p.celSteps) {
712
+ p.celSteps = props.celSteps;
713
+ ValueCell.update(globalUniforms.uCelSteps, p.celSteps);
714
+ }
709
715
  if (props.exposure !== undefined && props.exposure !== p.exposure) {
710
716
  p.exposure = props.exposure;
711
717
  ValueCell.update(globalUniforms.uExposure, p.exposure);
@@ -2,8 +2,9 @@
2
2
  * Copyright (c) 2017-2024 mol* contributors, licensed under MIT, See LICENSE file for more info.
3
3
  *
4
4
  * @author Alexander Rose <alexander.rose@weirdbyte.de>
5
+ * @author Gianluca Tomasello <giagitom@gmail.com>
5
6
  *
6
7
  * adapted from three.js (https://github.com/mrdoob/three.js/)
7
8
  * which under the MIT License, Copyright © 2010-2021 three.js authors
8
9
  */
9
- export declare const apply_light_color = "\n#if defined(dIgnoreLight)\n #ifdef bumpEnabled\n if (uBumpFrequency > 0.0 && uBumpAmplitude > 0.0 && bumpiness > 0.0) {\n material.rgb += fbm(vModelPosition * uBumpFrequency) * uBumpAmplitude * bumpiness;\n material.rgb -= 0.5 * uBumpAmplitude * bumpiness;\n }\n #endif\n\n #if defined(dRenderVariant_color)\n material.rgb += material.rgb * emissive;\n #endif\n\n gl_FragColor = material;\n#else\n #ifdef bumpEnabled\n if (uBumpFrequency > 0.0 && uBumpAmplitude > 0.0 && bumpiness > 0.0) {\n normal = perturbNormal(-vViewPosition, normal, fbm(vModelPosition * uBumpFrequency), (uBumpAmplitude * bumpiness) / uBumpFrequency);\n }\n #endif\n\n vec4 color = material;\n\n ReflectedLight reflectedLight = ReflectedLight(vec3(0.0), vec3(0.0), vec3(0.0), vec3(0.0));\n\n PhysicalMaterial physicalMaterial;\n physicalMaterial.diffuseColor = color.rgb * (1.0 - metalness);\n #ifdef enabledFragDepth\n physicalMaterial.roughness = min(max(roughness, 0.0525), 1.0);\n #else\n vec3 dxy = max(abs(dFdx(normal)), abs(dFdy(normal)));\n float geometryRoughness = max(max(dxy.x, dxy.y), dxy.z);\n physicalMaterial.roughness = min(max(roughness, 0.0525) + geometryRoughness, 1.0);\n #endif\n physicalMaterial.specularColor = mix(vec3(0.04), color.rgb, metalness);\n physicalMaterial.specularF90 = 1.0;\n\n GeometricContext geometry;\n geometry.position = -vViewPosition;\n geometry.normal = normal;\n geometry.viewDir = normalize(vViewPosition);\n\n IncidentLight directLight;\n #pragma unroll_loop_start\n for (int i = 0; i < dLightCount; ++i) {\n directLight.direction = uLightDirection[i];\n directLight.color = uLightColor[i] * PI; // * PI for punctual light\n RE_Direct_Physical(directLight, geometry, physicalMaterial, reflectedLight);\n }\n #pragma unroll_loop_end\n\n vec3 irradiance = uAmbientColor * PI; // * PI for punctual light\n RE_IndirectDiffuse_Physical(irradiance, geometry, physicalMaterial, reflectedLight);\n\n // indirect specular only metals\n vec3 radiance = uAmbientColor * metalness;\n vec3 iblIrradiance = uAmbientColor * metalness;\n vec3 clearcoatRadiance = vec3(0.0);\n RE_IndirectSpecular_Physical(radiance, iblIrradiance, clearcoatRadiance, geometry, physicalMaterial, reflectedLight);\n\n vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular;\n outgoingLight = clamp(outgoingLight, 0.01, 0.99); // prevents black artifacts on specular highlight with transparent background\n\n #if defined(dRenderVariant_color)\n outgoingLight += color.rgb * emissive;\n #endif\n\n gl_FragColor = vec4(outgoingLight, color.a);\n#endif\n\n#if defined(dXrayShaded_on)\n gl_FragColor.a *= 1.0 - pow(abs(dot(normal, vec3(0.0, 0.0, 1.0))), uXrayEdgeFalloff);\n#elif defined(dXrayShaded_inverted)\n gl_FragColor.a *= pow(abs(dot(normal, vec3(0.0, 0.0, 1.0))), uXrayEdgeFalloff);\n#endif\n\ngl_FragColor.rgb *= uExposure;\n";
10
+ export declare const apply_light_color = "\n#if defined(dIgnoreLight)\n #ifdef bumpEnabled\n if (uBumpFrequency > 0.0 && uBumpAmplitude > 0.0 && bumpiness > 0.0) {\n material.rgb += fbm(vModelPosition * uBumpFrequency) * uBumpAmplitude * bumpiness;\n material.rgb -= 0.5 * uBumpAmplitude * bumpiness;\n }\n #endif\n\n #if defined(dRenderVariant_color)\n material.rgb += material.rgb * emissive;\n #endif\n\n gl_FragColor = material;\n#else\n #ifdef bumpEnabled\n if (uBumpFrequency > 0.0 && uBumpAmplitude > 0.0 && bumpiness > 0.0) {\n normal = perturbNormal(-vViewPosition, normal, fbm(vModelPosition * uBumpFrequency), (uBumpAmplitude * bumpiness) / uBumpFrequency);\n }\n #endif\n\n vec4 color = material;\n\n #if defined(dCelShaded)\n // clamp to avoid artifacts\n metalness = clamp(metalness, 0.0, 0.99);\n roughness = clamp(roughness, 0.05, 1.0);\n #endif\n\n GeometricContext geometry;\n geometry.position = -vViewPosition;\n geometry.normal = normal;\n geometry.viewDir = normalize(vViewPosition);\n\n PhysicalMaterial physicalMaterial;\n physicalMaterial.diffuseColor = color.rgb * (1.0 - metalness);\n #ifdef enabledFragDepth\n physicalMaterial.roughness = min(max(roughness, 0.0525), 1.0);\n #else\n vec3 dxy = max(abs(dFdx(normal)), abs(dFdy(normal)));\n float geometryRoughness = max(max(dxy.x, dxy.y), dxy.z);\n physicalMaterial.roughness = min(max(roughness, 0.0525) + geometryRoughness, 1.0);\n #endif\n physicalMaterial.specularColor = mix(vec3(0.04), color.rgb, metalness);\n physicalMaterial.specularF90 = 1.0;\n\n IncidentLight directLight;\n\n vec3 outgoingLight = vec3(0.0);\n\n #if defined(dCelShaded)\n float celDiffuse;\n float celSpecular;\n float celIntensity;\n\n #pragma unroll_loop_start\n for (int i = 0; i < dLightCount; ++i) {\n directLight.direction = uLightDirection[i];\n directLight.color = uLightColor[i] * PI; // * PI for punctual light\n\n celDiffuse = RECIPROCAL_PI * max(dot(geometry.normal, directLight.direction), 0.0) * (1.0 - metalness);\n celSpecular = luminance(saturate(dot(geometry.normal, directLight.direction)) * BRDF_GGX(directLight.direction, geometry.viewDir, geometry.normal, physicalMaterial.specularColor, physicalMaterial.specularF90, roughness));\n\n celIntensity = celDiffuse + celSpecular;\n celIntensity = ceil(celIntensity * uCelSteps) / uCelSteps;\n\n outgoingLight += color.rgb * directLight.color * celIntensity;\n }\n #pragma unroll_loop_end\n\n outgoingLight += physicalMaterial.diffuseColor * luminance(uAmbientColor);\n #else\n ReflectedLight reflectedLight = ReflectedLight(vec3(0.0), vec3(0.0), vec3(0.0), vec3(0.0));\n\n #pragma unroll_loop_start\n for (int i = 0; i < dLightCount; ++i) {\n directLight.direction = uLightDirection[i];\n directLight.color = uLightColor[i] * PI; // * PI for punctual light\n RE_Direct_Physical(directLight, geometry, physicalMaterial, reflectedLight);\n }\n #pragma unroll_loop_end\n\n vec3 irradiance = uAmbientColor * PI; // * PI for punctual light\n RE_IndirectDiffuse_Physical(irradiance, geometry, physicalMaterial, reflectedLight);\n\n // indirect specular only metals\n vec3 radiance = uAmbientColor * metalness;\n vec3 iblIrradiance = uAmbientColor * metalness;\n vec3 clearcoatRadiance = vec3(0.0);\n RE_IndirectSpecular_Physical(radiance, iblIrradiance, clearcoatRadiance, geometry, physicalMaterial, reflectedLight);\n\n outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular;\n #endif\n outgoingLight = clamp(outgoingLight, 0.01, 0.99); // prevents black artifacts on specular highlight with transparent background\n\n #if defined(dRenderVariant_color)\n outgoingLight += color.rgb * emissive;\n #endif\n\n gl_FragColor = vec4(outgoingLight, color.a);\n#endif\n\n#if defined(dXrayShaded_on)\n gl_FragColor.a *= 1.0 - pow(abs(dot(normal, vec3(0.0, 0.0, 1.0))), uXrayEdgeFalloff);\n#elif defined(dXrayShaded_inverted)\n gl_FragColor.a *= pow(abs(dot(normal, vec3(0.0, 0.0, 1.0))), uXrayEdgeFalloff);\n#endif\n\ngl_FragColor.rgb *= uExposure;\n";
@@ -2,6 +2,7 @@
2
2
  * Copyright (c) 2017-2024 mol* contributors, licensed under MIT, See LICENSE file for more info.
3
3
  *
4
4
  * @author Alexander Rose <alexander.rose@weirdbyte.de>
5
+ * @author Gianluca Tomasello <giagitom@gmail.com>
5
6
  *
6
7
  * adapted from three.js (https://github.com/mrdoob/three.js/)
7
8
  * which under the MIT License, Copyright © 2010-2021 three.js authors
@@ -29,7 +30,16 @@ export const apply_light_color = `
29
30
 
30
31
  vec4 color = material;
31
32
 
32
- ReflectedLight reflectedLight = ReflectedLight(vec3(0.0), vec3(0.0), vec3(0.0), vec3(0.0));
33
+ #if defined(dCelShaded)
34
+ // clamp to avoid artifacts
35
+ metalness = clamp(metalness, 0.0, 0.99);
36
+ roughness = clamp(roughness, 0.05, 1.0);
37
+ #endif
38
+
39
+ GeometricContext geometry;
40
+ geometry.position = -vViewPosition;
41
+ geometry.normal = normal;
42
+ geometry.viewDir = normalize(vViewPosition);
33
43
 
34
44
  PhysicalMaterial physicalMaterial;
35
45
  physicalMaterial.diffuseColor = color.rgb * (1.0 - metalness);
@@ -43,30 +53,53 @@ export const apply_light_color = `
43
53
  physicalMaterial.specularColor = mix(vec3(0.04), color.rgb, metalness);
44
54
  physicalMaterial.specularF90 = 1.0;
45
55
 
46
- GeometricContext geometry;
47
- geometry.position = -vViewPosition;
48
- geometry.normal = normal;
49
- geometry.viewDir = normalize(vViewPosition);
50
-
51
56
  IncidentLight directLight;
52
- #pragma unroll_loop_start
53
- for (int i = 0; i < dLightCount; ++i) {
54
- directLight.direction = uLightDirection[i];
55
- directLight.color = uLightColor[i] * PI; // * PI for punctual light
56
- RE_Direct_Physical(directLight, geometry, physicalMaterial, reflectedLight);
57
- }
58
- #pragma unroll_loop_end
59
-
60
- vec3 irradiance = uAmbientColor * PI; // * PI for punctual light
61
- RE_IndirectDiffuse_Physical(irradiance, geometry, physicalMaterial, reflectedLight);
62
-
63
- // indirect specular only metals
64
- vec3 radiance = uAmbientColor * metalness;
65
- vec3 iblIrradiance = uAmbientColor * metalness;
66
- vec3 clearcoatRadiance = vec3(0.0);
67
- RE_IndirectSpecular_Physical(radiance, iblIrradiance, clearcoatRadiance, geometry, physicalMaterial, reflectedLight);
68
-
69
- vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular;
57
+
58
+ vec3 outgoingLight = vec3(0.0);
59
+
60
+ #if defined(dCelShaded)
61
+ float celDiffuse;
62
+ float celSpecular;
63
+ float celIntensity;
64
+
65
+ #pragma unroll_loop_start
66
+ for (int i = 0; i < dLightCount; ++i) {
67
+ directLight.direction = uLightDirection[i];
68
+ directLight.color = uLightColor[i] * PI; // * PI for punctual light
69
+
70
+ celDiffuse = RECIPROCAL_PI * max(dot(geometry.normal, directLight.direction), 0.0) * (1.0 - metalness);
71
+ celSpecular = luminance(saturate(dot(geometry.normal, directLight.direction)) * BRDF_GGX(directLight.direction, geometry.viewDir, geometry.normal, physicalMaterial.specularColor, physicalMaterial.specularF90, roughness));
72
+
73
+ celIntensity = celDiffuse + celSpecular;
74
+ celIntensity = ceil(celIntensity * uCelSteps) / uCelSteps;
75
+
76
+ outgoingLight += color.rgb * directLight.color * celIntensity;
77
+ }
78
+ #pragma unroll_loop_end
79
+
80
+ outgoingLight += physicalMaterial.diffuseColor * luminance(uAmbientColor);
81
+ #else
82
+ ReflectedLight reflectedLight = ReflectedLight(vec3(0.0), vec3(0.0), vec3(0.0), vec3(0.0));
83
+
84
+ #pragma unroll_loop_start
85
+ for (int i = 0; i < dLightCount; ++i) {
86
+ directLight.direction = uLightDirection[i];
87
+ directLight.color = uLightColor[i] * PI; // * PI for punctual light
88
+ RE_Direct_Physical(directLight, geometry, physicalMaterial, reflectedLight);
89
+ }
90
+ #pragma unroll_loop_end
91
+
92
+ vec3 irradiance = uAmbientColor * PI; // * PI for punctual light
93
+ RE_IndirectDiffuse_Physical(irradiance, geometry, physicalMaterial, reflectedLight);
94
+
95
+ // indirect specular only metals
96
+ vec3 radiance = uAmbientColor * metalness;
97
+ vec3 iblIrradiance = uAmbientColor * metalness;
98
+ vec3 clearcoatRadiance = vec3(0.0);
99
+ RE_IndirectSpecular_Physical(radiance, iblIrradiance, clearcoatRadiance, geometry, physicalMaterial, reflectedLight);
100
+
101
+ outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular;
102
+ #endif
70
103
  outgoingLight = clamp(outgoingLight, 0.01, 0.99); // prevents black artifacts on specular highlight with transparent background
71
104
 
72
105
  #if defined(dRenderVariant_color)
@@ -1 +1 @@
1
- export declare const common_frag_params = "\nuniform int uObjectId;\nuniform int uInstanceCount;\nuniform int uGroupCount;\n\nuniform int uPickType;\nuniform int uMarkingType;\n\nuniform vec4 uCameraPlane;\nuniform vec4 uLod;\n\n#if dClipObjectCount != 0\n uniform int uClipObjectType[dClipObjectCount];\n uniform bool uClipObjectInvert[dClipObjectCount];\n uniform vec3 uClipObjectPosition[dClipObjectCount];\n uniform vec4 uClipObjectRotation[dClipObjectCount];\n uniform vec3 uClipObjectScale[dClipObjectCount];\n\n #if defined(dClipping)\n #if __VERSION__ == 100 || defined(dClippingType_instance) || !defined(dVaryingGroup)\n varying float vClipping;\n #else\n flat in float vClipping;\n #endif\n #endif\n#endif\n\n#if defined(dColorMarker)\n uniform vec3 uHighlightColor;\n uniform vec3 uSelectColor;\n uniform vec3 uDimColor;\n uniform float uHighlightStrength;\n uniform float uSelectStrength;\n uniform float uDimStrength;\n uniform int uMarkerPriority;\n uniform float uMarkerAverage;\n#endif\n\n#if defined(dNeedsMarker)\n uniform float uMarker;\n #if __VERSION__ == 100 || defined(dMarkerType_instance) || !defined(dVaryingGroup)\n varying float vMarker;\n #else\n flat in float vMarker;\n #endif\n#endif\n\n#if defined(dRenderVariant_colorDpoit)\n #define MAX_DPOIT_DEPTH 99999.0 // NOTE constant also set in TypeScript\n uniform sampler2D tDpoitDepth;\n uniform sampler2D tDpoitFrontColor;\n#endif\n\nvarying vec3 vModelPosition;\nvarying vec3 vViewPosition;\n\nuniform vec2 uViewOffset;\n\nuniform float uNear;\nuniform float uFar;\nuniform float uIsOrtho;\n\nuniform bool uFog;\nuniform float uFogNear;\nuniform float uFogFar;\nuniform vec3 uFogColor;\n\nuniform float uAlpha;\nuniform float uPickingAlphaThreshold;\nuniform bool uTransparentBackground;\n\nuniform bool uDoubleSided;\nuniform float uInteriorDarkening;\nuniform bool uInteriorColorFlag;\nuniform vec3 uInteriorColor;\nbool interior;\n\nuniform float uXrayEdgeFalloff;\nuniform float uExposure;\n\nuniform mat4 uProjection;\n\nuniform int uRenderMask;\nuniform bool uMarkingDepthTest;\n\nuniform sampler2D tDepth;\nuniform vec2 uDrawingBufferSize;\n\nfloat getDepthPacked(const in vec2 coords) {\n return unpackRGBAToDepth(texture2D(tDepth, coords));\n}\n\nfloat getDepth(const in vec2 coords) {\n #ifdef depthTextureSupport\n return texture2D(tDepth, coords).r;\n #else\n return unpackRGBAToDepth(texture2D(tDepth, coords));\n #endif\n}\n\nfloat calcDepth(const in vec3 pos) {\n vec2 clipZW = pos.z * uProjection[2].zw + uProjection[3].zw;\n return 0.5 + 0.5 * clipZW.x / clipZW.y;\n}\n\n// \"Bump Mapping Unparametrized Surfaces on the GPU\" Morten S. Mikkelsen\n// https://mmikk.github.io/papers3d/mm_sfgrad_bump.pdf\nvec3 perturbNormal(in vec3 position, in vec3 normal, in float height, in float scale) {\n vec3 sigmaS = dFdx(position);\n vec3 sigmaT = dFdy(position);\n\n vec3 r1 = cross(sigmaT, normal);\n vec3 r2 = cross(normal, sigmaS);\n float det = dot(sigmaS, r1);\n if (det == 0.0) return normal;\n\n float bs = dFdx(height);\n float bt = dFdy(height);\n\n vec3 surfGrad = sign(det) * (bs * r1 + bt * r2);\n return normalize(abs(det) * normal - scale * surfGrad);\n}\n\nfloat hash(in float h) {\n return fract(sin(h) * 43758.5453123);\n}\n\nfloat noise(in vec3 x) {\n vec3 p = floor(x);\n vec3 f = fract(x);\n f = f * f * (3.0 - 2.0 * f);\n\n float n = p.x + p.y * 157.0 + 113.0 * p.z;\n return mix(\n mix(mix(hash(n + 0.0), hash(n + 1.0), f.x),\n mix(hash(n + 157.0), hash(n + 158.0), f.x), f.y),\n mix(mix(hash(n + 113.0), hash(n + 114.0), f.x),\n mix(hash(n + 270.0), hash(n + 271.0), f.x), f.y), f.z);\n}\n\nfloat fbm(in vec3 p) {\n float f = 0.0;\n f += 0.5 * noise(p);\n p *= 2.01;\n f += 0.25 * noise(p);\n p *= 2.02;\n f += 0.125 * noise(p);\n\n return f;\n}\n";
1
+ export declare const common_frag_params = "\nuniform int uObjectId;\nuniform int uInstanceCount;\nuniform int uGroupCount;\n\nuniform int uPickType;\nuniform int uMarkingType;\n\nuniform vec4 uCameraPlane;\nuniform vec4 uLod;\n\n#if dClipObjectCount != 0\n uniform int uClipObjectType[dClipObjectCount];\n uniform bool uClipObjectInvert[dClipObjectCount];\n uniform vec3 uClipObjectPosition[dClipObjectCount];\n uniform vec4 uClipObjectRotation[dClipObjectCount];\n uniform vec3 uClipObjectScale[dClipObjectCount];\n\n #if defined(dClipping)\n #if __VERSION__ == 100 || defined(dClippingType_instance) || !defined(dVaryingGroup)\n varying float vClipping;\n #else\n flat in float vClipping;\n #endif\n #endif\n#endif\n\n#if defined(dColorMarker)\n uniform vec3 uHighlightColor;\n uniform vec3 uSelectColor;\n uniform vec3 uDimColor;\n uniform float uHighlightStrength;\n uniform float uSelectStrength;\n uniform float uDimStrength;\n uniform int uMarkerPriority;\n uniform float uMarkerAverage;\n#endif\n\n#if defined(dNeedsMarker)\n uniform float uMarker;\n #if __VERSION__ == 100 || defined(dMarkerType_instance) || !defined(dVaryingGroup)\n varying float vMarker;\n #else\n flat in float vMarker;\n #endif\n#endif\n\n#if defined(dRenderVariant_colorDpoit)\n #define MAX_DPOIT_DEPTH 99999.0 // NOTE constant also set in TypeScript\n uniform sampler2D tDpoitDepth;\n uniform sampler2D tDpoitFrontColor;\n#endif\n\nvarying vec3 vModelPosition;\nvarying vec3 vViewPosition;\n\nuniform vec2 uViewOffset;\n\nuniform float uNear;\nuniform float uFar;\nuniform float uIsOrtho;\n\nuniform bool uFog;\nuniform float uFogNear;\nuniform float uFogFar;\nuniform vec3 uFogColor;\n\nuniform float uAlpha;\nuniform float uPickingAlphaThreshold;\nuniform bool uTransparentBackground;\n\nuniform bool uDoubleSided;\nuniform float uInteriorDarkening;\nuniform bool uInteriorColorFlag;\nuniform vec3 uInteriorColor;\nbool interior;\n\nuniform float uXrayEdgeFalloff;\nuniform float uCelSteps;\nuniform float uExposure;\n\nuniform mat4 uProjection;\n\nuniform int uRenderMask;\nuniform bool uMarkingDepthTest;\n\nuniform sampler2D tDepth;\nuniform vec2 uDrawingBufferSize;\n\nfloat getDepthPacked(const in vec2 coords) {\n return unpackRGBAToDepth(texture2D(tDepth, coords));\n}\n\nfloat getDepth(const in vec2 coords) {\n #ifdef depthTextureSupport\n return texture2D(tDepth, coords).r;\n #else\n return unpackRGBAToDepth(texture2D(tDepth, coords));\n #endif\n}\n\nfloat calcDepth(const in vec3 pos) {\n vec2 clipZW = pos.z * uProjection[2].zw + uProjection[3].zw;\n return 0.5 + 0.5 * clipZW.x / clipZW.y;\n}\n\n// \"Bump Mapping Unparametrized Surfaces on the GPU\" Morten S. Mikkelsen\n// https://mmikk.github.io/papers3d/mm_sfgrad_bump.pdf\nvec3 perturbNormal(in vec3 position, in vec3 normal, in float height, in float scale) {\n vec3 sigmaS = dFdx(position);\n vec3 sigmaT = dFdy(position);\n\n vec3 r1 = cross(sigmaT, normal);\n vec3 r2 = cross(normal, sigmaS);\n float det = dot(sigmaS, r1);\n if (det == 0.0) return normal;\n\n float bs = dFdx(height);\n float bt = dFdy(height);\n\n vec3 surfGrad = sign(det) * (bs * r1 + bt * r2);\n return normalize(abs(det) * normal - scale * surfGrad);\n}\n\nfloat hash(in float h) {\n return fract(sin(h) * 43758.5453123);\n}\n\nfloat noise(in vec3 x) {\n vec3 p = floor(x);\n vec3 f = fract(x);\n f = f * f * (3.0 - 2.0 * f);\n\n float n = p.x + p.y * 157.0 + 113.0 * p.z;\n return mix(\n mix(mix(hash(n + 0.0), hash(n + 1.0), f.x),\n mix(hash(n + 157.0), hash(n + 158.0), f.x), f.y),\n mix(mix(hash(n + 113.0), hash(n + 114.0), f.x),\n mix(hash(n + 270.0), hash(n + 271.0), f.x), f.y), f.z);\n}\n\nfloat fbm(in vec3 p) {\n float f = 0.0;\n f += 0.5 * noise(p);\n p *= 2.01;\n f += 0.25 * noise(p);\n p *= 2.02;\n f += 0.125 * noise(p);\n\n return f;\n}\n";
@@ -76,6 +76,7 @@ uniform vec3 uInteriorColor;
76
76
  bool interior;
77
77
 
78
78
  uniform float uXrayEdgeFalloff;
79
+ uniform float uCelSteps;
79
80
  uniform float uExposure;
80
81
 
81
82
  uniform mat4 uProjection;
@@ -1 +1 @@
1
- export declare const common = "\n// TODO find a better place for these convenience defines\n\n#if defined(dRenderVariant_colorBlended) || defined(dRenderVariant_colorWboit) || defined(dRenderVariant_colorDpoit)\n #define dRenderVariant_color\n#endif\n\n#if defined(dColorType_instance) || defined(dColorType_group) || defined(dColorType_groupInstance) || defined(dColorType_vertex) || defined(dColorType_vertexInstance)\n #define dColorType_texture\n#endif\n\n#if defined(dColorType_volume) || defined(dColorType_volumeInstance)\n #define dColorType_grid\n#endif\n\n#if defined(dColorType_attribute) || defined(dColorType_texture) || defined(dColorType_grid)\n #define dColorType_varying\n#endif\n\n#if (defined(dRenderVariant_color) && defined(dColorMarker)) || defined(dRenderVariant_marking)\n #define dNeedsMarker\n#endif\n\n#if defined(dXrayShaded_on) || defined(dXrayShaded_inverted)\n #define dXrayShaded\n#endif\n\n#define MaskAll 0\n#define MaskOpaque 1\n#define MaskTransparent 2\n\n//\n\n#define PI 3.14159265\n#define RECIPROCAL_PI 0.31830988618\n#define EPSILON 1e-6\n\n#define saturate(a) clamp(a, 0.0, 1.0)\n\n#if __VERSION__ == 100\n #define round(x) floor((x) + 0.5)\n#endif\n\nfloat intDiv(const in float a, const in float b) { return float(int(a) / int(b)); }\nvec2 ivec2Div(const in vec2 a, const in vec2 b) { return vec2(ivec2(a) / ivec2(b)); }\nfloat intMod(const in float a, const in float b) { return a - b * float(int(a) / int(b)); }\nint imod(const in int a, const in int b) { return a - b * (a / b); }\n\nfloat pow2(const in float x) { return x * x; }\n\nvec3 packIntToRGB(in float value) {\n value = clamp(round(value), 0.0, 16777216.0 - 1.0) + 1.0;\n vec3 c = vec3(0.0);\n c.b = mod(value, 256.0);\n value = floor(value / 256.0);\n c.g = mod(value, 256.0);\n value = floor(value / 256.0);\n c.r = mod(value, 256.0);\n return c / 255.0;\n}\nfloat unpackRGBToInt(const in vec3 rgb) {\n return (floor(rgb.r * 255.0 + 0.5) * 256.0 * 256.0 + floor(rgb.g * 255.0 + 0.5) * 256.0 + floor(rgb.b * 255.0 + 0.5)) - 1.0;\n}\n\nvec2 packUnitIntervalToRG(const in float v) {\n vec2 enc;\n enc.xy = vec2(fract(v * 256.0), v);\n enc.y -= enc.x * (1.0 / 256.0);\n enc.xy *= 256.0 / 255.0;\n\n return enc;\n}\n\nfloat unpackRGToUnitInterval(const in vec2 enc) {\n return dot(enc, vec2(255.0 / (256.0 * 256.0), 255.0 / 256.0));\n}\n\nvec3 screenSpaceToViewSpace(const in vec3 ssPos, const in mat4 invProjection) {\n vec4 p = vec4(ssPos * 2.0 - 1.0, 1.0);\n p = invProjection * p;\n return p.xyz / p.w;\n}\n\nconst float PackUpscale = 256.0 / 255.0; // fraction -> 0..1 (including 1)\nconst float UnpackDownscale = 255.0 / 256.0; // 0..1 -> fraction (excluding 1)\nconst vec3 PackFactors = vec3(256.0 * 256.0 * 256.0, 256.0 * 256.0, 256.0);\nconst vec4 UnpackFactors = UnpackDownscale / vec4(PackFactors, 1.0);\nconst float ShiftRight8 = 1.0 / 256.0;\n\nvec4 packDepthToRGBA(const in float v) {\n vec4 r = vec4(fract(v * PackFactors), v);\n r.yzw -= r.xyz * ShiftRight8; // tidy overflow\n return r * PackUpscale;\n}\nfloat unpackRGBAToDepth(const in vec4 v) {\n return dot(v, UnpackFactors);\n}\n\nvec4 sRGBToLinear(const in vec4 c) {\n return vec4(mix(pow(c.rgb * 0.9478672986 + vec3(0.0521327014), vec3(2.4)), c.rgb * 0.0773993808, vec3(lessThanEqual(c.rgb, vec3(0.04045)))), c.a);\n}\nvec4 linearTosRGB(const in vec4 c) {\n return vec4(mix(pow(c.rgb, vec3(0.41666)) * 1.055 - vec3(0.055), c.rgb * 12.92, vec3(lessThanEqual(c.rgb, vec3(0.0031308)))), c.a);\n}\n\nfloat linearizeDepth(const in float depth, const in float near, const in float far) {\n return (2.0 * near) / (far + near - depth * (far - near));\n}\n\nfloat perspectiveDepthToViewZ(const in float invClipZ, const in float near, const in float far) {\n return (near * far) / ((far - near) * invClipZ - far);\n}\n\nfloat orthographicDepthToViewZ(const in float linearClipZ, const in float near, const in float far) {\n return linearClipZ * (near - far) - near;\n}\n\nfloat depthToViewZ(const in float isOrtho, const in float linearClipZ, const in float near, const in float far) {\n return isOrtho == 1.0 ? orthographicDepthToViewZ(linearClipZ, near, far) : perspectiveDepthToViewZ(linearClipZ, near, far);\n}\n\n#if __VERSION__ == 100\n // transpose\n\n float transpose(const in float m) {\n return m;\n }\n\n mat2 transpose2(const in mat2 m) {\n return mat2(\n m[0][0], m[1][0],\n m[0][1], m[1][1]\n );\n }\n\n mat3 transpose3(const in mat3 m) {\n return mat3(\n m[0][0], m[1][0], m[2][0],\n m[0][1], m[1][1], m[2][1],\n m[0][2], m[1][2], m[2][2]\n );\n }\n\n mat4 transpose4(const in mat4 m) {\n return mat4(\n m[0][0], m[1][0], m[2][0], m[3][0],\n m[0][1], m[1][1], m[2][1], m[3][1],\n m[0][2], m[1][2], m[2][2], m[3][2],\n m[0][3], m[1][3], m[2][3], m[3][3]\n );\n }\n\n // inverse\n\n float inverse(const in float m) {\n return 1.0 / m;\n }\n\n mat2 inverse2(const in mat2 m) {\n return mat2(m[1][1],-m[0][1],\n -m[1][0], m[0][0]) / (m[0][0]*m[1][1] - m[0][1]*m[1][0]);\n }\n\n mat3 inverse3(const in mat3 m) {\n float a00 = m[0][0], a01 = m[0][1], a02 = m[0][2];\n float a10 = m[1][0], a11 = m[1][1], a12 = m[1][2];\n float a20 = m[2][0], a21 = m[2][1], a22 = m[2][2];\n\n float b01 = a22 * a11 - a12 * a21;\n float b11 = -a22 * a10 + a12 * a20;\n float b21 = a21 * a10 - a11 * a20;\n\n float det = a00 * b01 + a01 * b11 + a02 * b21;\n\n return mat3(b01, (-a22 * a01 + a02 * a21), (a12 * a01 - a02 * a11),\n b11, (a22 * a00 - a02 * a20), (-a12 * a00 + a02 * a10),\n b21, (-a21 * a00 + a01 * a20), (a11 * a00 - a01 * a10)) / det;\n }\n\n mat4 inverse4(const in mat4 m) {\n float\n a00 = m[0][0], a01 = m[0][1], a02 = m[0][2], a03 = m[0][3],\n a10 = m[1][0], a11 = m[1][1], a12 = m[1][2], a13 = m[1][3],\n a20 = m[2][0], a21 = m[2][1], a22 = m[2][2], a23 = m[2][3],\n a30 = m[3][0], a31 = m[3][1], a32 = m[3][2], a33 = m[3][3],\n\n b00 = a00 * a11 - a01 * a10,\n b01 = a00 * a12 - a02 * a10,\n b02 = a00 * a13 - a03 * a10,\n b03 = a01 * a12 - a02 * a11,\n b04 = a01 * a13 - a03 * a11,\n b05 = a02 * a13 - a03 * a12,\n b06 = a20 * a31 - a21 * a30,\n b07 = a20 * a32 - a22 * a30,\n b08 = a20 * a33 - a23 * a30,\n b09 = a21 * a32 - a22 * a31,\n b10 = a21 * a33 - a23 * a31,\n b11 = a22 * a33 - a23 * a32,\n\n det = b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06;\n\n return mat4(\n a11 * b11 - a12 * b10 + a13 * b09,\n a02 * b10 - a01 * b11 - a03 * b09,\n a31 * b05 - a32 * b04 + a33 * b03,\n a22 * b04 - a21 * b05 - a23 * b03,\n a12 * b08 - a10 * b11 - a13 * b07,\n a00 * b11 - a02 * b08 + a03 * b07,\n a32 * b02 - a30 * b05 - a33 * b01,\n a20 * b05 - a22 * b02 + a23 * b01,\n a10 * b10 - a11 * b08 + a13 * b06,\n a01 * b08 - a00 * b10 - a03 * b06,\n a30 * b04 - a31 * b02 + a33 * b00,\n a21 * b02 - a20 * b04 - a23 * b00,\n a11 * b07 - a10 * b09 - a12 * b06,\n a00 * b09 - a01 * b07 + a02 * b06,\n a31 * b01 - a30 * b03 - a32 * b00,\n a20 * b03 - a21 * b01 + a22 * b00) / det;\n }\n\n #define isNaN(x) ((x) != (x))\n #define isInf(x) ((x) == (x) + 1.0)\n#else\n #define transpose2(m) transpose(m)\n #define transpose3(m) transpose(m)\n #define transpose4(m) transpose(m)\n\n #define inverse2(m) inverse(m)\n #define inverse3(m) inverse(m)\n #define inverse4(m) inverse(m)\n\n #define isNaN isnan\n #define isInf isinf\n#endif\n";
1
+ export declare const common = "\n// TODO find a better place for these convenience defines\n\n#if defined(dRenderVariant_colorBlended) || defined(dRenderVariant_colorWboit) || defined(dRenderVariant_colorDpoit)\n #define dRenderVariant_color\n#endif\n\n#if defined(dColorType_instance) || defined(dColorType_group) || defined(dColorType_groupInstance) || defined(dColorType_vertex) || defined(dColorType_vertexInstance)\n #define dColorType_texture\n#endif\n\n#if defined(dColorType_volume) || defined(dColorType_volumeInstance)\n #define dColorType_grid\n#endif\n\n#if defined(dColorType_attribute) || defined(dColorType_texture) || defined(dColorType_grid)\n #define dColorType_varying\n#endif\n\n#if (defined(dRenderVariant_color) && defined(dColorMarker)) || defined(dRenderVariant_marking)\n #define dNeedsMarker\n#endif\n\n#if defined(dXrayShaded_on) || defined(dXrayShaded_inverted)\n #define dXrayShaded\n#endif\n\n#define MaskAll 0\n#define MaskOpaque 1\n#define MaskTransparent 2\n\n//\n\n#define PI 3.14159265\n#define RECIPROCAL_PI 0.31830988618\n#define EPSILON 1e-6\n\n#define saturate(a) clamp(a, 0.0, 1.0)\n\n#if __VERSION__ == 100\n #define round(x) floor((x) + 0.5)\n#endif\n\nfloat intDiv(const in float a, const in float b) { return float(int(a) / int(b)); }\nvec2 ivec2Div(const in vec2 a, const in vec2 b) { return vec2(ivec2(a) / ivec2(b)); }\nfloat intMod(const in float a, const in float b) { return a - b * float(int(a) / int(b)); }\nint imod(const in int a, const in int b) { return a - b * (a / b); }\n\nfloat pow2(const in float x) { return x * x; }\n\nvec3 packIntToRGB(in float value) {\n value = clamp(round(value), 0.0, 16777216.0 - 1.0) + 1.0;\n vec3 c = vec3(0.0);\n c.b = mod(value, 256.0);\n value = floor(value / 256.0);\n c.g = mod(value, 256.0);\n value = floor(value / 256.0);\n c.r = mod(value, 256.0);\n return c / 255.0;\n}\nfloat unpackRGBToInt(const in vec3 rgb) {\n return (floor(rgb.r * 255.0 + 0.5) * 256.0 * 256.0 + floor(rgb.g * 255.0 + 0.5) * 256.0 + floor(rgb.b * 255.0 + 0.5)) - 1.0;\n}\n\nvec2 packUnitIntervalToRG(const in float v) {\n vec2 enc;\n enc.xy = vec2(fract(v * 256.0), v);\n enc.y -= enc.x * (1.0 / 256.0);\n enc.xy *= 256.0 / 255.0;\n\n return enc;\n}\n\nfloat unpackRGToUnitInterval(const in vec2 enc) {\n return dot(enc, vec2(255.0 / (256.0 * 256.0), 255.0 / 256.0));\n}\n\nvec3 screenSpaceToViewSpace(const in vec3 ssPos, const in mat4 invProjection) {\n vec4 p = vec4(ssPos * 2.0 - 1.0, 1.0);\n p = invProjection * p;\n return p.xyz / p.w;\n}\n\nconst float PackUpscale = 256.0 / 255.0; // fraction -> 0..1 (including 1)\nconst float UnpackDownscale = 255.0 / 256.0; // 0..1 -> fraction (excluding 1)\nconst vec3 PackFactors = vec3(256.0 * 256.0 * 256.0, 256.0 * 256.0, 256.0);\nconst vec4 UnpackFactors = UnpackDownscale / vec4(PackFactors, 1.0);\nconst float ShiftRight8 = 1.0 / 256.0;\n\nvec4 packDepthToRGBA(const in float v) {\n vec4 r = vec4(fract(v * PackFactors), v);\n r.yzw -= r.xyz * ShiftRight8; // tidy overflow\n return r * PackUpscale;\n}\nfloat unpackRGBAToDepth(const in vec4 v) {\n return dot(v, UnpackFactors);\n}\n\nvec4 sRGBToLinear(const in vec4 c) {\n return vec4(mix(pow(c.rgb * 0.9478672986 + vec3(0.0521327014), vec3(2.4)), c.rgb * 0.0773993808, vec3(lessThanEqual(c.rgb, vec3(0.04045)))), c.a);\n}\nvec4 linearTosRGB(const in vec4 c) {\n return vec4(mix(pow(c.rgb, vec3(0.41666)) * 1.055 - vec3(0.055), c.rgb * 12.92, vec3(lessThanEqual(c.rgb, vec3(0.0031308)))), c.a);\n}\n\nfloat luminance(vec3 c) {\n // https://www.w3.org/TR/WCAG21/#dfn-relative-luminance\n const vec3 W = vec3(0.2125, 0.7154, 0.0721);\n return dot(c, W);\n}\n\nfloat linearizeDepth(const in float depth, const in float near, const in float far) {\n return (2.0 * near) / (far + near - depth * (far - near));\n}\n\nfloat perspectiveDepthToViewZ(const in float invClipZ, const in float near, const in float far) {\n return (near * far) / ((far - near) * invClipZ - far);\n}\n\nfloat orthographicDepthToViewZ(const in float linearClipZ, const in float near, const in float far) {\n return linearClipZ * (near - far) - near;\n}\n\nfloat depthToViewZ(const in float isOrtho, const in float linearClipZ, const in float near, const in float far) {\n return isOrtho == 1.0 ? orthographicDepthToViewZ(linearClipZ, near, far) : perspectiveDepthToViewZ(linearClipZ, near, far);\n}\n\n#if __VERSION__ == 100\n // transpose\n\n float transpose(const in float m) {\n return m;\n }\n\n mat2 transpose2(const in mat2 m) {\n return mat2(\n m[0][0], m[1][0],\n m[0][1], m[1][1]\n );\n }\n\n mat3 transpose3(const in mat3 m) {\n return mat3(\n m[0][0], m[1][0], m[2][0],\n m[0][1], m[1][1], m[2][1],\n m[0][2], m[1][2], m[2][2]\n );\n }\n\n mat4 transpose4(const in mat4 m) {\n return mat4(\n m[0][0], m[1][0], m[2][0], m[3][0],\n m[0][1], m[1][1], m[2][1], m[3][1],\n m[0][2], m[1][2], m[2][2], m[3][2],\n m[0][3], m[1][3], m[2][3], m[3][3]\n );\n }\n\n // inverse\n\n float inverse(const in float m) {\n return 1.0 / m;\n }\n\n mat2 inverse2(const in mat2 m) {\n return mat2(m[1][1],-m[0][1],\n -m[1][0], m[0][0]) / (m[0][0]*m[1][1] - m[0][1]*m[1][0]);\n }\n\n mat3 inverse3(const in mat3 m) {\n float a00 = m[0][0], a01 = m[0][1], a02 = m[0][2];\n float a10 = m[1][0], a11 = m[1][1], a12 = m[1][2];\n float a20 = m[2][0], a21 = m[2][1], a22 = m[2][2];\n\n float b01 = a22 * a11 - a12 * a21;\n float b11 = -a22 * a10 + a12 * a20;\n float b21 = a21 * a10 - a11 * a20;\n\n float det = a00 * b01 + a01 * b11 + a02 * b21;\n\n return mat3(b01, (-a22 * a01 + a02 * a21), (a12 * a01 - a02 * a11),\n b11, (a22 * a00 - a02 * a20), (-a12 * a00 + a02 * a10),\n b21, (-a21 * a00 + a01 * a20), (a11 * a00 - a01 * a10)) / det;\n }\n\n mat4 inverse4(const in mat4 m) {\n float\n a00 = m[0][0], a01 = m[0][1], a02 = m[0][2], a03 = m[0][3],\n a10 = m[1][0], a11 = m[1][1], a12 = m[1][2], a13 = m[1][3],\n a20 = m[2][0], a21 = m[2][1], a22 = m[2][2], a23 = m[2][3],\n a30 = m[3][0], a31 = m[3][1], a32 = m[3][2], a33 = m[3][3],\n\n b00 = a00 * a11 - a01 * a10,\n b01 = a00 * a12 - a02 * a10,\n b02 = a00 * a13 - a03 * a10,\n b03 = a01 * a12 - a02 * a11,\n b04 = a01 * a13 - a03 * a11,\n b05 = a02 * a13 - a03 * a12,\n b06 = a20 * a31 - a21 * a30,\n b07 = a20 * a32 - a22 * a30,\n b08 = a20 * a33 - a23 * a30,\n b09 = a21 * a32 - a22 * a31,\n b10 = a21 * a33 - a23 * a31,\n b11 = a22 * a33 - a23 * a32,\n\n det = b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06;\n\n return mat4(\n a11 * b11 - a12 * b10 + a13 * b09,\n a02 * b10 - a01 * b11 - a03 * b09,\n a31 * b05 - a32 * b04 + a33 * b03,\n a22 * b04 - a21 * b05 - a23 * b03,\n a12 * b08 - a10 * b11 - a13 * b07,\n a00 * b11 - a02 * b08 + a03 * b07,\n a32 * b02 - a30 * b05 - a33 * b01,\n a20 * b05 - a22 * b02 + a23 * b01,\n a10 * b10 - a11 * b08 + a13 * b06,\n a01 * b08 - a00 * b10 - a03 * b06,\n a30 * b04 - a31 * b02 + a33 * b00,\n a21 * b02 - a20 * b04 - a23 * b00,\n a11 * b07 - a10 * b09 - a12 * b06,\n a00 * b09 - a01 * b07 + a02 * b06,\n a31 * b01 - a30 * b03 - a32 * b00,\n a20 * b03 - a21 * b01 + a22 * b00) / det;\n }\n\n #define isNaN(x) ((x) != (x))\n #define isInf(x) ((x) == (x) + 1.0)\n#else\n #define transpose2(m) transpose(m)\n #define transpose3(m) transpose(m)\n #define transpose4(m) transpose(m)\n\n #define inverse2(m) inverse(m)\n #define inverse3(m) inverse(m)\n #define inverse4(m) inverse(m)\n\n #define isNaN isnan\n #define isInf isinf\n#endif\n";
@@ -103,6 +103,12 @@ vec4 linearTosRGB(const in vec4 c) {
103
103
  return vec4(mix(pow(c.rgb, vec3(0.41666)) * 1.055 - vec3(0.055), c.rgb * 12.92, vec3(lessThanEqual(c.rgb, vec3(0.0031308)))), c.a);
104
104
  }
105
105
 
106
+ float luminance(vec3 c) {
107
+ // https://www.w3.org/TR/WCAG21/#dfn-relative-luminance
108
+ const vec3 W = vec3(0.2125, 0.7154, 0.0721);
109
+ return dot(c, W);
110
+ }
111
+
106
112
  float linearizeDepth(const in float depth, const in float near, const in float far) {
107
113
  return (2.0 * near) / (far + near - depth * (far - near));
108
114
  }
@@ -2,5 +2,6 @@
2
2
  * Copyright (c) 2020-2024 mol* contributors, licensed under MIT, See LICENSE file for more info.
3
3
  *
4
4
  * @author Alexander Rose <alexander.rose@weirdbyte.de>
5
+ * @author Gianluca Tomasello <giagitom@gmail.com>
5
6
  */
6
- export declare const cylinders_frag = "\nprecision highp float;\nprecision highp int;\n\n#define bumpEnabled\n\nuniform mat4 uView;\n\nvarying mat4 vTransform;\nvarying vec3 vStart;\nvarying vec3 vEnd;\nvarying float vSize;\nvarying float vCap;\n\nuniform vec3 uCameraDir;\nuniform vec3 uCameraPosition;\nuniform mat4 uInvView;\n\n#include common\n#include common_frag_params\n#include color_frag_params\n#include light_frag_params\n#include common_clip\n\n#ifdef dSolidInterior\n const bool solidInterior = true;\n#else\n const bool solidInterior = false;\n#endif\n\n// adapted from https://www.shadertoy.com/view/4lcSRn\n// The MIT License, Copyright 2016 Inigo Quilez\nbool CylinderImpostor(\n in vec3 rayOrigin, in vec3 rayDir,\n in vec3 start, in vec3 end, in float radius,\n out vec3 cameraNormal, out bool interior,\n out vec3 modelPosition, out vec3 viewPosition, out float fragmentDepth\n){\n vec3 ba = end - start;\n vec3 oc = rayOrigin - start;\n\n float baba = dot(ba, ba);\n float bard = dot(ba, rayDir);\n float baoc = dot(ba, oc);\n\n float k2 = baba - bard * bard;\n float k1 = baba * dot(oc, rayDir) - baoc * bard;\n float k0 = baba * dot(oc, oc) - baoc * baoc - radius * radius * baba;\n\n float h = k1 * k1 - k2 * k0;\n if (h < 0.0) return false;\n\n bool topCap = (vCap > 0.9 && vCap < 1.1) || vCap >= 2.9;\n bool bottomCap = (vCap > 1.9 && vCap < 2.1) || vCap >= 2.9;\n\n #ifdef dSolidInterior\n bool topInterior = !topCap;\n bool bottomInterior = !bottomCap;\n topCap = true;\n bottomCap = true;\n #else\n bool topInterior = false;\n bool bottomInterior = false;\n #endif\n\n bool clipped = false;\n bool objectClipped = false;\n\n // body outside\n h = sqrt(h);\n float t = (-k1 - h) / k2;\n float y = baoc + t * bard;\n if (y > 0.0 && y < baba) {\n interior = false;\n cameraNormal = (oc + t * rayDir - ba * y / baba) / radius;\n modelPosition = rayOrigin + t * rayDir;\n viewPosition = (uView * vec4(modelPosition, 1.0)).xyz;\n fragmentDepth = calcDepth(viewPosition);\n #if defined(dClipVariant_pixel) && dClipObjectCount != 0\n if (clipTest(vec4(modelPosition, 0.0))) {\n objectClipped = true;\n fragmentDepth = -1.0;\n #ifdef dSolidInterior\n topCap = !topInterior;\n bottomCap = !bottomInterior;\n #endif\n }\n #endif\n if (fragmentDepth > 0.0) return true;\n clipped = true;\n }\n\n if (!clipped) {\n if (topCap && y < 0.0) {\n // top cap\n t = -baoc / bard;\n if (abs(k1 + k2 * t) < h) {\n interior = topInterior;\n cameraNormal = -ba / baba;\n modelPosition = rayOrigin + t * rayDir;\n viewPosition = (uView * vec4(modelPosition, 1.0)).xyz;\n fragmentDepth = calcDepth(viewPosition);\n #if defined(dClipVariant_pixel) && dClipObjectCount != 0\n if (clipTest(vec4(modelPosition, 0.0))) {\n objectClipped = true;\n fragmentDepth = -1.0;\n #ifdef dSolidInterior\n topCap = !topInterior;\n bottomCap = !bottomInterior;\n #endif\n }\n #endif\n if (fragmentDepth > 0.0) {\n #ifdef dSolidInterior\n if (interior) cameraNormal = -rayDir;\n #endif\n return true;\n }\n }\n } else if (bottomCap && y >= 0.0) {\n // bottom cap\n t = (baba - baoc) / bard;\n if (abs(k1 + k2 * t) < h) {\n interior = bottomInterior;\n cameraNormal = ba / baba;\n modelPosition = rayOrigin + t * rayDir;\n viewPosition = (uView * vec4(modelPosition, 1.0)).xyz;\n fragmentDepth = calcDepth(viewPosition);\n #if defined(dClipVariant_pixel) && dClipObjectCount != 0\n if (clipTest(vec4(modelPosition, 0.0))) {\n objectClipped = true;\n fragmentDepth = -1.0;\n #ifdef dSolidInterior\n topCap = !topInterior;\n bottomCap = !bottomInterior;\n #endif\n }\n #endif\n if (fragmentDepth > 0.0) {\n #ifdef dSolidInterior\n if (interior) cameraNormal = -rayDir;\n #endif\n return true;\n }\n }\n }\n }\n\n if (uDoubleSided || solidInterior) {\n // body inside\n h = -h;\n t = (-k1 - h) / k2;\n y = baoc + t * bard;\n if (y > 0.0 && y < baba) {\n interior = true;\n cameraNormal = -(oc + t * rayDir - ba * y / baba) / radius;\n modelPosition = rayOrigin + t * rayDir;\n viewPosition = (uView * vec4(modelPosition, 1.0)).xyz;\n fragmentDepth = calcDepth(viewPosition);\n if (fragmentDepth > 0.0) {\n #ifdef dSolidInterior\n if (!objectClipped) {\n fragmentDepth = 0.0 + (0.0000002 / vSize);\n cameraNormal = -rayDir;\n }\n #endif\n return true;\n }\n }\n\n if (topCap && y < 0.0) {\n // top cap\n t = -baoc / bard;\n if (abs(k1 + k2 * t) < -h) {\n interior = true;\n cameraNormal = ba / baba;\n modelPosition = rayOrigin + t * rayDir;\n viewPosition = (uView * vec4(modelPosition, 1.0)).xyz;\n fragmentDepth = calcDepth(viewPosition);\n if (fragmentDepth > 0.0) {\n #ifdef dSolidInterior\n if (!objectClipped) {\n fragmentDepth = 0.0 + (0.0000002 / vSize);\n cameraNormal = -rayDir;\n }\n #endif\n return true;\n }\n }\n } else if (bottomCap && y >= 0.0) {\n // bottom cap\n t = (baba - baoc) / bard;\n if (abs(k1 + k2 * t) < -h) {\n interior = true;\n cameraNormal = -ba / baba;\n modelPosition = rayOrigin + t * rayDir;\n viewPosition = (uView * vec4(modelPosition, 1.0)).xyz;\n fragmentDepth = calcDepth(viewPosition);\n if (fragmentDepth > 0.0) {\n #ifdef dSolidInterior\n if (!objectClipped) {\n fragmentDepth = 0.0 + (0.0000002 / vSize);\n cameraNormal = -rayDir;\n }\n #endif\n return true;\n }\n }\n }\n }\n\n return false;\n}\n\nvoid main() {\n vec3 rayOrigin = vModelPosition;\n vec3 rayDir = mix(normalize(vModelPosition - uCameraPosition), uCameraDir, uIsOrtho);\n\n vec3 cameraNormal;\n vec3 modelPosition;\n vec3 viewPosition;\n float fragmentDepth;\n bool hit = CylinderImpostor(rayOrigin, rayDir, vStart, vEnd, vSize, cameraNormal, interior, modelPosition, viewPosition, fragmentDepth);\n if (!hit) discard;\n\n if (fragmentDepth < 0.0) discard;\n if (fragmentDepth > 1.0) discard;\n\n gl_FragDepthEXT = fragmentDepth;\n\n vec3 vViewPosition = viewPosition;\n vec3 vModelPosition = modelPosition;\n\n #include fade_lod\n #include clip_pixel\n #include assign_material_color\n #include check_transparency\n\n #if defined(dRenderVariant_pick)\n #include check_picking_alpha\n #ifdef requiredDrawBuffers\n gl_FragColor = vObject;\n gl_FragData[1] = vInstance;\n gl_FragData[2] = vGroup;\n gl_FragData[3] = packDepthToRGBA(fragmentDepth);\n #else\n gl_FragColor = vColor;\n #endif\n #elif defined(dRenderVariant_depth)\n gl_FragColor = material;\n #elif defined(dRenderVariant_marking)\n gl_FragColor = material;\n #elif defined(dRenderVariant_emissive)\n gl_FragColor = material;\n #elif defined(dRenderVariant_color)\n mat3 normalMatrix = transpose3(inverse3(mat3(uView)));\n vec3 normal = normalize(normalMatrix * -normalize(cameraNormal));\n #include apply_light_color\n\n #include apply_interior_color\n #include apply_marker_color\n #include apply_fog\n #include wboit_write\n #include dpoit_write\n #endif\n}\n";
7
+ export declare const cylinders_frag = "\nprecision highp float;\nprecision highp int;\n\n#define bumpEnabled\n\nuniform mat4 uView;\n\nvarying mat4 vTransform;\nvarying vec3 vStart;\nvarying vec3 vEnd;\nvarying float vSize;\nvarying float vCap;\n\nuniform vec3 uCameraDir;\nuniform vec3 uCameraPosition;\nuniform mat4 uInvView;\n\n#include common\n#include common_frag_params\n#include color_frag_params\n#include light_frag_params\n#include common_clip\n\n#ifdef dSolidInterior\n const bool solidInterior = true;\n#else\n const bool solidInterior = false;\n#endif\n\n// adapted from https://www.shadertoy.com/view/4lcSRn\n// The MIT License, Copyright 2016 Inigo Quilez\nbool CylinderImpostor(\n in vec3 rayOrigin, in vec3 rayDir,\n in vec3 start, in vec3 end, in float radius,\n out vec3 cameraNormal, out bool interior,\n out vec3 modelPosition, out vec3 viewPosition, out float fragmentDepth\n){\n vec3 ba = end - start;\n vec3 oc = rayOrigin - start;\n\n float baba = dot(ba, ba);\n float bard = dot(ba, rayDir);\n float baoc = dot(ba, oc);\n\n float k2 = baba - bard * bard;\n float k1 = baba * dot(oc, rayDir) - baoc * bard;\n float k0 = baba * dot(oc, oc) - baoc * baoc - radius * radius * baba;\n\n float h = k1 * k1 - k2 * k0;\n if (h < 0.0) return false;\n\n bool topCap = (vCap > 0.9 && vCap < 1.1) || vCap >= 2.9;\n bool bottomCap = (vCap > 1.9 && vCap < 2.1) || vCap >= 2.9;\n\n #ifdef dSolidInterior\n bool topInterior = !topCap;\n bool bottomInterior = !bottomCap;\n topCap = true;\n bottomCap = true;\n #else\n bool topInterior = false;\n bool bottomInterior = false;\n #endif\n\n bool clipped = false;\n bool objectClipped = false;\n\n // body outside\n h = sqrt(h);\n float t = (-k1 - h) / k2;\n float y = baoc + t * bard;\n if (y > 0.0 && y < baba) {\n interior = false;\n cameraNormal = (oc + t * rayDir - ba * y / baba) / radius;\n modelPosition = rayOrigin + t * rayDir;\n viewPosition = (uView * vec4(modelPosition, 1.0)).xyz;\n fragmentDepth = calcDepth(viewPosition);\n #if defined(dClipVariant_pixel) && dClipObjectCount != 0\n if (clipTest(vec4(modelPosition, 0.0))) {\n objectClipped = true;\n fragmentDepth = -1.0;\n #ifdef dSolidInterior\n topCap = !topInterior;\n bottomCap = !bottomInterior;\n #endif\n }\n #endif\n if (fragmentDepth > 0.0) return true;\n clipped = true;\n }\n\n if (!clipped) {\n if (topCap && y < 0.0) {\n // top cap\n t = -baoc / bard;\n if (abs(k1 + k2 * t) < h) {\n interior = topInterior;\n cameraNormal = -ba / baba;\n modelPosition = rayOrigin + t * rayDir;\n viewPosition = (uView * vec4(modelPosition, 1.0)).xyz;\n fragmentDepth = calcDepth(viewPosition);\n #if defined(dClipVariant_pixel) && dClipObjectCount != 0\n if (clipTest(vec4(modelPosition, 0.0))) {\n objectClipped = true;\n fragmentDepth = -1.0;\n #ifdef dSolidInterior\n topCap = !topInterior;\n bottomCap = !bottomInterior;\n #endif\n }\n #endif\n if (fragmentDepth > 0.0) {\n #ifdef dSolidInterior\n if (interior) cameraNormal = -rayDir;\n #endif\n #if defined(dClipVariant_pixel) && dClipObjectCount != 0\n return true;\n #else\n return !interior;\n #endif\n }\n }\n } else if (bottomCap && y >= 0.0) {\n // bottom cap\n t = (baba - baoc) / bard;\n if (abs(k1 + k2 * t) < h) {\n interior = bottomInterior;\n cameraNormal = ba / baba;\n modelPosition = rayOrigin + t * rayDir;\n viewPosition = (uView * vec4(modelPosition, 1.0)).xyz;\n fragmentDepth = calcDepth(viewPosition);\n #if defined(dClipVariant_pixel) && dClipObjectCount != 0\n if (clipTest(vec4(modelPosition, 0.0))) {\n objectClipped = true;\n fragmentDepth = -1.0;\n #ifdef dSolidInterior\n topCap = !topInterior;\n bottomCap = !bottomInterior;\n #endif\n }\n #endif\n if (fragmentDepth > 0.0) {\n #ifdef dSolidInterior\n if (interior) cameraNormal = -rayDir;\n #endif\n #if defined(dClipVariant_pixel) && dClipObjectCount != 0\n return true;\n #else\n return !interior;\n #endif\n }\n }\n }\n }\n\n if (uDoubleSided || solidInterior) {\n // body inside\n h = -h;\n t = (-k1 - h) / k2;\n y = baoc + t * bard;\n if (y > 0.0 && y < baba) {\n interior = true;\n cameraNormal = -(oc + t * rayDir - ba * y / baba) / radius;\n modelPosition = rayOrigin + t * rayDir;\n viewPosition = (uView * vec4(modelPosition, 1.0)).xyz;\n fragmentDepth = calcDepth(viewPosition);\n if (fragmentDepth > 0.0) {\n #ifdef dSolidInterior\n if (!objectClipped) {\n fragmentDepth = 0.0 + (0.0000002 / vSize);\n cameraNormal = -rayDir;\n }\n #endif\n return true;\n }\n }\n\n if (topCap && y < 0.0) {\n // top cap\n t = -baoc / bard;\n if (abs(k1 + k2 * t) < -h) {\n interior = true;\n cameraNormal = ba / baba;\n modelPosition = rayOrigin + t * rayDir;\n viewPosition = (uView * vec4(modelPosition, 1.0)).xyz;\n fragmentDepth = calcDepth(viewPosition);\n if (fragmentDepth > 0.0) {\n #ifdef dSolidInterior\n if (!objectClipped) {\n fragmentDepth = 0.0 + (0.0000002 / vSize);\n cameraNormal = -rayDir;\n }\n #endif\n return true;\n }\n }\n } else if (bottomCap && y >= 0.0) {\n // bottom cap\n t = (baba - baoc) / bard;\n if (abs(k1 + k2 * t) < -h) {\n interior = true;\n cameraNormal = -ba / baba;\n modelPosition = rayOrigin + t * rayDir;\n viewPosition = (uView * vec4(modelPosition, 1.0)).xyz;\n fragmentDepth = calcDepth(viewPosition);\n if (fragmentDepth > 0.0) {\n #ifdef dSolidInterior\n if (!objectClipped) {\n fragmentDepth = 0.0 + (0.0000002 / vSize);\n cameraNormal = -rayDir;\n }\n #endif\n return true;\n }\n }\n }\n }\n\n return false;\n}\n\nvoid main() {\n vec3 rayOrigin = vModelPosition;\n vec3 rayDir = mix(normalize(vModelPosition - uCameraPosition), uCameraDir, uIsOrtho);\n\n vec3 cameraNormal;\n vec3 modelPosition;\n vec3 viewPosition;\n float fragmentDepth;\n bool hit = CylinderImpostor(rayOrigin, rayDir, vStart, vEnd, vSize, cameraNormal, interior, modelPosition, viewPosition, fragmentDepth);\n if (!hit) discard;\n\n if (fragmentDepth < 0.0) discard;\n if (fragmentDepth > 1.0) discard;\n\n gl_FragDepthEXT = fragmentDepth;\n\n vec3 vViewPosition = viewPosition;\n vec3 vModelPosition = modelPosition;\n\n #include fade_lod\n #include clip_pixel\n #include assign_material_color\n #include check_transparency\n\n #if defined(dRenderVariant_pick)\n #include check_picking_alpha\n #ifdef requiredDrawBuffers\n gl_FragColor = vObject;\n gl_FragData[1] = vInstance;\n gl_FragData[2] = vGroup;\n gl_FragData[3] = packDepthToRGBA(fragmentDepth);\n #else\n gl_FragColor = vColor;\n #endif\n #elif defined(dRenderVariant_depth)\n gl_FragColor = material;\n #elif defined(dRenderVariant_marking)\n gl_FragColor = material;\n #elif defined(dRenderVariant_emissive)\n gl_FragColor = material;\n #elif defined(dRenderVariant_color)\n mat3 normalMatrix = transpose3(inverse3(mat3(uView)));\n vec3 normal = normalize(normalMatrix * -normalize(cameraNormal));\n #include apply_light_color\n\n #include apply_interior_color\n #include apply_marker_color\n #include apply_fog\n #include wboit_write\n #include dpoit_write\n #endif\n}\n";
@@ -2,6 +2,7 @@
2
2
  * Copyright (c) 2020-2024 mol* contributors, licensed under MIT, See LICENSE file for more info.
3
3
  *
4
4
  * @author Alexander Rose <alexander.rose@weirdbyte.de>
5
+ * @author Gianluca Tomasello <giagitom@gmail.com>
5
6
  */
6
7
  export const cylinders_frag = `
7
8
  precision highp float;
@@ -119,7 +120,11 @@ bool CylinderImpostor(
119
120
  #ifdef dSolidInterior
120
121
  if (interior) cameraNormal = -rayDir;
121
122
  #endif
122
- return true;
123
+ #if defined(dClipVariant_pixel) && dClipObjectCount != 0
124
+ return true;
125
+ #else
126
+ return !interior;
127
+ #endif
123
128
  }
124
129
  }
125
130
  } else if (bottomCap && y >= 0.0) {
@@ -145,7 +150,11 @@ bool CylinderImpostor(
145
150
  #ifdef dSolidInterior
146
151
  if (interior) cameraNormal = -rayDir;
147
152
  #endif
148
- return true;
153
+ #if defined(dClipVariant_pixel) && dClipObjectCount != 0
154
+ return true;
155
+ #else
156
+ return !interior;
157
+ #endif
149
158
  }
150
159
  }
151
160
  }