molstar 3.6.1 → 3.7.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 (216) hide show
  1. package/build/viewer/molstar.css +1 -1
  2. package/build/viewer/molstar.js +1 -1
  3. package/lib/commonjs/examples/alpha-orbitals/index.js +20 -15
  4. package/lib/commonjs/extensions/anvil/behavior.d.ts +1 -1
  5. package/lib/commonjs/extensions/anvil/representation.d.ts +4 -4
  6. package/lib/commonjs/extensions/cellpack/representation.d.ts +1 -1
  7. package/lib/commonjs/extensions/dnatco/confal-pyramids/representation.d.ts +3 -3
  8. package/lib/commonjs/extensions/rcsb/assembly-symmetry/behavior.d.ts +1 -1
  9. package/lib/commonjs/extensions/rcsb/assembly-symmetry/representation.d.ts +1 -1
  10. package/lib/commonjs/extensions/rcsb/validation-report/representation.d.ts +5 -5
  11. package/lib/commonjs/mol-canvas3d/canvas3d.d.ts +2 -2
  12. package/lib/commonjs/mol-canvas3d/helper/camera-helper.d.ts +1 -1
  13. package/lib/commonjs/mol-canvas3d/helper/handle-helper.d.ts +1 -1
  14. package/lib/commonjs/mol-canvas3d/helper/helper.d.ts +2 -2
  15. package/lib/commonjs/mol-canvas3d/passes/image.d.ts +1 -1
  16. package/lib/commonjs/mol-geo/geometry/color-data.d.ts +2 -8
  17. package/lib/commonjs/mol-geo/geometry/color-data.js +16 -3
  18. package/lib/commonjs/mol-geo/geometry/cylinders/cylinders.d.ts +1 -1
  19. package/lib/commonjs/mol-geo/geometry/cylinders/cylinders.js +3 -2
  20. package/lib/commonjs/mol-geo/geometry/mesh/mesh.d.ts +1 -1
  21. package/lib/commonjs/mol-geo/geometry/mesh/mesh.js +3 -2
  22. package/lib/commonjs/mol-geo/geometry/spheres/spheres.d.ts +1 -1
  23. package/lib/commonjs/mol-geo/geometry/spheres/spheres.js +3 -2
  24. package/lib/commonjs/mol-geo/geometry/texture-mesh/texture-mesh.d.ts +1 -1
  25. package/lib/commonjs/mol-geo/geometry/texture-mesh/texture-mesh.js +15 -4
  26. package/lib/commonjs/mol-gl/renderable/cylinders.d.ts +2 -1
  27. package/lib/commonjs/mol-gl/renderable/cylinders.js +2 -2
  28. package/lib/commonjs/mol-gl/renderable/mesh.d.ts +2 -1
  29. package/lib/commonjs/mol-gl/renderable/mesh.js +2 -2
  30. package/lib/commonjs/mol-gl/renderable/spheres.d.ts +2 -1
  31. package/lib/commonjs/mol-gl/renderable/spheres.js +2 -2
  32. package/lib/commonjs/mol-gl/renderable/texture-mesh.d.ts +2 -1
  33. package/lib/commonjs/mol-gl/renderable/texture-mesh.js +2 -2
  34. package/lib/commonjs/mol-gl/renderer.js +54 -23
  35. package/lib/commonjs/mol-gl/shader/chunks/apply-interior-color.glsl.d.ts +1 -1
  36. package/lib/commonjs/mol-gl/shader/chunks/apply-interior-color.glsl.js +1 -1
  37. package/lib/commonjs/mol-gl/shader/chunks/check-picking-alpha.glsl.d.ts +1 -1
  38. package/lib/commonjs/mol-gl/shader/chunks/check-picking-alpha.glsl.js +1 -1
  39. package/lib/commonjs/mol-gl/shader/chunks/color-vert-params.glsl.d.ts +1 -1
  40. package/lib/commonjs/mol-gl/shader/chunks/color-vert-params.glsl.js +1 -1
  41. package/lib/commonjs/mol-io/writer/ligand-encoder.d.ts +4 -2
  42. package/lib/commonjs/mol-io/writer/ligand-encoder.js +9 -4
  43. package/lib/commonjs/mol-io/writer/mol/encoder.js +16 -4
  44. package/lib/commonjs/mol-io/writer/mol2/encoder.js +17 -4
  45. package/lib/commonjs/mol-model-formats/shape/ply.d.ts +2 -2
  46. package/lib/commonjs/mol-model-props/computed/representations/interactions-inter-unit-cylinder.d.ts +1 -1
  47. package/lib/commonjs/mol-model-props/computed/representations/interactions-intra-unit-cylinder.d.ts +1 -1
  48. package/lib/commonjs/mol-model-props/computed/representations/interactions.d.ts +3 -3
  49. package/lib/commonjs/mol-model-props/integrative/cross-link-restraint/representation.d.ts +4 -4
  50. package/lib/commonjs/mol-plugin/behavior/dynamic/volume-streaming/util.js +0 -1
  51. package/lib/commonjs/mol-plugin/commands.d.ts +1 -1
  52. package/lib/commonjs/mol-plugin/util/viewport-screenshot.d.ts +3 -3
  53. package/lib/commonjs/mol-plugin-state/transforms/representation.d.ts +6 -6
  54. package/lib/commonjs/mol-plugin-ui/base.d.ts +3 -1
  55. package/lib/commonjs/mol-plugin-ui/controls/color.d.ts +1 -1
  56. package/lib/commonjs/mol-plugin-ui/controls/common.d.ts +2 -0
  57. package/lib/commonjs/mol-plugin-ui/hooks/use-behavior.d.ts +1 -1
  58. package/lib/commonjs/mol-plugin-ui/hooks/use-behavior.js +21 -7
  59. package/lib/commonjs/mol-plugin-ui/plugin.d.ts +2 -0
  60. package/lib/commonjs/mol-plugin-ui/plugin.js +2 -2
  61. package/lib/commonjs/mol-plugin-ui/spec.d.ts +1 -0
  62. package/lib/commonjs/mol-plugin-ui/viewport/help.d.ts +4 -1
  63. package/lib/commonjs/mol-repr/shape/loci/angle.d.ts +1 -1
  64. package/lib/commonjs/mol-repr/shape/loci/dihedral.d.ts +1 -1
  65. package/lib/commonjs/mol-repr/shape/loci/orientation.d.ts +1 -1
  66. package/lib/commonjs/mol-repr/shape/loci/plane.d.ts +1 -1
  67. package/lib/commonjs/mol-repr/shape/model/unitcell.d.ts +1 -1
  68. package/lib/commonjs/mol-repr/structure/complex-visual.d.ts +3 -3
  69. package/lib/commonjs/mol-repr/structure/params.d.ts +4 -4
  70. package/lib/commonjs/mol-repr/structure/registry.d.ts +10 -10
  71. package/lib/commonjs/mol-repr/structure/representation/backbone.d.ts +3 -3
  72. package/lib/commonjs/mol-repr/structure/representation/ball-and-stick.d.ts +3 -3
  73. package/lib/commonjs/mol-repr/structure/representation/carbohydrate.d.ts +3 -3
  74. package/lib/commonjs/mol-repr/structure/representation/cartoon.d.ts +3 -3
  75. package/lib/commonjs/mol-repr/structure/representation/ellipsoid.d.ts +3 -3
  76. package/lib/commonjs/mol-repr/structure/representation/gaussian-surface.d.ts +3 -3
  77. package/lib/commonjs/mol-repr/structure/representation/molecular-surface.d.ts +3 -3
  78. package/lib/commonjs/mol-repr/structure/representation/orientation.d.ts +3 -3
  79. package/lib/commonjs/mol-repr/structure/representation/putty.d.ts +3 -3
  80. package/lib/commonjs/mol-repr/structure/representation/spacefill.d.ts +3 -3
  81. package/lib/commonjs/mol-repr/structure/units-visual.d.ts +4 -4
  82. package/lib/commonjs/mol-repr/structure/visual/bond-inter-unit-cylinder.d.ts +2 -2
  83. package/lib/commonjs/mol-repr/structure/visual/bond-intra-unit-cylinder.d.ts +2 -2
  84. package/lib/commonjs/mol-repr/structure/visual/carbohydrate-link-cylinder.d.ts +1 -1
  85. package/lib/commonjs/mol-repr/structure/visual/carbohydrate-symbol-mesh.d.ts +1 -1
  86. package/lib/commonjs/mol-repr/structure/visual/carbohydrate-terminal-link-cylinder.d.ts +1 -1
  87. package/lib/commonjs/mol-repr/structure/visual/element-sphere.d.ts +2 -2
  88. package/lib/commonjs/mol-repr/structure/visual/ellipsoid-mesh.d.ts +1 -1
  89. package/lib/commonjs/mol-repr/structure/visual/gaussian-surface-mesh.d.ts +4 -4
  90. package/lib/commonjs/mol-repr/structure/visual/molecular-surface-mesh.d.ts +1 -1
  91. package/lib/commonjs/mol-repr/structure/visual/nucleotide-block-mesh.d.ts +1 -1
  92. package/lib/commonjs/mol-repr/structure/visual/nucleotide-ring-mesh.d.ts +1 -1
  93. package/lib/commonjs/mol-repr/structure/visual/orientation-ellipsoid-mesh.d.ts +1 -1
  94. package/lib/commonjs/mol-repr/structure/visual/polymer-backbone-cylinder.d.ts +2 -2
  95. package/lib/commonjs/mol-repr/structure/visual/polymer-backbone-sphere.d.ts +2 -2
  96. package/lib/commonjs/mol-repr/structure/visual/polymer-direction-wedge.d.ts +1 -1
  97. package/lib/commonjs/mol-repr/structure/visual/polymer-gap-cylinder.d.ts +1 -1
  98. package/lib/commonjs/mol-repr/structure/visual/polymer-trace-mesh.d.ts +1 -1
  99. package/lib/commonjs/mol-repr/structure/visual/polymer-tube-mesh.d.ts +1 -1
  100. package/lib/commonjs/mol-repr/util.d.ts +1 -1
  101. package/lib/commonjs/mol-repr/util.js +1 -1
  102. package/lib/commonjs/mol-repr/volume/isosurface.d.ts +5 -5
  103. package/lib/commonjs/mol-repr/volume/registry.d.ts +1 -1
  104. package/lib/commonjs/mol-theme/color.d.ts +9 -2
  105. package/lib/commonjs/mol-theme/color.js +1 -1
  106. package/lib/commonjs/servers/model/server/query.js +1 -3
  107. package/lib/commonjs/servers/model/version.d.ts +1 -1
  108. package/lib/commonjs/servers/model/version.js +1 -1
  109. package/lib/examples/alpha-orbitals/index.js +20 -15
  110. package/lib/extensions/anvil/behavior.d.ts +1 -1
  111. package/lib/extensions/anvil/representation.d.ts +4 -4
  112. package/lib/extensions/cellpack/representation.d.ts +1 -1
  113. package/lib/extensions/dnatco/confal-pyramids/representation.d.ts +3 -3
  114. package/lib/extensions/rcsb/assembly-symmetry/behavior.d.ts +1 -1
  115. package/lib/extensions/rcsb/assembly-symmetry/representation.d.ts +1 -1
  116. package/lib/extensions/rcsb/validation-report/representation.d.ts +5 -5
  117. package/lib/mol-canvas3d/canvas3d.d.ts +2 -2
  118. package/lib/mol-canvas3d/helper/camera-helper.d.ts +1 -1
  119. package/lib/mol-canvas3d/helper/handle-helper.d.ts +1 -1
  120. package/lib/mol-canvas3d/helper/helper.d.ts +2 -2
  121. package/lib/mol-canvas3d/passes/image.d.ts +1 -1
  122. package/lib/mol-geo/geometry/color-data.d.ts +2 -8
  123. package/lib/mol-geo/geometry/color-data.js +16 -3
  124. package/lib/mol-geo/geometry/cylinders/cylinders.d.ts +1 -1
  125. package/lib/mol-geo/geometry/cylinders/cylinders.js +3 -2
  126. package/lib/mol-geo/geometry/mesh/mesh.d.ts +1 -1
  127. package/lib/mol-geo/geometry/mesh/mesh.js +3 -2
  128. package/lib/mol-geo/geometry/spheres/spheres.d.ts +1 -1
  129. package/lib/mol-geo/geometry/spheres/spheres.js +3 -2
  130. package/lib/mol-geo/geometry/texture-mesh/texture-mesh.d.ts +1 -1
  131. package/lib/mol-geo/geometry/texture-mesh/texture-mesh.js +15 -4
  132. package/lib/mol-gl/renderable/cylinders.d.ts +2 -1
  133. package/lib/mol-gl/renderable/cylinders.js +2 -2
  134. package/lib/mol-gl/renderable/mesh.d.ts +2 -1
  135. package/lib/mol-gl/renderable/mesh.js +2 -2
  136. package/lib/mol-gl/renderable/spheres.d.ts +2 -1
  137. package/lib/mol-gl/renderable/spheres.js +2 -2
  138. package/lib/mol-gl/renderable/texture-mesh.d.ts +2 -1
  139. package/lib/mol-gl/renderable/texture-mesh.js +2 -2
  140. package/lib/mol-gl/renderer.js +54 -23
  141. package/lib/mol-gl/shader/chunks/apply-interior-color.glsl.d.ts +1 -1
  142. package/lib/mol-gl/shader/chunks/apply-interior-color.glsl.js +1 -1
  143. package/lib/mol-gl/shader/chunks/check-picking-alpha.glsl.d.ts +1 -1
  144. package/lib/mol-gl/shader/chunks/check-picking-alpha.glsl.js +1 -1
  145. package/lib/mol-gl/shader/chunks/color-vert-params.glsl.d.ts +1 -1
  146. package/lib/mol-gl/shader/chunks/color-vert-params.glsl.js +1 -1
  147. package/lib/mol-io/writer/ligand-encoder.d.ts +4 -2
  148. package/lib/mol-io/writer/ligand-encoder.js +9 -4
  149. package/lib/mol-io/writer/mol/encoder.js +16 -4
  150. package/lib/mol-io/writer/mol2/encoder.js +17 -4
  151. package/lib/mol-model-formats/shape/ply.d.ts +2 -2
  152. package/lib/mol-model-props/computed/representations/interactions-inter-unit-cylinder.d.ts +1 -1
  153. package/lib/mol-model-props/computed/representations/interactions-intra-unit-cylinder.d.ts +1 -1
  154. package/lib/mol-model-props/computed/representations/interactions.d.ts +3 -3
  155. package/lib/mol-model-props/integrative/cross-link-restraint/representation.d.ts +4 -4
  156. package/lib/mol-plugin/behavior/dynamic/volume-streaming/util.js +0 -1
  157. package/lib/mol-plugin/commands.d.ts +1 -1
  158. package/lib/mol-plugin/util/viewport-screenshot.d.ts +3 -3
  159. package/lib/mol-plugin/version.js +2 -2
  160. package/lib/mol-plugin-state/transforms/representation.d.ts +6 -6
  161. package/lib/mol-plugin-ui/base.d.ts +3 -1
  162. package/lib/mol-plugin-ui/controls/color.d.ts +1 -1
  163. package/lib/mol-plugin-ui/controls/common.d.ts +2 -0
  164. package/lib/mol-plugin-ui/hooks/use-behavior.d.ts +1 -1
  165. package/lib/mol-plugin-ui/hooks/use-behavior.js +20 -7
  166. package/lib/mol-plugin-ui/plugin.d.ts +2 -0
  167. package/lib/mol-plugin-ui/plugin.js +2 -2
  168. package/lib/mol-plugin-ui/spec.d.ts +1 -0
  169. package/lib/mol-plugin-ui/viewport/help.d.ts +4 -1
  170. package/lib/mol-repr/shape/loci/angle.d.ts +1 -1
  171. package/lib/mol-repr/shape/loci/dihedral.d.ts +1 -1
  172. package/lib/mol-repr/shape/loci/orientation.d.ts +1 -1
  173. package/lib/mol-repr/shape/loci/plane.d.ts +1 -1
  174. package/lib/mol-repr/shape/model/unitcell.d.ts +1 -1
  175. package/lib/mol-repr/structure/complex-visual.d.ts +3 -3
  176. package/lib/mol-repr/structure/params.d.ts +4 -4
  177. package/lib/mol-repr/structure/registry.d.ts +10 -10
  178. package/lib/mol-repr/structure/representation/backbone.d.ts +3 -3
  179. package/lib/mol-repr/structure/representation/ball-and-stick.d.ts +3 -3
  180. package/lib/mol-repr/structure/representation/carbohydrate.d.ts +3 -3
  181. package/lib/mol-repr/structure/representation/cartoon.d.ts +3 -3
  182. package/lib/mol-repr/structure/representation/ellipsoid.d.ts +3 -3
  183. package/lib/mol-repr/structure/representation/gaussian-surface.d.ts +3 -3
  184. package/lib/mol-repr/structure/representation/molecular-surface.d.ts +3 -3
  185. package/lib/mol-repr/structure/representation/orientation.d.ts +3 -3
  186. package/lib/mol-repr/structure/representation/putty.d.ts +3 -3
  187. package/lib/mol-repr/structure/representation/spacefill.d.ts +3 -3
  188. package/lib/mol-repr/structure/units-visual.d.ts +4 -4
  189. package/lib/mol-repr/structure/visual/bond-inter-unit-cylinder.d.ts +2 -2
  190. package/lib/mol-repr/structure/visual/bond-intra-unit-cylinder.d.ts +2 -2
  191. package/lib/mol-repr/structure/visual/carbohydrate-link-cylinder.d.ts +1 -1
  192. package/lib/mol-repr/structure/visual/carbohydrate-symbol-mesh.d.ts +1 -1
  193. package/lib/mol-repr/structure/visual/carbohydrate-terminal-link-cylinder.d.ts +1 -1
  194. package/lib/mol-repr/structure/visual/element-sphere.d.ts +2 -2
  195. package/lib/mol-repr/structure/visual/ellipsoid-mesh.d.ts +1 -1
  196. package/lib/mol-repr/structure/visual/gaussian-surface-mesh.d.ts +4 -4
  197. package/lib/mol-repr/structure/visual/molecular-surface-mesh.d.ts +1 -1
  198. package/lib/mol-repr/structure/visual/nucleotide-block-mesh.d.ts +1 -1
  199. package/lib/mol-repr/structure/visual/nucleotide-ring-mesh.d.ts +1 -1
  200. package/lib/mol-repr/structure/visual/orientation-ellipsoid-mesh.d.ts +1 -1
  201. package/lib/mol-repr/structure/visual/polymer-backbone-cylinder.d.ts +2 -2
  202. package/lib/mol-repr/structure/visual/polymer-backbone-sphere.d.ts +2 -2
  203. package/lib/mol-repr/structure/visual/polymer-direction-wedge.d.ts +1 -1
  204. package/lib/mol-repr/structure/visual/polymer-gap-cylinder.d.ts +1 -1
  205. package/lib/mol-repr/structure/visual/polymer-trace-mesh.d.ts +1 -1
  206. package/lib/mol-repr/structure/visual/polymer-tube-mesh.d.ts +1 -1
  207. package/lib/mol-repr/util.d.ts +1 -1
  208. package/lib/mol-repr/util.js +1 -1
  209. package/lib/mol-repr/volume/isosurface.d.ts +5 -5
  210. package/lib/mol-repr/volume/registry.d.ts +1 -1
  211. package/lib/mol-theme/color.d.ts +9 -2
  212. package/lib/mol-theme/color.js +1 -1
  213. package/lib/servers/model/server/query.js +1 -3
  214. package/lib/servers/model/version.d.ts +1 -1
  215. package/lib/servers/model/version.js +1 -1
  216. package/package.json +16 -16
@@ -16,7 +16,7 @@ export declare const AssemblySymmetryParams: {
16
16
  flatShaded: PD.BooleanParam;
17
17
  ignoreLight: PD.BooleanParam;
18
18
  xrayShaded: PD.BooleanParam;
19
- allowTransparentBackfaces: PD.BooleanParam;
19
+ transparentBackfaces: PD.Select<string>;
20
20
  bumpFrequency: PD.Numeric;
21
21
  bumpAmplitude: PD.Numeric;
22
22
  alpha: PD.Numeric;
@@ -31,7 +31,7 @@ export declare const IntraUnitClashParams: {
31
31
  flatShaded: PD.BooleanParam;
32
32
  ignoreLight: PD.BooleanParam;
33
33
  xrayShaded: PD.BooleanParam;
34
- allowTransparentBackfaces: PD.BooleanParam;
34
+ transparentBackfaces: PD.Select<string>;
35
35
  bumpFrequency: PD.Numeric;
36
36
  bumpAmplitude: PD.Numeric;
37
37
  alpha: PD.Numeric;
@@ -74,7 +74,7 @@ export declare const InterUnitClashParams: {
74
74
  flatShaded: PD.BooleanParam;
75
75
  ignoreLight: PD.BooleanParam;
76
76
  xrayShaded: PD.BooleanParam;
77
- allowTransparentBackfaces: PD.BooleanParam;
77
+ transparentBackfaces: PD.Select<string>;
78
78
  bumpFrequency: PD.Numeric;
79
79
  bumpAmplitude: PD.Numeric;
80
80
  alpha: PD.Numeric;
@@ -118,7 +118,7 @@ export declare const ClashesParams: {
118
118
  flatShaded: PD.BooleanParam;
119
119
  ignoreLight: PD.BooleanParam;
120
120
  xrayShaded: PD.BooleanParam;
121
- allowTransparentBackfaces: PD.BooleanParam;
121
+ transparentBackfaces: PD.Select<string>;
122
122
  bumpFrequency: PD.Numeric;
123
123
  bumpAmplitude: PD.Numeric;
124
124
  alpha: PD.Numeric;
@@ -161,7 +161,7 @@ export declare function getClashesParams(ctx: ThemeRegistryContext, structure: S
161
161
  flatShaded: PD.BooleanParam;
162
162
  ignoreLight: PD.BooleanParam;
163
163
  xrayShaded: PD.BooleanParam;
164
- allowTransparentBackfaces: PD.BooleanParam;
164
+ transparentBackfaces: PD.Select<string>;
165
165
  bumpFrequency: PD.Numeric;
166
166
  bumpAmplitude: PD.Numeric;
167
167
  alpha: PD.Numeric;
@@ -205,7 +205,7 @@ export declare const ClashesRepresentationProvider: StructureRepresentationProvi
205
205
  flatShaded: PD.BooleanParam;
206
206
  ignoreLight: PD.BooleanParam;
207
207
  xrayShaded: PD.BooleanParam;
208
- allowTransparentBackfaces: PD.BooleanParam;
208
+ transparentBackfaces: PD.Select<string>;
209
209
  bumpFrequency: PD.Numeric;
210
210
  bumpAmplitude: PD.Numeric;
211
211
  alpha: PD.Numeric;
@@ -166,7 +166,7 @@ export declare const Canvas3DParams: {
166
166
  flipSided: any;
167
167
  flatShaded: any;
168
168
  xrayShaded: any;
169
- allowTransparentBackfaces: any;
169
+ transparentBackfaces: any;
170
170
  bumpFrequency: any;
171
171
  bumpAmplitude: any;
172
172
  quality: any;
@@ -320,7 +320,7 @@ export declare const DefaultCanvas3DParams: PD.Values<{
320
320
  flipSided: any;
321
321
  flatShaded: any;
322
322
  xrayShaded: any;
323
- allowTransparentBackfaces: any;
323
+ transparentBackfaces: any;
324
324
  bumpFrequency: any;
325
325
  bumpAmplitude: any;
326
326
  quality: any;
@@ -22,7 +22,7 @@ export declare const CameraHelperParams: {
22
22
  flipSided: boolean;
23
23
  flatShaded: boolean;
24
24
  xrayShaded: boolean;
25
- allowTransparentBackfaces: boolean;
25
+ transparentBackfaces: string;
26
26
  bumpFrequency: number;
27
27
  bumpAmplitude: number;
28
28
  quality: "auto" | "medium" | "high" | "low" | "custom" | "highest" | "higher" | "lower" | "lowest";
@@ -24,7 +24,7 @@ export declare const HandleHelperParams: {
24
24
  flipSided: boolean;
25
25
  flatShaded: boolean;
26
26
  xrayShaded: boolean;
27
- allowTransparentBackfaces: boolean;
27
+ transparentBackfaces: string;
28
28
  bumpFrequency: number;
29
29
  bumpAmplitude: number;
30
30
  quality: "auto" | "medium" | "high" | "low" | "custom" | "highest" | "higher" | "lower" | "lowest";
@@ -33,7 +33,7 @@ export declare const HelperParams: {
33
33
  flipSided: any;
34
34
  flatShaded: any;
35
35
  xrayShaded: any;
36
- allowTransparentBackfaces: any;
36
+ transparentBackfaces: any;
37
37
  bumpFrequency: any;
38
38
  bumpAmplitude: any;
39
39
  quality: any;
@@ -66,7 +66,7 @@ export declare const DefaultHelperProps: PD.Values<{
66
66
  flipSided: any;
67
67
  flatShaded: any;
68
68
  xrayShaded: any;
69
- allowTransparentBackfaces: any;
69
+ transparentBackfaces: any;
70
70
  bumpFrequency: any;
71
71
  bumpAmplitude: any;
72
72
  quality: any;
@@ -60,7 +60,7 @@ export declare const ImageParams: {
60
60
  flipSided: any;
61
61
  flatShaded: any;
62
62
  xrayShaded: any;
63
- allowTransparentBackfaces: any;
63
+ transparentBackfaces: any;
64
64
  bumpFrequency: any;
65
65
  bumpAmplitude: any;
66
66
  quality: any;
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Copyright (c) 2018-2021 mol* contributors, licensed under MIT, See LICENSE file for more info.
2
+ * Copyright (c) 2018-2022 mol* contributors, licensed under MIT, See LICENSE file for more info.
3
3
  *
4
4
  * @author Alexander Rose <alexander.rose@weirdbyte.de>
5
5
  * @author David Sehnal <david.sehnal@gmail.com>
@@ -9,7 +9,7 @@ import { TextureImage } from '../../mol-gl/renderable/util';
9
9
  import { Color } from '../../mol-util/color';
10
10
  import { Vec2, Vec3, Vec4 } from '../../mol-math/linear-algebra';
11
11
  import { LocationIterator } from '../util/location-iterator';
12
- import { ColorTheme } from '../../mol-theme/color';
12
+ import { ColorTheme, ColorVolume } from '../../mol-theme/color';
13
13
  import { Texture } from '../../mol-gl/webgl/texture';
14
14
  export declare type ColorType = 'uniform' | 'instance' | 'group' | 'groupInstance' | 'vertex' | 'vertexInstance' | 'volume' | 'volumeInstance' | 'direct';
15
15
  export declare type ColorData = {
@@ -26,10 +26,4 @@ export declare type ColorData = {
26
26
  export declare function createColors(locationIt: LocationIterator, positionIt: LocationIterator, colorTheme: ColorTheme<any>, colorData?: ColorData): ColorData;
27
27
  export declare function createValueColor(value: Color, colorData?: ColorData): ColorData;
28
28
  export declare function createTextureColor(colors: TextureImage<Uint8Array>, type: ColorType, colorData?: ColorData): ColorData;
29
- interface ColorVolume {
30
- colors: Texture;
31
- dimension: Vec3;
32
- transform: Vec4;
33
- }
34
29
  export declare function createGridColor(grid: ColorVolume, type: ColorType, colorData?: ColorData): ColorData;
35
- export {};
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Copyright (c) 2018-2021 mol* contributors, licensed under MIT, See LICENSE file for more info.
2
+ * Copyright (c) 2018-2022 mol* contributors, licensed under MIT, See LICENSE file for more info.
3
3
  *
4
4
  * @author Alexander Rose <alexander.rose@weirdbyte.de>
5
5
  * @author David Sehnal <david.sehnal@gmail.com>
@@ -30,8 +30,20 @@ function _createColors(locationIt, positionIt, colorTheme, colorData) {
30
30
  case 'groupInstance': return createGroupInstanceColor(locationIt, colorTheme.color, colorData);
31
31
  case 'vertex': return createVertexColor(positionIt, colorTheme.color, colorData);
32
32
  case 'vertexInstance': return createVertexInstanceColor(positionIt, colorTheme.color, colorData);
33
- case 'volume': return createGridColor(colorTheme.grid, 'volume', colorData);
34
- case 'volumeInstance': return createGridColor(colorTheme.grid, 'volumeInstance', colorData);
33
+ case 'volume':
34
+ if (colorTheme.grid) {
35
+ return createGridColor(colorTheme.grid, 'volume', colorData);
36
+ }
37
+ else {
38
+ throw new Error('Grid missing for "volume" color theme');
39
+ }
40
+ case 'volumeInstance':
41
+ if (colorTheme.grid) {
42
+ return createGridColor(colorTheme.grid, 'volumeInstance', colorData);
43
+ }
44
+ else {
45
+ throw new Error('Grid missing for "volume" color theme');
46
+ }
35
47
  case 'direct': return createDirectColor(colorData);
36
48
  }
37
49
  }
@@ -178,6 +190,7 @@ function createVertexInstanceColor(locationIt, color, colorData) {
178
190
  }
179
191
  return createTextureColor(colors, 'vertexInstance', colorData);
180
192
  }
193
+ //
181
194
  export function createGridColor(grid, type, colorData) {
182
195
  var colors = grid.colors, dimension = grid.dimension, transform = grid.transform;
183
196
  var width = colors.getWidth();
@@ -43,7 +43,7 @@ export declare namespace Cylinders {
43
43
  doubleSided: PD.BooleanParam;
44
44
  ignoreLight: PD.BooleanParam;
45
45
  xrayShaded: PD.BooleanParam;
46
- allowTransparentBackfaces: PD.BooleanParam;
46
+ transparentBackfaces: PD.Select<string>;
47
47
  bumpFrequency: PD.Numeric;
48
48
  bumpAmplitude: PD.Numeric;
49
49
  alpha: PD.Numeric;
@@ -107,7 +107,7 @@ export var Cylinders;
107
107
  }
108
108
  Cylinders.transform = transform;
109
109
  //
110
- Cylinders.Params = __assign(__assign({}, BaseGeometry.Params), { sizeFactor: PD.Numeric(1, { min: 0, max: 10, step: 0.1 }), sizeAspectRatio: PD.Numeric(1, { min: 0, max: 3, step: 0.01 }), doubleSided: PD.Boolean(false, BaseGeometry.CustomQualityParamInfo), ignoreLight: PD.Boolean(false, BaseGeometry.ShadingCategory), xrayShaded: PD.Boolean(false, BaseGeometry.ShadingCategory), allowTransparentBackfaces: PD.Boolean(false, BaseGeometry.ShadingCategory), bumpFrequency: PD.Numeric(0, { min: 0, max: 10, step: 0.1 }, BaseGeometry.ShadingCategory), bumpAmplitude: PD.Numeric(1, { min: 0, max: 5, step: 0.1 }, BaseGeometry.ShadingCategory) });
110
+ Cylinders.Params = __assign(__assign({}, BaseGeometry.Params), { sizeFactor: PD.Numeric(1, { min: 0, max: 10, step: 0.1 }), sizeAspectRatio: PD.Numeric(1, { min: 0, max: 3, step: 0.01 }), doubleSided: PD.Boolean(false, BaseGeometry.CustomQualityParamInfo), ignoreLight: PD.Boolean(false, BaseGeometry.ShadingCategory), xrayShaded: PD.Boolean(false, BaseGeometry.ShadingCategory), transparentBackfaces: PD.Select('off', PD.arrayToOptions(['off', 'on', 'opaque']), BaseGeometry.ShadingCategory), bumpFrequency: PD.Numeric(0, { min: 0, max: 10, step: 0.1 }, BaseGeometry.ShadingCategory), bumpAmplitude: PD.Numeric(1, { min: 0, max: 5, step: 0.1 }, BaseGeometry.ShadingCategory) });
111
111
  Cylinders.Utils = {
112
112
  Params: Cylinders.Params,
113
113
  createEmpty: createEmpty,
@@ -153,7 +153,7 @@ export var Cylinders;
153
153
  var padding = getMaxSize(size) * props.sizeFactor;
154
154
  var invariantBoundingSphere = Sphere3D.clone(cylinders.boundingSphere);
155
155
  var boundingSphere = calculateTransformBoundingSphere(invariantBoundingSphere, transform.aTransform.ref.value, instanceCount);
156
- return __assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign({ dGeometryType: ValueCell.create('cylinders'), aMapping: cylinders.mappingBuffer, aGroup: cylinders.groupBuffer, aStart: cylinders.startBuffer, aEnd: cylinders.endBuffer, aScale: cylinders.scaleBuffer, aCap: cylinders.capBuffer, elements: cylinders.indexBuffer, boundingSphere: ValueCell.create(boundingSphere), invariantBoundingSphere: ValueCell.create(invariantBoundingSphere), uInvariantBoundingSphere: ValueCell.create(Vec4.ofSphere(invariantBoundingSphere)) }, color), size), marker), overpaint), transparency), material), clipping), transform), { padding: ValueCell.create(padding) }), BaseGeometry.createValues(props, counts)), { uSizeFactor: ValueCell.create(props.sizeFactor * props.sizeAspectRatio), uDoubleSided: ValueCell.create(props.doubleSided), dIgnoreLight: ValueCell.create(props.ignoreLight), dXrayShaded: ValueCell.create(props.xrayShaded), uBumpFrequency: ValueCell.create(props.bumpFrequency), uBumpAmplitude: ValueCell.create(props.bumpAmplitude) });
156
+ return __assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign({ dGeometryType: ValueCell.create('cylinders'), aMapping: cylinders.mappingBuffer, aGroup: cylinders.groupBuffer, aStart: cylinders.startBuffer, aEnd: cylinders.endBuffer, aScale: cylinders.scaleBuffer, aCap: cylinders.capBuffer, elements: cylinders.indexBuffer, boundingSphere: ValueCell.create(boundingSphere), invariantBoundingSphere: ValueCell.create(invariantBoundingSphere), uInvariantBoundingSphere: ValueCell.create(Vec4.ofSphere(invariantBoundingSphere)) }, color), size), marker), overpaint), transparency), material), clipping), transform), { padding: ValueCell.create(padding) }), BaseGeometry.createValues(props, counts)), { uSizeFactor: ValueCell.create(props.sizeFactor * props.sizeAspectRatio), uDoubleSided: ValueCell.create(props.doubleSided), dIgnoreLight: ValueCell.create(props.ignoreLight), dXrayShaded: ValueCell.create(props.xrayShaded), dOpaqueBackfaces: ValueCell.create(props.transparentBackfaces === 'opaque'), uBumpFrequency: ValueCell.create(props.bumpFrequency), uBumpAmplitude: ValueCell.create(props.bumpAmplitude) });
157
157
  }
158
158
  function createValuesSimple(cylinders, props, colorValue, sizeValue, transform) {
159
159
  var s = BaseGeometry.createSimple(colorValue, sizeValue, transform);
@@ -166,6 +166,7 @@ export var Cylinders;
166
166
  ValueCell.updateIfChanged(values.uDoubleSided, props.doubleSided);
167
167
  ValueCell.updateIfChanged(values.dIgnoreLight, props.ignoreLight);
168
168
  ValueCell.updateIfChanged(values.dXrayShaded, props.xrayShaded);
169
+ ValueCell.updateIfChanged(values.dOpaqueBackfaces, props.transparentBackfaces === 'opaque');
169
170
  ValueCell.updateIfChanged(values.uBumpFrequency, props.bumpFrequency);
170
171
  ValueCell.updateIfChanged(values.uBumpAmplitude, props.bumpAmplitude);
171
172
  }
@@ -62,7 +62,7 @@ export declare namespace Mesh {
62
62
  flatShaded: PD.BooleanParam;
63
63
  ignoreLight: PD.BooleanParam;
64
64
  xrayShaded: PD.BooleanParam;
65
- allowTransparentBackfaces: PD.BooleanParam;
65
+ transparentBackfaces: PD.Select<string>;
66
66
  bumpFrequency: PD.Numeric;
67
67
  bumpAmplitude: PD.Numeric;
68
68
  alpha: PD.Numeric;
@@ -551,7 +551,7 @@ export var Mesh;
551
551
  }
552
552
  Mesh.smoothEdges = smoothEdges;
553
553
  //
554
- Mesh.Params = __assign(__assign({}, BaseGeometry.Params), { doubleSided: PD.Boolean(false, BaseGeometry.CustomQualityParamInfo), flipSided: PD.Boolean(false, BaseGeometry.ShadingCategory), flatShaded: PD.Boolean(false, BaseGeometry.ShadingCategory), ignoreLight: PD.Boolean(false, BaseGeometry.ShadingCategory), xrayShaded: PD.Boolean(false, BaseGeometry.ShadingCategory), allowTransparentBackfaces: PD.Boolean(false, BaseGeometry.ShadingCategory), bumpFrequency: PD.Numeric(0, { min: 0, max: 10, step: 0.1 }, BaseGeometry.ShadingCategory), bumpAmplitude: PD.Numeric(1, { min: 0, max: 5, step: 0.1 }, BaseGeometry.ShadingCategory) });
554
+ Mesh.Params = __assign(__assign({}, BaseGeometry.Params), { doubleSided: PD.Boolean(false, BaseGeometry.CustomQualityParamInfo), flipSided: PD.Boolean(false, BaseGeometry.ShadingCategory), flatShaded: PD.Boolean(false, BaseGeometry.ShadingCategory), ignoreLight: PD.Boolean(false, BaseGeometry.ShadingCategory), xrayShaded: PD.Boolean(false, BaseGeometry.ShadingCategory), transparentBackfaces: PD.Select('off', PD.arrayToOptions(['off', 'on', 'opaque']), BaseGeometry.ShadingCategory), bumpFrequency: PD.Numeric(0, { min: 0, max: 10, step: 0.1 }, BaseGeometry.ShadingCategory), bumpAmplitude: PD.Numeric(1, { min: 0, max: 5, step: 0.1 }, BaseGeometry.ShadingCategory) });
555
555
  Mesh.Utils = {
556
556
  Params: Mesh.Params,
557
557
  createEmpty: createEmpty,
@@ -593,7 +593,7 @@ export var Mesh;
593
593
  var counts = { drawCount: mesh.triangleCount * 3, vertexCount: mesh.vertexCount, groupCount: groupCount, instanceCount: instanceCount };
594
594
  var invariantBoundingSphere = Sphere3D.clone(mesh.boundingSphere);
595
595
  var boundingSphere = calculateTransformBoundingSphere(invariantBoundingSphere, transform.aTransform.ref.value, instanceCount);
596
- return __assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign({ dGeometryType: ValueCell.create('mesh'), aPosition: mesh.vertexBuffer, aNormal: mesh.normalBuffer, aGroup: mesh.groupBuffer, elements: mesh.indexBuffer, boundingSphere: ValueCell.create(boundingSphere), invariantBoundingSphere: ValueCell.create(invariantBoundingSphere), uInvariantBoundingSphere: ValueCell.create(Vec4.ofSphere(invariantBoundingSphere)) }, color), marker), overpaint), transparency), material), clipping), transform), BaseGeometry.createValues(props, counts)), { uDoubleSided: ValueCell.create(props.doubleSided), dFlatShaded: ValueCell.create(props.flatShaded), dFlipSided: ValueCell.create(props.flipSided), dIgnoreLight: ValueCell.create(props.ignoreLight), dXrayShaded: ValueCell.create(props.xrayShaded), uBumpFrequency: ValueCell.create(props.bumpFrequency), uBumpAmplitude: ValueCell.create(props.bumpAmplitude), meta: ValueCell.create(mesh.meta) });
596
+ return __assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign({ dGeometryType: ValueCell.create('mesh'), aPosition: mesh.vertexBuffer, aNormal: mesh.normalBuffer, aGroup: mesh.groupBuffer, elements: mesh.indexBuffer, boundingSphere: ValueCell.create(boundingSphere), invariantBoundingSphere: ValueCell.create(invariantBoundingSphere), uInvariantBoundingSphere: ValueCell.create(Vec4.ofSphere(invariantBoundingSphere)) }, color), marker), overpaint), transparency), material), clipping), transform), BaseGeometry.createValues(props, counts)), { uDoubleSided: ValueCell.create(props.doubleSided), dFlatShaded: ValueCell.create(props.flatShaded), dFlipSided: ValueCell.create(props.flipSided), dIgnoreLight: ValueCell.create(props.ignoreLight), dXrayShaded: ValueCell.create(props.xrayShaded), dOpaqueBackfaces: ValueCell.create(props.transparentBackfaces === 'opaque'), uBumpFrequency: ValueCell.create(props.bumpFrequency), uBumpAmplitude: ValueCell.create(props.bumpAmplitude), meta: ValueCell.create(mesh.meta) });
597
597
  }
598
598
  function createValuesSimple(mesh, props, colorValue, sizeValue, transform) {
599
599
  var s = BaseGeometry.createSimple(colorValue, sizeValue, transform);
@@ -607,6 +607,7 @@ export var Mesh;
607
607
  ValueCell.updateIfChanged(values.dFlipSided, props.flipSided);
608
608
  ValueCell.updateIfChanged(values.dIgnoreLight, props.ignoreLight);
609
609
  ValueCell.updateIfChanged(values.dXrayShaded, props.xrayShaded);
610
+ ValueCell.updateIfChanged(values.dOpaqueBackfaces, props.transparentBackfaces === 'opaque');
610
611
  ValueCell.updateIfChanged(values.uBumpFrequency, props.bumpFrequency);
611
612
  ValueCell.updateIfChanged(values.uBumpAmplitude, props.bumpAmplitude);
612
613
  }
@@ -34,7 +34,7 @@ export declare namespace Spheres {
34
34
  doubleSided: PD.BooleanParam;
35
35
  ignoreLight: PD.BooleanParam;
36
36
  xrayShaded: PD.BooleanParam;
37
- allowTransparentBackfaces: PD.BooleanParam;
37
+ transparentBackfaces: PD.Select<string>;
38
38
  bumpFrequency: PD.Numeric;
39
39
  bumpAmplitude: PD.Numeric;
40
40
  alpha: PD.Numeric;
@@ -88,7 +88,7 @@ export var Spheres;
88
88
  ValueCell.update(spheres.groupBuffer, groups);
89
89
  return spheres;
90
90
  }
91
- Spheres.Params = __assign(__assign({}, BaseGeometry.Params), { sizeFactor: PD.Numeric(1, { min: 0, max: 10, step: 0.1 }), doubleSided: PD.Boolean(false, BaseGeometry.CustomQualityParamInfo), ignoreLight: PD.Boolean(false, BaseGeometry.ShadingCategory), xrayShaded: PD.Boolean(false, BaseGeometry.ShadingCategory), allowTransparentBackfaces: PD.Boolean(false, BaseGeometry.ShadingCategory), bumpFrequency: PD.Numeric(0, { min: 0, max: 10, step: 0.1 }, BaseGeometry.ShadingCategory), bumpAmplitude: PD.Numeric(1, { min: 0, max: 5, step: 0.1 }, BaseGeometry.ShadingCategory) });
91
+ Spheres.Params = __assign(__assign({}, BaseGeometry.Params), { sizeFactor: PD.Numeric(1, { min: 0, max: 10, step: 0.1 }), doubleSided: PD.Boolean(false, BaseGeometry.CustomQualityParamInfo), ignoreLight: PD.Boolean(false, BaseGeometry.ShadingCategory), xrayShaded: PD.Boolean(false, BaseGeometry.ShadingCategory), transparentBackfaces: PD.Select('off', PD.arrayToOptions(['off', 'on', 'opaque']), BaseGeometry.ShadingCategory), bumpFrequency: PD.Numeric(0, { min: 0, max: 10, step: 0.1 }, BaseGeometry.ShadingCategory), bumpAmplitude: PD.Numeric(1, { min: 0, max: 5, step: 0.1 }, BaseGeometry.ShadingCategory) });
92
92
  Spheres.Utils = {
93
93
  Params: Spheres.Params,
94
94
  createEmpty: createEmpty,
@@ -132,7 +132,7 @@ export var Spheres;
132
132
  var padding = spheres.boundingSphere.radius ? getMaxSize(size) * props.sizeFactor : 0;
133
133
  var invariantBoundingSphere = Sphere3D.expand(Sphere3D(), spheres.boundingSphere, padding);
134
134
  var boundingSphere = calculateTransformBoundingSphere(invariantBoundingSphere, transform.aTransform.ref.value, instanceCount);
135
- return __assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign({ dGeometryType: ValueCell.create('spheres'), aPosition: spheres.centerBuffer, aMapping: spheres.mappingBuffer, aGroup: spheres.groupBuffer, elements: spheres.indexBuffer, boundingSphere: ValueCell.create(boundingSphere), invariantBoundingSphere: ValueCell.create(invariantBoundingSphere), uInvariantBoundingSphere: ValueCell.create(Vec4.ofSphere(invariantBoundingSphere)) }, color), size), marker), overpaint), transparency), material), clipping), transform), { padding: ValueCell.create(padding) }), BaseGeometry.createValues(props, counts)), { uSizeFactor: ValueCell.create(props.sizeFactor), uDoubleSided: ValueCell.create(props.doubleSided), dIgnoreLight: ValueCell.create(props.ignoreLight), dXrayShaded: ValueCell.create(props.xrayShaded), uBumpFrequency: ValueCell.create(props.bumpFrequency), uBumpAmplitude: ValueCell.create(props.bumpAmplitude) });
135
+ return __assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign({ dGeometryType: ValueCell.create('spheres'), aPosition: spheres.centerBuffer, aMapping: spheres.mappingBuffer, aGroup: spheres.groupBuffer, elements: spheres.indexBuffer, boundingSphere: ValueCell.create(boundingSphere), invariantBoundingSphere: ValueCell.create(invariantBoundingSphere), uInvariantBoundingSphere: ValueCell.create(Vec4.ofSphere(invariantBoundingSphere)) }, color), size), marker), overpaint), transparency), material), clipping), transform), { padding: ValueCell.create(padding) }), BaseGeometry.createValues(props, counts)), { uSizeFactor: ValueCell.create(props.sizeFactor), uDoubleSided: ValueCell.create(props.doubleSided), dIgnoreLight: ValueCell.create(props.ignoreLight), dXrayShaded: ValueCell.create(props.xrayShaded), dOpaqueBackfaces: ValueCell.create(props.transparentBackfaces === 'opaque'), uBumpFrequency: ValueCell.create(props.bumpFrequency), uBumpAmplitude: ValueCell.create(props.bumpAmplitude) });
136
136
  }
137
137
  function createValuesSimple(spheres, props, colorValue, sizeValue, transform) {
138
138
  var s = BaseGeometry.createSimple(colorValue, sizeValue, transform);
@@ -145,6 +145,7 @@ export var Spheres;
145
145
  ValueCell.updateIfChanged(values.uDoubleSided, props.doubleSided);
146
146
  ValueCell.updateIfChanged(values.dIgnoreLight, props.ignoreLight);
147
147
  ValueCell.updateIfChanged(values.dXrayShaded, props.xrayShaded);
148
+ ValueCell.updateIfChanged(values.dOpaqueBackfaces, props.transparentBackfaces === 'opaque');
148
149
  ValueCell.updateIfChanged(values.uBumpFrequency, props.bumpFrequency);
149
150
  ValueCell.updateIfChanged(values.uBumpAmplitude, props.bumpAmplitude);
150
151
  }
@@ -45,7 +45,7 @@ export declare namespace TextureMesh {
45
45
  flatShaded: PD.BooleanParam;
46
46
  ignoreLight: PD.BooleanParam;
47
47
  xrayShaded: PD.BooleanParam;
48
- allowTransparentBackfaces: PD.BooleanParam;
48
+ transparentBackfaces: PD.Select<string>;
49
49
  bumpFrequency: PD.Numeric;
50
50
  bumpAmplitude: PD.Numeric;
51
51
  alpha: PD.Numeric;
@@ -86,7 +86,7 @@ export var TextureMesh;
86
86
  return create(0, 0, vt, gt, nt, bs, textureMesh);
87
87
  }
88
88
  TextureMesh.createEmpty = createEmpty;
89
- TextureMesh.Params = __assign(__assign({}, BaseGeometry.Params), { doubleSided: PD.Boolean(false, BaseGeometry.CustomQualityParamInfo), flipSided: PD.Boolean(false, BaseGeometry.ShadingCategory), flatShaded: PD.Boolean(false, BaseGeometry.ShadingCategory), ignoreLight: PD.Boolean(false, BaseGeometry.ShadingCategory), xrayShaded: PD.Boolean(false, BaseGeometry.ShadingCategory), allowTransparentBackfaces: PD.Boolean(false, BaseGeometry.ShadingCategory), bumpFrequency: PD.Numeric(0, { min: 0, max: 10, step: 0.1 }, BaseGeometry.ShadingCategory), bumpAmplitude: PD.Numeric(1, { min: 0, max: 5, step: 0.1 }, BaseGeometry.ShadingCategory) });
89
+ TextureMesh.Params = __assign(__assign({}, BaseGeometry.Params), { doubleSided: PD.Boolean(false, BaseGeometry.CustomQualityParamInfo), flipSided: PD.Boolean(false, BaseGeometry.ShadingCategory), flatShaded: PD.Boolean(false, BaseGeometry.ShadingCategory), ignoreLight: PD.Boolean(false, BaseGeometry.ShadingCategory), xrayShaded: PD.Boolean(false, BaseGeometry.ShadingCategory), transparentBackfaces: PD.Select('off', PD.arrayToOptions(['off', 'on', 'opaque']), BaseGeometry.ShadingCategory), bumpFrequency: PD.Numeric(0, { min: 0, max: 10, step: 0.1 }, BaseGeometry.ShadingCategory), bumpAmplitude: PD.Numeric(1, { min: 0, max: 5, step: 0.1 }, BaseGeometry.ShadingCategory) });
90
90
  TextureMesh.Utils = {
91
91
  Params: TextureMesh.Params,
92
92
  createEmpty: createEmpty,
@@ -94,8 +94,8 @@ export var TextureMesh;
94
94
  createValuesSimple: createValuesSimple,
95
95
  updateValues: updateValues,
96
96
  updateBoundingSphere: updateBoundingSphere,
97
- createRenderableState: BaseGeometry.createRenderableState,
98
- updateRenderableState: BaseGeometry.updateRenderableState,
97
+ createRenderableState: createRenderableState,
98
+ updateRenderableState: updateRenderableState,
99
99
  createPositionIterator: function () { return LocationIterator(1, 1, 1, function () { return NullLocation; }); }
100
100
  };
101
101
  function createValues(textureMesh, transform, locationIt, theme, props) {
@@ -110,7 +110,7 @@ export var TextureMesh;
110
110
  var counts = { drawCount: textureMesh.vertexCount, vertexCount: textureMesh.vertexCount, groupCount: groupCount, instanceCount: instanceCount };
111
111
  var invariantBoundingSphere = Sphere3D.clone(textureMesh.boundingSphere);
112
112
  var boundingSphere = calculateTransformBoundingSphere(invariantBoundingSphere, transform.aTransform.ref.value, instanceCount);
113
- return __assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign({ dGeometryType: ValueCell.create('textureMesh'), uGeoTexDim: textureMesh.geoTextureDim, tPosition: textureMesh.vertexTexture, tGroup: textureMesh.groupTexture, tNormal: textureMesh.normalTexture, boundingSphere: ValueCell.create(boundingSphere), invariantBoundingSphere: ValueCell.create(invariantBoundingSphere), uInvariantBoundingSphere: ValueCell.create(Vec4.ofSphere(invariantBoundingSphere)) }, color), marker), overpaint), transparency), substance), clipping), transform), BaseGeometry.createValues(props, counts)), { uDoubleSided: ValueCell.create(props.doubleSided), dFlatShaded: ValueCell.create(props.flatShaded), dFlipSided: ValueCell.create(props.flipSided), dIgnoreLight: ValueCell.create(props.ignoreLight), dXrayShaded: ValueCell.create(props.xrayShaded), uBumpFrequency: ValueCell.create(props.bumpFrequency), uBumpAmplitude: ValueCell.create(props.bumpAmplitude), meta: ValueCell.create(textureMesh.meta) });
113
+ return __assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign({ dGeometryType: ValueCell.create('textureMesh'), uGeoTexDim: textureMesh.geoTextureDim, tPosition: textureMesh.vertexTexture, tGroup: textureMesh.groupTexture, tNormal: textureMesh.normalTexture, boundingSphere: ValueCell.create(boundingSphere), invariantBoundingSphere: ValueCell.create(invariantBoundingSphere), uInvariantBoundingSphere: ValueCell.create(Vec4.ofSphere(invariantBoundingSphere)) }, color), marker), overpaint), transparency), substance), clipping), transform), BaseGeometry.createValues(props, counts)), { uDoubleSided: ValueCell.create(props.doubleSided), dFlatShaded: ValueCell.create(props.flatShaded), dFlipSided: ValueCell.create(props.flipSided), dIgnoreLight: ValueCell.create(props.ignoreLight), dXrayShaded: ValueCell.create(props.xrayShaded), dOpaqueBackfaces: ValueCell.create(props.transparentBackfaces === 'opaque'), uBumpFrequency: ValueCell.create(props.bumpFrequency), uBumpAmplitude: ValueCell.create(props.bumpAmplitude), meta: ValueCell.create(textureMesh.meta) });
114
114
  }
115
115
  function createValuesSimple(textureMesh, props, colorValue, sizeValue, transform) {
116
116
  var s = BaseGeometry.createSimple(colorValue, sizeValue, transform);
@@ -124,6 +124,7 @@ export var TextureMesh;
124
124
  ValueCell.updateIfChanged(values.dFlipSided, props.flipSided);
125
125
  ValueCell.updateIfChanged(values.dIgnoreLight, props.ignoreLight);
126
126
  ValueCell.updateIfChanged(values.dXrayShaded, props.xrayShaded);
127
+ ValueCell.updateIfChanged(values.dOpaqueBackfaces, props.transparentBackfaces === 'opaque');
127
128
  ValueCell.updateIfChanged(values.uBumpFrequency, props.bumpFrequency);
128
129
  ValueCell.updateIfChanged(values.uBumpAmplitude, props.bumpAmplitude);
129
130
  }
@@ -138,4 +139,14 @@ export var TextureMesh;
138
139
  ValueCell.update(values.uInvariantBoundingSphere, Vec4.fromSphere(values.uInvariantBoundingSphere.ref.value, invariantBoundingSphere));
139
140
  }
140
141
  }
142
+ function createRenderableState(props) {
143
+ var state = BaseGeometry.createRenderableState(props);
144
+ updateRenderableState(state, props);
145
+ return state;
146
+ }
147
+ function updateRenderableState(state, props) {
148
+ BaseGeometry.updateRenderableState(state, props);
149
+ state.opaque = state.opaque && !props.xrayShaded;
150
+ state.writeDepth = state.opaque;
151
+ }
141
152
  })(TextureMesh || (TextureMesh = {}));
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Copyright (c) 2020-2021 mol* contributors, licensed under MIT, See LICENSE file for more info.
2
+ * Copyright (c) 2020-2022 mol* contributors, licensed under MIT, See LICENSE file for more info.
3
3
  *
4
4
  * @author Alexander Rose <alexander.rose@weirdbyte.de>
5
5
  */
@@ -19,6 +19,7 @@ export declare const CylindersSchema: {
19
19
  uDoubleSided: UniformSpec<"b">;
20
20
  dIgnoreLight: DefineSpec<"boolean">;
21
21
  dXrayShaded: DefineSpec<"boolean">;
22
+ dOpaqueBackfaces: DefineSpec<"boolean">;
22
23
  uBumpFrequency: UniformSpec<"f">;
23
24
  uBumpAmplitude: UniformSpec<"f">;
24
25
  uSize: UniformSpec<"f">;
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Copyright (c) 2020-2021 mol* contributors, licensed under MIT, See LICENSE file for more info.
2
+ * Copyright (c) 2020-2022 mol* contributors, licensed under MIT, See LICENSE file for more info.
3
3
  *
4
4
  * @author Alexander Rose <alexander.rose@weirdbyte.de>
5
5
  */
@@ -9,7 +9,7 @@ import { createGraphicsRenderItem } from '../webgl/render-item';
9
9
  import { GlobalUniformSchema, BaseSchema, AttributeSpec, InternalSchema, SizeSchema, ElementsSpec, ValueSpec, DefineSpec, GlobalTextureSchema, UniformSpec } from './schema';
10
10
  import { CylindersShaderCode } from '../shader-code';
11
11
  import { ValueCell } from '../../mol-util';
12
- export var CylindersSchema = __assign(__assign(__assign({}, BaseSchema), SizeSchema), { aGroup: AttributeSpec('float32', 1, 0), aStart: AttributeSpec('float32', 3, 0), aEnd: AttributeSpec('float32', 3, 0), aMapping: AttributeSpec('float32', 3, 0), aScale: AttributeSpec('float32', 1, 0), aCap: AttributeSpec('float32', 1, 0), elements: ElementsSpec('uint32'), padding: ValueSpec('number'), uDoubleSided: UniformSpec('b'), dIgnoreLight: DefineSpec('boolean'), dXrayShaded: DefineSpec('boolean'), uBumpFrequency: UniformSpec('f'), uBumpAmplitude: UniformSpec('f') });
12
+ export var CylindersSchema = __assign(__assign(__assign({}, BaseSchema), SizeSchema), { aGroup: AttributeSpec('float32', 1, 0), aStart: AttributeSpec('float32', 3, 0), aEnd: AttributeSpec('float32', 3, 0), aMapping: AttributeSpec('float32', 3, 0), aScale: AttributeSpec('float32', 1, 0), aCap: AttributeSpec('float32', 1, 0), elements: ElementsSpec('uint32'), padding: ValueSpec('number'), uDoubleSided: UniformSpec('b'), dIgnoreLight: DefineSpec('boolean'), dXrayShaded: DefineSpec('boolean'), dOpaqueBackfaces: DefineSpec('boolean'), uBumpFrequency: UniformSpec('f'), uBumpAmplitude: UniformSpec('f') });
13
13
  export function CylindersRenderable(ctx, id, values, state, materialId, variants) {
14
14
  var schema = __assign(__assign(__assign(__assign({}, GlobalUniformSchema), GlobalTextureSchema), InternalSchema), CylindersSchema);
15
15
  var internalValues = {
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Copyright (c) 2018-2021 mol* contributors, licensed under MIT, See LICENSE file for more info.
2
+ * Copyright (c) 2018-2022 mol* contributors, licensed under MIT, See LICENSE file for more info.
3
3
  *
4
4
  * @author Alexander Rose <alexander.rose@weirdbyte.de>
5
5
  */
@@ -17,6 +17,7 @@ export declare const MeshSchema: {
17
17
  readonly dFlipSided: DefineSpec<"boolean">;
18
18
  readonly dIgnoreLight: DefineSpec<"boolean">;
19
19
  readonly dXrayShaded: DefineSpec<"boolean">;
20
+ readonly dOpaqueBackfaces: DefineSpec<"boolean">;
20
21
  readonly uBumpFrequency: UniformSpec<"f">;
21
22
  readonly uBumpAmplitude: UniformSpec<"f">;
22
23
  readonly meta: ValueSpec<"unknown">;
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Copyright (c) 2018-2021 mol* contributors, licensed under MIT, See LICENSE file for more info.
2
+ * Copyright (c) 2018-2022 mol* contributors, licensed under MIT, See LICENSE file for more info.
3
3
  *
4
4
  * @author Alexander Rose <alexander.rose@weirdbyte.de>
5
5
  */
@@ -9,7 +9,7 @@ import { createGraphicsRenderItem } from '../webgl/render-item';
9
9
  import { GlobalUniformSchema, BaseSchema, AttributeSpec, ElementsSpec, DefineSpec, InternalSchema, GlobalTextureSchema, ValueSpec, UniformSpec } from './schema';
10
10
  import { MeshShaderCode } from '../shader-code';
11
11
  import { ValueCell } from '../../mol-util';
12
- export var MeshSchema = __assign(__assign({}, BaseSchema), { aGroup: AttributeSpec('float32', 1, 0), aPosition: AttributeSpec('float32', 3, 0), aNormal: AttributeSpec('float32', 3, 0), elements: ElementsSpec('uint32'), dFlatShaded: DefineSpec('boolean'), uDoubleSided: UniformSpec('b'), dFlipSided: DefineSpec('boolean'), dIgnoreLight: DefineSpec('boolean'), dXrayShaded: DefineSpec('boolean'), uBumpFrequency: UniformSpec('f'), uBumpAmplitude: UniformSpec('f'), meta: ValueSpec('unknown') });
12
+ export var MeshSchema = __assign(__assign({}, BaseSchema), { aGroup: AttributeSpec('float32', 1, 0), aPosition: AttributeSpec('float32', 3, 0), aNormal: AttributeSpec('float32', 3, 0), elements: ElementsSpec('uint32'), dFlatShaded: DefineSpec('boolean'), uDoubleSided: UniformSpec('b'), dFlipSided: DefineSpec('boolean'), dIgnoreLight: DefineSpec('boolean'), dXrayShaded: DefineSpec('boolean'), dOpaqueBackfaces: DefineSpec('boolean'), uBumpFrequency: UniformSpec('f'), uBumpAmplitude: UniformSpec('f'), meta: ValueSpec('unknown') });
13
13
  export function MeshRenderable(ctx, id, values, state, materialId, variants) {
14
14
  var schema = __assign(__assign(__assign(__assign({}, GlobalUniformSchema), GlobalTextureSchema), InternalSchema), MeshSchema);
15
15
  var internalValues = {
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Copyright (c) 2019-2021 mol* contributors, licensed under MIT, See LICENSE file for more info.
2
+ * Copyright (c) 2019-2022 mol* contributors, licensed under MIT, See LICENSE file for more info.
3
3
  *
4
4
  * @author Alexander Rose <alexander.rose@weirdbyte.de>
5
5
  */
@@ -16,6 +16,7 @@ export declare const SpheresSchema: {
16
16
  uDoubleSided: UniformSpec<"b">;
17
17
  dIgnoreLight: DefineSpec<"boolean">;
18
18
  dXrayShaded: DefineSpec<"boolean">;
19
+ dOpaqueBackfaces: DefineSpec<"boolean">;
19
20
  uBumpFrequency: UniformSpec<"f">;
20
21
  uBumpAmplitude: UniformSpec<"f">;
21
22
  uSize: UniformSpec<"f">;
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Copyright (c) 2019-2021 mol* contributors, licensed under MIT, See LICENSE file for more info.
2
+ * Copyright (c) 2019-2022 mol* contributors, licensed under MIT, See LICENSE file for more info.
3
3
  *
4
4
  * @author Alexander Rose <alexander.rose@weirdbyte.de>
5
5
  */
@@ -9,7 +9,7 @@ import { createGraphicsRenderItem } from '../webgl/render-item';
9
9
  import { GlobalUniformSchema, BaseSchema, AttributeSpec, InternalSchema, SizeSchema, ElementsSpec, ValueSpec, DefineSpec, GlobalTextureSchema, UniformSpec } from './schema';
10
10
  import { SpheresShaderCode } from '../shader-code';
11
11
  import { ValueCell } from '../../mol-util';
12
- export var SpheresSchema = __assign(__assign(__assign({}, BaseSchema), SizeSchema), { aGroup: AttributeSpec('float32', 1, 0), aPosition: AttributeSpec('float32', 3, 0), aMapping: AttributeSpec('float32', 2, 0), elements: ElementsSpec('uint32'), padding: ValueSpec('number'), uDoubleSided: UniformSpec('b'), dIgnoreLight: DefineSpec('boolean'), dXrayShaded: DefineSpec('boolean'), uBumpFrequency: UniformSpec('f'), uBumpAmplitude: UniformSpec('f') });
12
+ export var SpheresSchema = __assign(__assign(__assign({}, BaseSchema), SizeSchema), { aGroup: AttributeSpec('float32', 1, 0), aPosition: AttributeSpec('float32', 3, 0), aMapping: AttributeSpec('float32', 2, 0), elements: ElementsSpec('uint32'), padding: ValueSpec('number'), uDoubleSided: UniformSpec('b'), dIgnoreLight: DefineSpec('boolean'), dXrayShaded: DefineSpec('boolean'), dOpaqueBackfaces: DefineSpec('boolean'), uBumpFrequency: UniformSpec('f'), uBumpAmplitude: UniformSpec('f') });
13
13
  export function SpheresRenderable(ctx, id, values, state, materialId, variants) {
14
14
  var schema = __assign(__assign(__assign(__assign({}, GlobalUniformSchema), GlobalTextureSchema), InternalSchema), SpheresSchema);
15
15
  var internalValues = {
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Copyright (c) 2019-2021 mol* contributors, licensed under MIT, See LICENSE file for more info.
2
+ * Copyright (c) 2019-2022 mol* contributors, licensed under MIT, See LICENSE file for more info.
3
3
  *
4
4
  * @author Alexander Rose <alexander.rose@weirdbyte.de>
5
5
  */
@@ -17,6 +17,7 @@ export declare const TextureMeshSchema: {
17
17
  dFlipSided: DefineSpec<"boolean">;
18
18
  dIgnoreLight: DefineSpec<"boolean">;
19
19
  dXrayShaded: DefineSpec<"boolean">;
20
+ dOpaqueBackfaces: DefineSpec<"boolean">;
20
21
  uBumpFrequency: UniformSpec<"f">;
21
22
  uBumpAmplitude: UniformSpec<"f">;
22
23
  meta: ValueSpec<"unknown">;
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Copyright (c) 2019-2021 mol* contributors, licensed under MIT, See LICENSE file for more info.
2
+ * Copyright (c) 2019-2022 mol* contributors, licensed under MIT, See LICENSE file for more info.
3
3
  *
4
4
  * @author Alexander Rose <alexander.rose@weirdbyte.de>
5
5
  */
@@ -9,7 +9,7 @@ import { createGraphicsRenderItem } from '../webgl/render-item';
9
9
  import { GlobalUniformSchema, BaseSchema, DefineSpec, InternalSchema, UniformSpec, TextureSpec, GlobalTextureSchema, ValueSpec } from './schema';
10
10
  import { MeshShaderCode } from '../shader-code';
11
11
  import { ValueCell } from '../../mol-util';
12
- export var TextureMeshSchema = __assign(__assign({}, BaseSchema), { uGeoTexDim: UniformSpec('v2', 'buffered'), tPosition: TextureSpec('texture', 'rgb', 'float', 'nearest'), tGroup: TextureSpec('texture', 'alpha', 'float', 'nearest'), tNormal: TextureSpec('texture', 'rgb', 'float', 'nearest'), dFlatShaded: DefineSpec('boolean'), uDoubleSided: UniformSpec('b'), dFlipSided: DefineSpec('boolean'), dIgnoreLight: DefineSpec('boolean'), dXrayShaded: DefineSpec('boolean'), uBumpFrequency: UniformSpec('f'), uBumpAmplitude: UniformSpec('f'), meta: ValueSpec('unknown') });
12
+ export var TextureMeshSchema = __assign(__assign({}, BaseSchema), { uGeoTexDim: UniformSpec('v2', 'buffered'), tPosition: TextureSpec('texture', 'rgb', 'float', 'nearest'), tGroup: TextureSpec('texture', 'alpha', 'float', 'nearest'), tNormal: TextureSpec('texture', 'rgb', 'float', 'nearest'), dFlatShaded: DefineSpec('boolean'), uDoubleSided: UniformSpec('b'), dFlipSided: DefineSpec('boolean'), dIgnoreLight: DefineSpec('boolean'), dXrayShaded: DefineSpec('boolean'), dOpaqueBackfaces: DefineSpec('boolean'), uBumpFrequency: UniformSpec('f'), uBumpAmplitude: UniformSpec('f'), meta: ValueSpec('unknown') });
13
13
  export function TextureMeshRenderable(ctx, id, values, state, materialId, variants) {
14
14
  var schema = __assign(__assign(__assign(__assign({}, GlobalUniformSchema), GlobalTextureSchema), InternalSchema), TextureMeshSchema);
15
15
  var internalValues = {