molstar 4.2.0 → 4.3.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 (339) hide show
  1. package/LICENSE +20 -20
  2. package/README.md +197 -197
  3. package/build/viewer/embedded.html +52 -52
  4. package/build/viewer/index.html +129 -129
  5. package/build/viewer/molstar.js +1 -1
  6. package/build/viewer/molstar.js.LICENSE.txt +9 -0
  7. package/lib/apps/docking-viewer/index.html +36 -36
  8. package/lib/apps/mesoscale-explorer/index.html +100 -100
  9. package/lib/apps/mesoscale-explorer/style.scss +33 -33
  10. package/lib/apps/viewer/app.d.ts +2 -1
  11. package/lib/apps/viewer/app.js +2 -1
  12. package/lib/apps/viewer/embedded.html +52 -52
  13. package/lib/apps/viewer/index.html +129 -129
  14. package/lib/cli/chem-comp-dict/create-ions.js +9 -9
  15. package/lib/cli/chem-comp-dict/create-saccharides.js +9 -9
  16. package/lib/cli/cifschema/util/generate.js +12 -12
  17. package/lib/cli/lipid-params/index.js +9 -9
  18. package/lib/commonjs/apps/viewer/app.d.ts +2 -1
  19. package/lib/commonjs/apps/viewer/app.js +1 -0
  20. package/lib/commonjs/cli/chem-comp-dict/create-ions.js +9 -9
  21. package/lib/commonjs/cli/chem-comp-dict/create-saccharides.js +9 -9
  22. package/lib/commonjs/cli/cifschema/util/generate.js +12 -12
  23. package/lib/commonjs/cli/lipid-params/index.js +9 -9
  24. package/lib/commonjs/examples/alpha-orbitals/example-data.js +160 -160
  25. package/lib/commonjs/extensions/alpha-orbitals/gpu/shader.frag.js +136 -136
  26. package/lib/commonjs/extensions/assembly-symmetry/prop.js +24 -24
  27. package/lib/commonjs/extensions/dnatco/confal-pyramids/behavior.js +5 -5
  28. package/lib/commonjs/extensions/dnatco/ntc-tube/behavior.js +5 -5
  29. package/lib/commonjs/extensions/geo-export/usdz-exporter.js +41 -41
  30. package/lib/commonjs/extensions/meshes/mesh-extension.d.ts +1 -0
  31. package/lib/commonjs/extensions/mp4-export/encoder.js +1 -1
  32. package/lib/commonjs/extensions/mvs/components/annotation-label/representation.d.ts +0 -2
  33. package/lib/commonjs/extensions/mvs/components/custom-label/representation.d.ts +2 -2
  34. package/lib/commonjs/extensions/mvs/tree/mvs/mvs-builder.d.ts +8 -2
  35. package/lib/commonjs/extensions/sb-ncbr/index.d.ts +8 -0
  36. package/lib/commonjs/extensions/sb-ncbr/index.js +14 -1
  37. package/lib/commonjs/extensions/sb-ncbr/tunnels/actions.d.ts +20 -0
  38. package/lib/commonjs/extensions/sb-ncbr/tunnels/actions.js +89 -0
  39. package/lib/commonjs/extensions/sb-ncbr/tunnels/algorithm.d.ts +26 -0
  40. package/lib/commonjs/extensions/sb-ncbr/tunnels/algorithm.js +474 -0
  41. package/lib/commonjs/extensions/sb-ncbr/tunnels/behavior.d.ts +40 -0
  42. package/lib/commonjs/extensions/sb-ncbr/tunnels/behavior.js +96 -0
  43. package/lib/commonjs/extensions/sb-ncbr/tunnels/data-model.d.ts +146 -0
  44. package/lib/commonjs/extensions/sb-ncbr/tunnels/data-model.js +28 -0
  45. package/lib/commonjs/extensions/sb-ncbr/tunnels/examples.d.ts +12 -0
  46. package/lib/commonjs/extensions/sb-ncbr/tunnels/examples.js +54 -0
  47. package/lib/commonjs/extensions/sb-ncbr/tunnels/props.d.ts +19 -0
  48. package/lib/commonjs/extensions/sb-ncbr/tunnels/props.js +26 -0
  49. package/lib/commonjs/extensions/sb-ncbr/tunnels/representation.d.ts +29 -0
  50. package/lib/commonjs/extensions/sb-ncbr/tunnels/representation.js +99 -0
  51. package/lib/commonjs/mol-canvas3d/canvas3d.d.ts +17 -0
  52. package/lib/commonjs/mol-canvas3d/canvas3d.js +4 -0
  53. package/lib/commonjs/mol-canvas3d/passes/dof.d.ts +34 -0
  54. package/lib/commonjs/mol-canvas3d/passes/dof.js +167 -0
  55. package/lib/commonjs/mol-canvas3d/passes/draw.d.ts +2 -0
  56. package/lib/commonjs/mol-canvas3d/passes/draw.js +31 -8
  57. package/lib/commonjs/mol-canvas3d/passes/image.d.ts +8 -0
  58. package/lib/commonjs/mol-canvas3d/passes/postprocessing.d.ts +8 -0
  59. package/lib/commonjs/mol-canvas3d/passes/postprocessing.js +5 -0
  60. package/lib/commonjs/mol-geo/geometry/lines/lines.d.ts +0 -1
  61. package/lib/commonjs/mol-gl/shader/background.frag.js +95 -95
  62. package/lib/commonjs/mol-gl/shader/background.vert.js +11 -11
  63. package/lib/commonjs/mol-gl/shader/blend-back-dpoit.frag.js +13 -13
  64. package/lib/commonjs/mol-gl/shader/bloom/blur.frag.js +28 -28
  65. package/lib/commonjs/mol-gl/shader/bloom/composite.frag.js +33 -33
  66. package/lib/commonjs/mol-gl/shader/bloom/luminosity.frag.js +52 -52
  67. package/lib/commonjs/mol-gl/shader/cas.frag.js +144 -144
  68. package/lib/commonjs/mol-gl/shader/chunks/apply-fog.glsl.js +31 -31
  69. package/lib/commonjs/mol-gl/shader/chunks/apply-interior-color.glsl.js +12 -12
  70. package/lib/commonjs/mol-gl/shader/chunks/apply-light-color.glsl.js +77 -77
  71. package/lib/commonjs/mol-gl/shader/chunks/apply-marker-color.glsl.js +16 -16
  72. package/lib/commonjs/mol-gl/shader/chunks/assign-clipping-varying.glsl.js +8 -8
  73. package/lib/commonjs/mol-gl/shader/chunks/assign-color-varying.glsl.js +140 -140
  74. package/lib/commonjs/mol-gl/shader/chunks/assign-group.glsl.js +6 -6
  75. package/lib/commonjs/mol-gl/shader/chunks/assign-marker-varying.glsl.js +8 -8
  76. package/lib/commonjs/mol-gl/shader/chunks/assign-material-color.glsl.js +112 -112
  77. package/lib/commonjs/mol-gl/shader/chunks/assign-position.glsl.js +14 -14
  78. package/lib/commonjs/mol-gl/shader/chunks/assign-size.glsl.js +18 -18
  79. package/lib/commonjs/mol-gl/shader/chunks/check-picking-alpha.glsl.js +12 -12
  80. package/lib/commonjs/mol-gl/shader/chunks/check-transparency.glsl.js +16 -16
  81. package/lib/commonjs/mol-gl/shader/chunks/clip-instance.glsl.js +7 -7
  82. package/lib/commonjs/mol-gl/shader/chunks/clip-pixel.glsl.js +5 -5
  83. package/lib/commonjs/mol-gl/shader/chunks/color-frag-params.glsl.js +60 -60
  84. package/lib/commonjs/mol-gl/shader/chunks/color-vert-params.glsl.js +122 -122
  85. package/lib/commonjs/mol-gl/shader/chunks/common-clip.glsl.js +104 -104
  86. package/lib/commonjs/mol-gl/shader/chunks/common-frag-params.glsl.js +150 -150
  87. package/lib/commonjs/mol-gl/shader/chunks/common-vert-params.glsl.js +61 -61
  88. package/lib/commonjs/mol-gl/shader/chunks/common.glsl.js +234 -234
  89. package/lib/commonjs/mol-gl/shader/chunks/dpoit-write.glsl.js +62 -62
  90. package/lib/commonjs/mol-gl/shader/chunks/fade-lod.glsl.js +42 -42
  91. package/lib/commonjs/mol-gl/shader/chunks/float-to-rgba.glsl.js +39 -39
  92. package/lib/commonjs/mol-gl/shader/chunks/light-frag-params.glsl.js +127 -127
  93. package/lib/commonjs/mol-gl/shader/chunks/matrix-scale.glsl.js +5 -5
  94. package/lib/commonjs/mol-gl/shader/chunks/normal-frag-params.glsl.js +2 -2
  95. package/lib/commonjs/mol-gl/shader/chunks/read-from-texture.glsl.js +14 -14
  96. package/lib/commonjs/mol-gl/shader/chunks/rgba-to-float.glsl.js +84 -84
  97. package/lib/commonjs/mol-gl/shader/chunks/size-vert-params.glsl.js +11 -11
  98. package/lib/commonjs/mol-gl/shader/chunks/texture3d-from-1d-trilinear.glsl.js +23 -23
  99. package/lib/commonjs/mol-gl/shader/chunks/texture3d-from-2d-linear.glsl.js +17 -17
  100. package/lib/commonjs/mol-gl/shader/chunks/texture3d-from-2d-nearest.glsl.js +8 -8
  101. package/lib/commonjs/mol-gl/shader/chunks/wboit-write.glsl.js +25 -25
  102. package/lib/commonjs/mol-gl/shader/compose.frag.js +12 -12
  103. package/lib/commonjs/mol-gl/shader/compute/color-smoothing/accumulate.frag.js +23 -23
  104. package/lib/commonjs/mol-gl/shader/compute/color-smoothing/accumulate.vert.js +43 -43
  105. package/lib/commonjs/mol-gl/shader/compute/color-smoothing/normalize.frag.js +15 -15
  106. package/lib/commonjs/mol-gl/shader/copy.frag.js +11 -11
  107. package/lib/commonjs/mol-gl/shader/cylinders.frag.js +266 -266
  108. package/lib/commonjs/mol-gl/shader/cylinders.vert.js +89 -89
  109. package/lib/commonjs/mol-gl/shader/depth-merge.frag.js +23 -23
  110. package/lib/commonjs/mol-gl/shader/direct-volume.frag.js +362 -362
  111. package/lib/commonjs/mol-gl/shader/direct-volume.vert.js +41 -41
  112. package/lib/commonjs/mol-gl/shader/dof.frag.d.ts +7 -0
  113. package/lib/commonjs/mol-gl/shader/dof.frag.js +122 -0
  114. package/lib/commonjs/mol-gl/shader/evaluate-dpoit.frag.js +10 -10
  115. package/lib/commonjs/mol-gl/shader/evaluate-wboit.frag.js +17 -17
  116. package/lib/commonjs/mol-gl/shader/fxaa.frag.js +228 -228
  117. package/lib/commonjs/mol-gl/shader/gaussian-density.frag.js +49 -49
  118. package/lib/commonjs/mol-gl/shader/gaussian-density.vert.js +27 -27
  119. package/lib/commonjs/mol-gl/shader/hi-z.frag.js +18 -18
  120. package/lib/commonjs/mol-gl/shader/histogram-pyramid/reduction.frag.js +58 -58
  121. package/lib/commonjs/mol-gl/shader/histogram-pyramid/sum.frag.js +19 -19
  122. package/lib/commonjs/mol-gl/shader/image.frag.js +169 -169
  123. package/lib/commonjs/mol-gl/shader/image.vert.js +21 -21
  124. package/lib/commonjs/mol-gl/shader/lines.frag.js +42 -42
  125. package/lib/commonjs/mol-gl/shader/lines.vert.js +117 -117
  126. package/lib/commonjs/mol-gl/shader/marching-cubes/active-voxels.frag.js +70 -70
  127. package/lib/commonjs/mol-gl/shader/marching-cubes/isosurface.frag.js +311 -311
  128. package/lib/commonjs/mol-gl/shader/marking/edge.frag.js +28 -28
  129. package/lib/commonjs/mol-gl/shader/marking/overlay.frag.js +26 -26
  130. package/lib/commonjs/mol-gl/shader/mesh.frag.js +65 -65
  131. package/lib/commonjs/mol-gl/shader/mesh.vert.js +49 -49
  132. package/lib/commonjs/mol-gl/shader/outlines.frag.js +95 -95
  133. package/lib/commonjs/mol-gl/shader/points.frag.js +59 -59
  134. package/lib/commonjs/mol-gl/shader/points.vert.js +38 -38
  135. package/lib/commonjs/mol-gl/shader/postprocessing.frag.js +150 -150
  136. package/lib/commonjs/mol-gl/shader/quad.vert.js +10 -10
  137. package/lib/commonjs/mol-gl/shader/shadows.frag.js +123 -123
  138. package/lib/commonjs/mol-gl/shader/smaa/blend.frag.js +56 -56
  139. package/lib/commonjs/mol-gl/shader/smaa/blend.vert.js +25 -25
  140. package/lib/commonjs/mol-gl/shader/smaa/edges.frag.js +66 -66
  141. package/lib/commonjs/mol-gl/shader/smaa/edges.vert.js +26 -26
  142. package/lib/commonjs/mol-gl/shader/smaa/weights.frag.js +206 -206
  143. package/lib/commonjs/mol-gl/shader/smaa/weights.vert.js +32 -32
  144. package/lib/commonjs/mol-gl/shader/spheres.frag.js +148 -148
  145. package/lib/commonjs/mol-gl/shader/spheres.vert.js +132 -132
  146. package/lib/commonjs/mol-gl/shader/ssao-blur.frag.js +97 -97
  147. package/lib/commonjs/mol-gl/shader/ssao.frag.js +211 -211
  148. package/lib/commonjs/mol-gl/shader/text.frag.js +85 -85
  149. package/lib/commonjs/mol-gl/shader/text.vert.js +85 -85
  150. package/lib/commonjs/mol-gl/shader/util/grid3d-template.frag.js +46 -46
  151. package/lib/commonjs/mol-gl/shader-code.js +15 -15
  152. package/lib/commonjs/mol-gl/webgl/compat.js +12 -12
  153. package/lib/commonjs/mol-gl/webgl/context.js +1 -0
  154. package/lib/commonjs/mol-gl/webgl/timer.d.ts +1 -1
  155. package/lib/commonjs/mol-gl/webgl/timer.js +8 -1
  156. package/lib/commonjs/mol-math/linear-algebra/3d/minimize-rmsd.js +2 -1
  157. package/lib/commonjs/mol-plugin/animation-loop.d.ts +1 -0
  158. package/lib/commonjs/mol-plugin/behavior/dynamic/volume-streaming/behavior.d.ts +6 -6
  159. package/lib/commonjs/mol-plugin/behavior/dynamic/volume-streaming/model.d.ts +1 -1
  160. package/lib/commonjs/mol-plugin/behavior/dynamic/volume-streaming/transformers.d.ts +3 -3
  161. package/lib/commonjs/mol-plugin-state/animation/built-in/state-snapshots.js +7 -3
  162. package/lib/commonjs/mol-plugin-ui/viewport/simple-settings.js +3 -0
  163. package/lib/commonjs/servers/common/swagger-ui/indexTemplate.js +66 -66
  164. package/lib/commonjs/servers/volume/config.js +5 -5
  165. package/lib/examples/alpha-orbitals/example-data.js +160 -160
  166. package/lib/examples/alpha-orbitals/index.html +72 -72
  167. package/lib/examples/basic-wrapper/index.html +137 -137
  168. package/lib/examples/lighting/index.html +88 -88
  169. package/lib/examples/proteopedia-wrapper/index.html +236 -236
  170. package/lib/extensions/alpha-orbitals/gpu/shader.frag.js +136 -136
  171. package/lib/extensions/assembly-symmetry/prop.js +24 -24
  172. package/lib/extensions/dnatco/confal-pyramids/behavior.js +5 -5
  173. package/lib/extensions/dnatco/ntc-tube/behavior.js +5 -5
  174. package/lib/extensions/geo-export/usdz-exporter.js +41 -41
  175. package/lib/extensions/meshes/mesh-extension.d.ts +1 -0
  176. package/lib/extensions/mp4-export/encoder.js +1 -1
  177. package/lib/extensions/mvs/components/annotation-label/representation.d.ts +0 -2
  178. package/lib/extensions/mvs/components/custom-label/representation.d.ts +2 -2
  179. package/lib/extensions/mvs/tree/mvs/mvs-builder.d.ts +8 -2
  180. package/lib/extensions/sb-ncbr/index.d.ts +8 -0
  181. package/lib/extensions/sb-ncbr/index.js +8 -0
  182. package/lib/extensions/sb-ncbr/tunnels/actions.d.ts +20 -0
  183. package/lib/extensions/sb-ncbr/tunnels/actions.js +86 -0
  184. package/lib/extensions/sb-ncbr/tunnels/algorithm.d.ts +26 -0
  185. package/lib/extensions/sb-ncbr/tunnels/algorithm.js +469 -0
  186. package/lib/extensions/sb-ncbr/tunnels/behavior.d.ts +40 -0
  187. package/lib/extensions/sb-ncbr/tunnels/behavior.js +92 -0
  188. package/lib/extensions/sb-ncbr/tunnels/data-model.d.ts +146 -0
  189. package/lib/extensions/sb-ncbr/tunnels/data-model.js +23 -0
  190. package/lib/extensions/sb-ncbr/tunnels/examples.d.ts +12 -0
  191. package/lib/extensions/sb-ncbr/tunnels/examples.js +49 -0
  192. package/lib/extensions/sb-ncbr/tunnels/props.d.ts +19 -0
  193. package/lib/extensions/sb-ncbr/tunnels/props.js +22 -0
  194. package/lib/extensions/sb-ncbr/tunnels/representation.d.ts +29 -0
  195. package/lib/extensions/sb-ncbr/tunnels/representation.js +96 -0
  196. package/lib/mol-canvas3d/canvas3d.d.ts +17 -0
  197. package/lib/mol-canvas3d/canvas3d.js +4 -0
  198. package/lib/mol-canvas3d/passes/dof.d.ts +34 -0
  199. package/lib/mol-canvas3d/passes/dof.js +163 -0
  200. package/lib/mol-canvas3d/passes/draw.d.ts +2 -0
  201. package/lib/mol-canvas3d/passes/draw.js +31 -8
  202. package/lib/mol-canvas3d/passes/image.d.ts +8 -0
  203. package/lib/mol-canvas3d/passes/postprocessing.d.ts +8 -0
  204. package/lib/mol-canvas3d/passes/postprocessing.js +5 -0
  205. package/lib/mol-geo/geometry/lines/lines.d.ts +0 -1
  206. package/lib/mol-gl/shader/background.frag.js +95 -95
  207. package/lib/mol-gl/shader/background.vert.js +11 -11
  208. package/lib/mol-gl/shader/blend-back-dpoit.frag.js +13 -13
  209. package/lib/mol-gl/shader/bloom/blur.frag.js +28 -28
  210. package/lib/mol-gl/shader/bloom/composite.frag.js +33 -33
  211. package/lib/mol-gl/shader/bloom/luminosity.frag.js +52 -52
  212. package/lib/mol-gl/shader/cas.frag.js +144 -144
  213. package/lib/mol-gl/shader/chunks/apply-fog.glsl.js +31 -31
  214. package/lib/mol-gl/shader/chunks/apply-interior-color.glsl.js +12 -12
  215. package/lib/mol-gl/shader/chunks/apply-light-color.glsl.js +77 -77
  216. package/lib/mol-gl/shader/chunks/apply-marker-color.glsl.js +16 -16
  217. package/lib/mol-gl/shader/chunks/assign-clipping-varying.glsl.js +8 -8
  218. package/lib/mol-gl/shader/chunks/assign-color-varying.glsl.js +140 -140
  219. package/lib/mol-gl/shader/chunks/assign-group.glsl.js +6 -6
  220. package/lib/mol-gl/shader/chunks/assign-marker-varying.glsl.js +8 -8
  221. package/lib/mol-gl/shader/chunks/assign-material-color.glsl.js +112 -112
  222. package/lib/mol-gl/shader/chunks/assign-position.glsl.js +14 -14
  223. package/lib/mol-gl/shader/chunks/assign-size.glsl.js +18 -18
  224. package/lib/mol-gl/shader/chunks/check-picking-alpha.glsl.js +12 -12
  225. package/lib/mol-gl/shader/chunks/check-transparency.glsl.js +16 -16
  226. package/lib/mol-gl/shader/chunks/clip-instance.glsl.js +7 -7
  227. package/lib/mol-gl/shader/chunks/clip-pixel.glsl.js +5 -5
  228. package/lib/mol-gl/shader/chunks/color-frag-params.glsl.js +60 -60
  229. package/lib/mol-gl/shader/chunks/color-vert-params.glsl.js +122 -122
  230. package/lib/mol-gl/shader/chunks/common-clip.glsl.js +104 -104
  231. package/lib/mol-gl/shader/chunks/common-frag-params.glsl.js +150 -150
  232. package/lib/mol-gl/shader/chunks/common-vert-params.glsl.js +61 -61
  233. package/lib/mol-gl/shader/chunks/common.glsl.js +234 -234
  234. package/lib/mol-gl/shader/chunks/dpoit-write.glsl.js +62 -62
  235. package/lib/mol-gl/shader/chunks/fade-lod.glsl.js +42 -42
  236. package/lib/mol-gl/shader/chunks/float-to-rgba.glsl.js +39 -39
  237. package/lib/mol-gl/shader/chunks/light-frag-params.glsl.js +127 -127
  238. package/lib/mol-gl/shader/chunks/matrix-scale.glsl.js +5 -5
  239. package/lib/mol-gl/shader/chunks/normal-frag-params.glsl.js +2 -2
  240. package/lib/mol-gl/shader/chunks/read-from-texture.glsl.js +14 -14
  241. package/lib/mol-gl/shader/chunks/rgba-to-float.glsl.js +84 -84
  242. package/lib/mol-gl/shader/chunks/size-vert-params.glsl.js +11 -11
  243. package/lib/mol-gl/shader/chunks/texture3d-from-1d-trilinear.glsl.js +23 -23
  244. package/lib/mol-gl/shader/chunks/texture3d-from-2d-linear.glsl.js +17 -17
  245. package/lib/mol-gl/shader/chunks/texture3d-from-2d-nearest.glsl.js +8 -8
  246. package/lib/mol-gl/shader/chunks/wboit-write.glsl.js +25 -25
  247. package/lib/mol-gl/shader/compose.frag.js +12 -12
  248. package/lib/mol-gl/shader/compute/color-smoothing/accumulate.frag.js +23 -23
  249. package/lib/mol-gl/shader/compute/color-smoothing/accumulate.vert.js +43 -43
  250. package/lib/mol-gl/shader/compute/color-smoothing/normalize.frag.js +15 -15
  251. package/lib/mol-gl/shader/copy.frag.js +11 -11
  252. package/lib/mol-gl/shader/cylinders.frag.js +266 -266
  253. package/lib/mol-gl/shader/cylinders.vert.js +89 -89
  254. package/lib/mol-gl/shader/depth-merge.frag.js +23 -23
  255. package/lib/mol-gl/shader/direct-volume.frag.js +362 -362
  256. package/lib/mol-gl/shader/direct-volume.vert.js +41 -41
  257. package/lib/mol-gl/shader/dof.frag.d.ts +7 -0
  258. package/lib/mol-gl/shader/dof.frag.js +119 -0
  259. package/lib/mol-gl/shader/evaluate-dpoit.frag.js +10 -10
  260. package/lib/mol-gl/shader/evaluate-wboit.frag.js +17 -17
  261. package/lib/mol-gl/shader/fxaa.frag.js +228 -228
  262. package/lib/mol-gl/shader/gaussian-density.frag.js +49 -49
  263. package/lib/mol-gl/shader/gaussian-density.vert.js +27 -27
  264. package/lib/mol-gl/shader/hi-z.frag.js +18 -18
  265. package/lib/mol-gl/shader/histogram-pyramid/reduction.frag.js +58 -58
  266. package/lib/mol-gl/shader/histogram-pyramid/sum.frag.js +19 -19
  267. package/lib/mol-gl/shader/image.frag.js +169 -169
  268. package/lib/mol-gl/shader/image.vert.js +21 -21
  269. package/lib/mol-gl/shader/lines.frag.js +42 -42
  270. package/lib/mol-gl/shader/lines.vert.js +117 -117
  271. package/lib/mol-gl/shader/marching-cubes/active-voxels.frag.js +70 -70
  272. package/lib/mol-gl/shader/marching-cubes/isosurface.frag.js +311 -311
  273. package/lib/mol-gl/shader/marking/edge.frag.js +28 -28
  274. package/lib/mol-gl/shader/marking/overlay.frag.js +26 -26
  275. package/lib/mol-gl/shader/mesh.frag.js +65 -65
  276. package/lib/mol-gl/shader/mesh.vert.js +49 -49
  277. package/lib/mol-gl/shader/outlines.frag.js +95 -95
  278. package/lib/mol-gl/shader/points.frag.js +59 -59
  279. package/lib/mol-gl/shader/points.vert.js +38 -38
  280. package/lib/mol-gl/shader/postprocessing.frag.js +150 -150
  281. package/lib/mol-gl/shader/quad.vert.js +10 -10
  282. package/lib/mol-gl/shader/shadows.frag.js +123 -123
  283. package/lib/mol-gl/shader/smaa/blend.frag.js +56 -56
  284. package/lib/mol-gl/shader/smaa/blend.vert.js +25 -25
  285. package/lib/mol-gl/shader/smaa/edges.frag.js +66 -66
  286. package/lib/mol-gl/shader/smaa/edges.vert.js +26 -26
  287. package/lib/mol-gl/shader/smaa/weights.frag.js +206 -206
  288. package/lib/mol-gl/shader/smaa/weights.vert.js +32 -32
  289. package/lib/mol-gl/shader/spheres.frag.js +148 -148
  290. package/lib/mol-gl/shader/spheres.vert.js +132 -132
  291. package/lib/mol-gl/shader/ssao-blur.frag.js +97 -97
  292. package/lib/mol-gl/shader/ssao.frag.js +211 -211
  293. package/lib/mol-gl/shader/text.frag.js +85 -85
  294. package/lib/mol-gl/shader/text.vert.js +85 -85
  295. package/lib/mol-gl/shader/util/grid3d-template.frag.js +46 -46
  296. package/lib/mol-gl/shader-code.js +15 -15
  297. package/lib/mol-gl/webgl/compat.js +12 -12
  298. package/lib/mol-gl/webgl/context.js +1 -0
  299. package/lib/mol-gl/webgl/timer.d.ts +1 -1
  300. package/lib/mol-gl/webgl/timer.js +8 -1
  301. package/lib/mol-math/linear-algebra/3d/minimize-rmsd.js +2 -1
  302. package/lib/mol-plugin/animation-loop.d.ts +1 -0
  303. package/lib/mol-plugin/behavior/dynamic/volume-streaming/behavior.d.ts +6 -6
  304. package/lib/mol-plugin/behavior/dynamic/volume-streaming/model.d.ts +1 -1
  305. package/lib/mol-plugin/behavior/dynamic/volume-streaming/transformers.d.ts +3 -3
  306. package/lib/mol-plugin/version.js +2 -2
  307. package/lib/mol-plugin-state/animation/built-in/state-snapshots.js +7 -3
  308. package/lib/mol-plugin-ui/skin/base/base.scss +37 -37
  309. package/lib/mol-plugin-ui/skin/base/components/controls-base.scss +333 -333
  310. package/lib/mol-plugin-ui/skin/base/components/controls.scss +445 -445
  311. package/lib/mol-plugin-ui/skin/base/components/help.scss +27 -27
  312. package/lib/mol-plugin-ui/skin/base/components/line-graph.scss +67 -67
  313. package/lib/mol-plugin-ui/skin/base/components/log.scss +100 -100
  314. package/lib/mol-plugin-ui/skin/base/components/misc.scss +663 -663
  315. package/lib/mol-plugin-ui/skin/base/components/sequence.scss +125 -125
  316. package/lib/mol-plugin-ui/skin/base/components/slider.scss +165 -165
  317. package/lib/mol-plugin-ui/skin/base/components/tasks.scss +99 -99
  318. package/lib/mol-plugin-ui/skin/base/components/toast.scss +83 -83
  319. package/lib/mol-plugin-ui/skin/base/components/transformer.scss +163 -163
  320. package/lib/mol-plugin-ui/skin/base/components/viewport.scss +194 -194
  321. package/lib/mol-plugin-ui/skin/base/layout/common.scss +71 -71
  322. package/lib/mol-plugin-ui/skin/base/layout/controls-landscape.scss +89 -89
  323. package/lib/mol-plugin-ui/skin/base/layout/controls-outside.scss +98 -98
  324. package/lib/mol-plugin-ui/skin/base/layout/controls-portrait.scss +108 -108
  325. package/lib/mol-plugin-ui/skin/base/layout.scss +40 -40
  326. package/lib/mol-plugin-ui/skin/base/logo.scss +12 -12
  327. package/lib/mol-plugin-ui/skin/base/normalize.scss +209 -209
  328. package/lib/mol-plugin-ui/skin/base/ui.scss +40 -40
  329. package/lib/mol-plugin-ui/skin/base/variables.scss +88 -88
  330. package/lib/mol-plugin-ui/skin/blue.scss +1 -1
  331. package/lib/mol-plugin-ui/skin/colors/blue.scss +23 -23
  332. package/lib/mol-plugin-ui/skin/colors/dark.scss +23 -23
  333. package/lib/mol-plugin-ui/skin/colors/light.scss +29 -29
  334. package/lib/mol-plugin-ui/skin/dark.scss +1 -1
  335. package/lib/mol-plugin-ui/skin/light.scss +1 -1
  336. package/lib/mol-plugin-ui/viewport/simple-settings.js +3 -0
  337. package/lib/servers/common/swagger-ui/indexTemplate.js +66 -66
  338. package/lib/servers/volume/config.js +5 -5
  339. package/package.json +196 -195
@@ -1,56 +1,56 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.luminosity_frag = void 0;
4
- exports.luminosity_frag = `
5
- precision highp float;
6
- precision highp int;
7
- precision highp sampler2D;
8
-
9
- uniform sampler2D tColor;
10
- uniform sampler2D tEmissive;
11
- uniform sampler2D tDepth;
12
- uniform vec2 uTexSizeInv;
13
-
14
- uniform vec3 uDefaultColor;
15
- uniform float uDefaultOpacity;
16
- uniform float uLuminosityThreshold;
17
- uniform float uSmoothWidth;
18
-
19
- #include common
20
-
21
- float getDepth(const in vec2 coords) {
22
- #ifdef depthTextureSupport
23
- return texture2D(tDepth, coords).r;
24
- #else
25
- return unpackRGBAToDepth(texture2D(tDepth, coords));
26
- #endif
27
- }
28
-
29
- bool isBackground(const in float depth) {
30
- return depth == 1.0;
31
- }
32
-
33
- void main(void) {
34
- vec2 coords = gl_FragCoord.xy * uTexSizeInv;
35
- vec4 texel = texture2D(tColor, coords);
36
- float emissive = texture2D(tEmissive, coords).a;
37
- float depth = getDepth(coords);
38
-
39
- if (isBackground(depth)) {
40
- gl_FragColor = vec4(0.0, 0.0, 0.0, 0.0);
41
- return;
42
- }
43
-
44
- vec4 outputColor = vec4(uDefaultColor.rgb, uDefaultOpacity);
45
-
46
- #if defined(dMode_luminosity)
47
- vec3 luma = vec3(0.299, 0.587, 0.114);
48
- float v = dot(texel.xyz, luma);
49
- float alpha = smoothstep(uLuminosityThreshold, uLuminosityThreshold + uSmoothWidth, v);
50
-
51
- gl_FragColor = mix(outputColor, texel, alpha);
52
- #elif defined(dMode_emissive)
53
- gl_FragColor = mix(outputColor, texel, emissive);
54
- #endif
55
- }
4
+ exports.luminosity_frag = `
5
+ precision highp float;
6
+ precision highp int;
7
+ precision highp sampler2D;
8
+
9
+ uniform sampler2D tColor;
10
+ uniform sampler2D tEmissive;
11
+ uniform sampler2D tDepth;
12
+ uniform vec2 uTexSizeInv;
13
+
14
+ uniform vec3 uDefaultColor;
15
+ uniform float uDefaultOpacity;
16
+ uniform float uLuminosityThreshold;
17
+ uniform float uSmoothWidth;
18
+
19
+ #include common
20
+
21
+ float getDepth(const in vec2 coords) {
22
+ #ifdef depthTextureSupport
23
+ return texture2D(tDepth, coords).r;
24
+ #else
25
+ return unpackRGBAToDepth(texture2D(tDepth, coords));
26
+ #endif
27
+ }
28
+
29
+ bool isBackground(const in float depth) {
30
+ return depth == 1.0;
31
+ }
32
+
33
+ void main(void) {
34
+ vec2 coords = gl_FragCoord.xy * uTexSizeInv;
35
+ vec4 texel = texture2D(tColor, coords);
36
+ float emissive = texture2D(tEmissive, coords).a;
37
+ float depth = getDepth(coords);
38
+
39
+ if (isBackground(depth)) {
40
+ gl_FragColor = vec4(0.0, 0.0, 0.0, 0.0);
41
+ return;
42
+ }
43
+
44
+ vec4 outputColor = vec4(uDefaultColor.rgb, uDefaultOpacity);
45
+
46
+ #if defined(dMode_luminosity)
47
+ vec3 luma = vec3(0.299, 0.587, 0.114);
48
+ float v = dot(texel.xyz, luma);
49
+ float alpha = smoothstep(uLuminosityThreshold, uLuminosityThreshold + uSmoothWidth, v);
50
+
51
+ gl_FragColor = mix(outputColor, texel, alpha);
52
+ #elif defined(dMode_emissive)
53
+ gl_FragColor = mix(outputColor, texel, emissive);
54
+ #endif
55
+ }
56
56
  `;
@@ -1,148 +1,148 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.cas_frag = void 0;
4
- exports.cas_frag = `
5
- precision mediump float;
6
- precision mediump sampler2D;
7
-
8
- uniform sampler2D tColor;
9
- uniform vec2 uTexSizeInv;
10
-
11
- uniform float uSharpness;
12
-
13
- // adapted from https://www.shadertoy.com/view/stXSWB
14
-
15
- /*
16
- * FidelityFX Super Resolution scales up a low resolution
17
- * image, while adding fine detail.
18
- *
19
- * MIT Open License
20
- *
21
- * https://gpuopen.com/fsr
22
- *
23
- * Left: FSR processed
24
- * Right: Original texture, bilinear interpolation
25
- *
26
- * Mouse at top: Sharpness 0 stops (maximum)
27
- * Mouse at bottom: Sharpness 2 stops (minimum)
28
- *
29
- * It works in two passes-
30
- * EASU upsamples the image with a clamped Lanczos kernel.
31
- * RCAS sharpens the image at the target resolution.
32
- *
33
- * I needed to make a few changes to improve readability and
34
- * WebGL compatibility in an algorithm I don't fully understand.
35
- * Expect bugs.
36
- *
37
- * Shader not currently running for WebGL1 targets (eg. mobile Safari)
38
- *
39
- * There is kind of no point to using FSR in Shadertoy, as it renders buffers
40
- * at full target resolution. But this might be useful for WebGL based demos
41
- * running smaller-than-target render buffers.
42
- *
43
- * For sharpening with a full resolution render buffer,
44
- * FidelityFX CAS is a better option.
45
- * https://www.shadertoy.com/view/ftsXzM
46
- *
47
- * For readability and compatibility, these optimisations have been removed:
48
- * * Fast approximate inverse and inversesqrt
49
- * * textureGather fetches (not WebGL compatible)
50
- * * Multiplying by reciprocal instead of division
51
- *
52
- * Apologies to AMD for the numerous slowdowns and errors I have introduced.
53
- *
54
- */
55
-
56
- /***** RCAS *****/
57
- #define FSR_RCAS_LIMIT (0.25-(1.0/16.0))
58
-
59
- // Input callback prototypes that need to be implemented by calling shader
60
- vec4 FsrRcasLoadF(vec2 p);
61
- //------------------------------------------------------------------------------------------------------------------------------
62
- void FsrRcasCon(
63
- out float con,
64
- // The scale is {0.0 := maximum, to N>0, where N is the number of stops (halving) of the reduction of sharpness}.
65
- float sharpness
66
- ) {
67
- // Transform from stops to linear value.
68
- con = exp2(-sharpness);
69
- }
70
-
71
- vec3 FsrRcasF(
72
- vec2 ip, // Integer pixel position in output.
73
- float con
74
- ) {
75
- // Constant generated by RcasSetup().
76
- // Algorithm uses minimal 3x3 pixel neighborhood.
77
- // b
78
- // d e f
79
- // h
80
- vec2 sp = vec2(ip);
81
- vec3 b = FsrRcasLoadF(sp + vec2( 0,-1)).rgb;
82
- vec3 d = FsrRcasLoadF(sp + vec2(-1, 0)).rgb;
83
- vec3 e = FsrRcasLoadF(sp).rgb;
84
- vec3 f = FsrRcasLoadF(sp + vec2( 1, 0)).rgb;
85
- vec3 h = FsrRcasLoadF(sp + vec2( 0, 1)).rgb;
86
-
87
- // Luma times 2.
88
- float bL = b.g + .5 * (b.b + b.r);
89
- float dL = d.g + .5 * (d.b + d.r);
90
- float eL = e.g + .5 * (e.b + e.r);
91
- float fL = f.g + .5 * (f.b + f.r);
92
- float hL = h.g + .5 * (h.b + h.r);
93
-
94
- // Noise detection.
95
- #ifdef dDenoise
96
- float nz = .25 * (bL + dL + fL + hL) - eL;
97
- nz=clamp(
98
- abs(nz)
99
- /(
100
- max(max(bL,dL),max(eL,max(fL,hL)))
101
- -min(min(bL,dL),min(eL,min(fL,hL)))
102
- ),
103
- 0., 1.
104
- );
105
- nz=1.-.5*nz;
106
- #endif
107
-
108
- // Min and max of ring.
109
- vec3 mn4 = min(b, min(f, h));
110
- vec3 mx4 = max(b, max(f, h));
111
-
112
- // Immediate constants for peak range.
113
- vec2 peakC = vec2(1., -4.);
114
-
115
- // Limiters, these need to be high precision RCPs.
116
- vec3 hitMin = mn4 / (4. * mx4);
117
- vec3 hitMax = (peakC.x - mx4) / (4.* mn4 + peakC.y);
118
- vec3 lobeRGB = max(-hitMin, hitMax);
119
- float lobe = max(
120
- -FSR_RCAS_LIMIT,
121
- min(max(lobeRGB.r, max(lobeRGB.g, lobeRGB.b)), 0.)
122
- )*con;
123
-
124
- // Apply noise removal.
125
- #ifdef dDenoise
126
- lobe *= nz;
127
- #endif
128
-
129
- // Resolve, which needs the medium precision rcp approximation to avoid visible tonality changes.
130
- return (lobe * (b + d + h + f) + e) / (4. * lobe + 1.);
131
- }
132
-
133
-
134
- vec4 FsrRcasLoadF(vec2 p) {
135
- return texture2D(tColor, p * uTexSizeInv);
136
- }
137
-
138
- void main() {
139
- // Set up constants
140
- float con;
141
- FsrRcasCon(con, uSharpness);
142
-
143
- // Perform RCAS pass
144
- vec3 col = FsrRcasF(gl_FragCoord.xy, con);
145
-
146
- gl_FragColor = vec4(col, FsrRcasLoadF(gl_FragCoord.xy).a);
147
- }
4
+ exports.cas_frag = `
5
+ precision mediump float;
6
+ precision mediump sampler2D;
7
+
8
+ uniform sampler2D tColor;
9
+ uniform vec2 uTexSizeInv;
10
+
11
+ uniform float uSharpness;
12
+
13
+ // adapted from https://www.shadertoy.com/view/stXSWB
14
+
15
+ /*
16
+ * FidelityFX Super Resolution scales up a low resolution
17
+ * image, while adding fine detail.
18
+ *
19
+ * MIT Open License
20
+ *
21
+ * https://gpuopen.com/fsr
22
+ *
23
+ * Left: FSR processed
24
+ * Right: Original texture, bilinear interpolation
25
+ *
26
+ * Mouse at top: Sharpness 0 stops (maximum)
27
+ * Mouse at bottom: Sharpness 2 stops (minimum)
28
+ *
29
+ * It works in two passes-
30
+ * EASU upsamples the image with a clamped Lanczos kernel.
31
+ * RCAS sharpens the image at the target resolution.
32
+ *
33
+ * I needed to make a few changes to improve readability and
34
+ * WebGL compatibility in an algorithm I don't fully understand.
35
+ * Expect bugs.
36
+ *
37
+ * Shader not currently running for WebGL1 targets (eg. mobile Safari)
38
+ *
39
+ * There is kind of no point to using FSR in Shadertoy, as it renders buffers
40
+ * at full target resolution. But this might be useful for WebGL based demos
41
+ * running smaller-than-target render buffers.
42
+ *
43
+ * For sharpening with a full resolution render buffer,
44
+ * FidelityFX CAS is a better option.
45
+ * https://www.shadertoy.com/view/ftsXzM
46
+ *
47
+ * For readability and compatibility, these optimisations have been removed:
48
+ * * Fast approximate inverse and inversesqrt
49
+ * * textureGather fetches (not WebGL compatible)
50
+ * * Multiplying by reciprocal instead of division
51
+ *
52
+ * Apologies to AMD for the numerous slowdowns and errors I have introduced.
53
+ *
54
+ */
55
+
56
+ /***** RCAS *****/
57
+ #define FSR_RCAS_LIMIT (0.25-(1.0/16.0))
58
+
59
+ // Input callback prototypes that need to be implemented by calling shader
60
+ vec4 FsrRcasLoadF(vec2 p);
61
+ //------------------------------------------------------------------------------------------------------------------------------
62
+ void FsrRcasCon(
63
+ out float con,
64
+ // The scale is {0.0 := maximum, to N>0, where N is the number of stops (halving) of the reduction of sharpness}.
65
+ float sharpness
66
+ ) {
67
+ // Transform from stops to linear value.
68
+ con = exp2(-sharpness);
69
+ }
70
+
71
+ vec3 FsrRcasF(
72
+ vec2 ip, // Integer pixel position in output.
73
+ float con
74
+ ) {
75
+ // Constant generated by RcasSetup().
76
+ // Algorithm uses minimal 3x3 pixel neighborhood.
77
+ // b
78
+ // d e f
79
+ // h
80
+ vec2 sp = vec2(ip);
81
+ vec3 b = FsrRcasLoadF(sp + vec2( 0,-1)).rgb;
82
+ vec3 d = FsrRcasLoadF(sp + vec2(-1, 0)).rgb;
83
+ vec3 e = FsrRcasLoadF(sp).rgb;
84
+ vec3 f = FsrRcasLoadF(sp + vec2( 1, 0)).rgb;
85
+ vec3 h = FsrRcasLoadF(sp + vec2( 0, 1)).rgb;
86
+
87
+ // Luma times 2.
88
+ float bL = b.g + .5 * (b.b + b.r);
89
+ float dL = d.g + .5 * (d.b + d.r);
90
+ float eL = e.g + .5 * (e.b + e.r);
91
+ float fL = f.g + .5 * (f.b + f.r);
92
+ float hL = h.g + .5 * (h.b + h.r);
93
+
94
+ // Noise detection.
95
+ #ifdef dDenoise
96
+ float nz = .25 * (bL + dL + fL + hL) - eL;
97
+ nz=clamp(
98
+ abs(nz)
99
+ /(
100
+ max(max(bL,dL),max(eL,max(fL,hL)))
101
+ -min(min(bL,dL),min(eL,min(fL,hL)))
102
+ ),
103
+ 0., 1.
104
+ );
105
+ nz=1.-.5*nz;
106
+ #endif
107
+
108
+ // Min and max of ring.
109
+ vec3 mn4 = min(b, min(f, h));
110
+ vec3 mx4 = max(b, max(f, h));
111
+
112
+ // Immediate constants for peak range.
113
+ vec2 peakC = vec2(1., -4.);
114
+
115
+ // Limiters, these need to be high precision RCPs.
116
+ vec3 hitMin = mn4 / (4. * mx4);
117
+ vec3 hitMax = (peakC.x - mx4) / (4.* mn4 + peakC.y);
118
+ vec3 lobeRGB = max(-hitMin, hitMax);
119
+ float lobe = max(
120
+ -FSR_RCAS_LIMIT,
121
+ min(max(lobeRGB.r, max(lobeRGB.g, lobeRGB.b)), 0.)
122
+ )*con;
123
+
124
+ // Apply noise removal.
125
+ #ifdef dDenoise
126
+ lobe *= nz;
127
+ #endif
128
+
129
+ // Resolve, which needs the medium precision rcp approximation to avoid visible tonality changes.
130
+ return (lobe * (b + d + h + f) + e) / (4. * lobe + 1.);
131
+ }
132
+
133
+
134
+ vec4 FsrRcasLoadF(vec2 p) {
135
+ return texture2D(tColor, p * uTexSizeInv);
136
+ }
137
+
138
+ void main() {
139
+ // Set up constants
140
+ float con;
141
+ FsrRcasCon(con, uSharpness);
142
+
143
+ // Perform RCAS pass
144
+ vec3 col = FsrRcasF(gl_FragCoord.xy, con);
145
+
146
+ gl_FragColor = vec4(col, FsrRcasLoadF(gl_FragCoord.xy).a);
147
+ }
148
148
  `;
@@ -1,35 +1,35 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.apply_fog = void 0;
4
- exports.apply_fog = `
5
- float preFogAlpha = gl_FragColor.a;
6
- if (uFog) {
7
- float viewZ = depthToViewZ(uIsOrtho, fragmentDepth, uNear, uFar);
8
- float fogFactor = smoothstep(uFogNear, uFogFar, abs(viewZ));
9
- float fogAlpha = (1.0 - fogFactor) * gl_FragColor.a;
10
- if (!uTransparentBackground) {
11
- if (gl_FragColor.a < 1.0) {
12
- // transparent objects are blended with background color
13
- gl_FragColor.a = fogAlpha;
14
- } else {
15
- // mix opaque objects with background color
16
- gl_FragColor.rgb = mix(gl_FragColor.rgb, uFogColor, fogFactor);
17
- }
18
- } else {
19
- #if defined(dRenderVariant_colorDpoit)
20
- if (gl_FragColor.a < 1.0) {
21
- // transparent objects are blended with background color
22
- gl_FragColor.a = fogAlpha;
23
- } else {
24
- // opaque objects need to be pre-multiplied alpha
25
- gl_FragColor.rgb *= fogAlpha;
26
- gl_FragColor.a = fogAlpha;
27
- }
28
- #else
29
- // pre-multiplied alpha expected for transparent background
30
- gl_FragColor.rgb *= fogAlpha;
31
- gl_FragColor.a = fogAlpha;
32
- #endif
33
- }
34
- }
4
+ exports.apply_fog = `
5
+ float preFogAlpha = gl_FragColor.a;
6
+ if (uFog) {
7
+ float viewZ = depthToViewZ(uIsOrtho, fragmentDepth, uNear, uFar);
8
+ float fogFactor = smoothstep(uFogNear, uFogFar, abs(viewZ));
9
+ float fogAlpha = (1.0 - fogFactor) * gl_FragColor.a;
10
+ if (!uTransparentBackground) {
11
+ if (gl_FragColor.a < 1.0) {
12
+ // transparent objects are blended with background color
13
+ gl_FragColor.a = fogAlpha;
14
+ } else {
15
+ // mix opaque objects with background color
16
+ gl_FragColor.rgb = mix(gl_FragColor.rgb, uFogColor, fogFactor);
17
+ }
18
+ } else {
19
+ #if defined(dRenderVariant_colorDpoit)
20
+ if (gl_FragColor.a < 1.0) {
21
+ // transparent objects are blended with background color
22
+ gl_FragColor.a = fogAlpha;
23
+ } else {
24
+ // opaque objects need to be pre-multiplied alpha
25
+ gl_FragColor.rgb *= fogAlpha;
26
+ gl_FragColor.a = fogAlpha;
27
+ }
28
+ #else
29
+ // pre-multiplied alpha expected for transparent background
30
+ gl_FragColor.rgb *= fogAlpha;
31
+ gl_FragColor.a = fogAlpha;
32
+ #endif
33
+ }
34
+ }
35
35
  `;
@@ -1,16 +1,16 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.apply_interior_color = void 0;
4
- exports.apply_interior_color = `
5
- if (interior) {
6
- if (uInteriorColorFlag) {
7
- gl_FragColor.rgb = uInteriorColor;
8
- } else {
9
- gl_FragColor.rgb *= 1.0 - uInteriorDarkening;
10
- }
11
-
12
- #ifdef dTransparentBackfaces_opaque
13
- gl_FragColor.a = 1.0;
14
- #endif
15
- }
4
+ exports.apply_interior_color = `
5
+ if (interior) {
6
+ if (uInteriorColorFlag) {
7
+ gl_FragColor.rgb = uInteriorColor;
8
+ } else {
9
+ gl_FragColor.rgb *= 1.0 - uInteriorDarkening;
10
+ }
11
+
12
+ #ifdef dTransparentBackfaces_opaque
13
+ gl_FragColor.a = 1.0;
14
+ #endif
15
+ }
16
16
  `;
@@ -9,81 +9,81 @@
9
9
  */
10
10
  Object.defineProperty(exports, "__esModule", { value: true });
11
11
  exports.apply_light_color = void 0;
12
- exports.apply_light_color = `
13
- #if defined(dIgnoreLight)
14
- #ifdef bumpEnabled
15
- if (uBumpFrequency > 0.0 && uBumpAmplitude > 0.0 && bumpiness > 0.0) {
16
- material.rgb += fbm(vModelPosition * uBumpFrequency) * uBumpAmplitude * bumpiness;
17
- material.rgb -= 0.5 * uBumpAmplitude * bumpiness;
18
- }
19
- #endif
20
-
21
- #if defined(dRenderVariant_color)
22
- material.rgb += material.rgb * emissive;
23
- #endif
24
-
25
- gl_FragColor = material;
26
- #else
27
- #ifdef bumpEnabled
28
- if (uBumpFrequency > 0.0 && uBumpAmplitude > 0.0 && bumpiness > 0.0) {
29
- normal = perturbNormal(-vViewPosition, normal, fbm(vModelPosition * uBumpFrequency), (uBumpAmplitude * bumpiness) / uBumpFrequency);
30
- }
31
- #endif
32
-
33
- vec4 color = material;
34
-
35
- ReflectedLight reflectedLight = ReflectedLight(vec3(0.0), vec3(0.0), vec3(0.0), vec3(0.0));
36
-
37
- PhysicalMaterial physicalMaterial;
38
- physicalMaterial.diffuseColor = color.rgb * (1.0 - metalness);
39
- #ifdef enabledFragDepth
40
- physicalMaterial.roughness = min(max(roughness, 0.0525), 1.0);
41
- #else
42
- vec3 dxy = max(abs(dFdx(normal)), abs(dFdy(normal)));
43
- float geometryRoughness = max(max(dxy.x, dxy.y), dxy.z);
44
- physicalMaterial.roughness = min(max(roughness, 0.0525) + geometryRoughness, 1.0);
45
- #endif
46
- physicalMaterial.specularColor = mix(vec3(0.04), color.rgb, metalness);
47
- physicalMaterial.specularF90 = 1.0;
48
-
49
- GeometricContext geometry;
50
- geometry.position = -vViewPosition;
51
- geometry.normal = normal;
52
- geometry.viewDir = normalize(vViewPosition);
53
-
54
- IncidentLight directLight;
55
- #pragma unroll_loop_start
56
- for (int i = 0; i < dLightCount; ++i) {
57
- directLight.direction = uLightDirection[i];
58
- directLight.color = uLightColor[i] * PI; // * PI for punctual light
59
- RE_Direct_Physical(directLight, geometry, physicalMaterial, reflectedLight);
60
- }
61
- #pragma unroll_loop_end
62
-
63
- vec3 irradiance = uAmbientColor * PI; // * PI for punctual light
64
- RE_IndirectDiffuse_Physical(irradiance, geometry, physicalMaterial, reflectedLight);
65
-
66
- // indirect specular only metals
67
- vec3 radiance = uAmbientColor * metalness;
68
- vec3 iblIrradiance = uAmbientColor * metalness;
69
- vec3 clearcoatRadiance = vec3(0.0);
70
- RE_IndirectSpecular_Physical(radiance, iblIrradiance, clearcoatRadiance, geometry, physicalMaterial, reflectedLight);
71
-
72
- vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular;
73
- outgoingLight = clamp(outgoingLight, 0.01, 0.99); // prevents black artifacts on specular highlight with transparent background
74
-
75
- #if defined(dRenderVariant_color)
76
- outgoingLight += color.rgb * emissive;
77
- #endif
78
-
79
- gl_FragColor = vec4(outgoingLight, color.a);
80
- #endif
81
-
82
- #if defined(dXrayShaded_on)
83
- gl_FragColor.a *= 1.0 - pow(abs(dot(normal, vec3(0.0, 0.0, 1.0))), uXrayEdgeFalloff);
84
- #elif defined(dXrayShaded_inverted)
85
- gl_FragColor.a *= pow(abs(dot(normal, vec3(0.0, 0.0, 1.0))), uXrayEdgeFalloff);
86
- #endif
87
-
88
- gl_FragColor.rgb *= uExposure;
12
+ exports.apply_light_color = `
13
+ #if defined(dIgnoreLight)
14
+ #ifdef bumpEnabled
15
+ if (uBumpFrequency > 0.0 && uBumpAmplitude > 0.0 && bumpiness > 0.0) {
16
+ material.rgb += fbm(vModelPosition * uBumpFrequency) * uBumpAmplitude * bumpiness;
17
+ material.rgb -= 0.5 * uBumpAmplitude * bumpiness;
18
+ }
19
+ #endif
20
+
21
+ #if defined(dRenderVariant_color)
22
+ material.rgb += material.rgb * emissive;
23
+ #endif
24
+
25
+ gl_FragColor = material;
26
+ #else
27
+ #ifdef bumpEnabled
28
+ if (uBumpFrequency > 0.0 && uBumpAmplitude > 0.0 && bumpiness > 0.0) {
29
+ normal = perturbNormal(-vViewPosition, normal, fbm(vModelPosition * uBumpFrequency), (uBumpAmplitude * bumpiness) / uBumpFrequency);
30
+ }
31
+ #endif
32
+
33
+ vec4 color = material;
34
+
35
+ ReflectedLight reflectedLight = ReflectedLight(vec3(0.0), vec3(0.0), vec3(0.0), vec3(0.0));
36
+
37
+ PhysicalMaterial physicalMaterial;
38
+ physicalMaterial.diffuseColor = color.rgb * (1.0 - metalness);
39
+ #ifdef enabledFragDepth
40
+ physicalMaterial.roughness = min(max(roughness, 0.0525), 1.0);
41
+ #else
42
+ vec3 dxy = max(abs(dFdx(normal)), abs(dFdy(normal)));
43
+ float geometryRoughness = max(max(dxy.x, dxy.y), dxy.z);
44
+ physicalMaterial.roughness = min(max(roughness, 0.0525) + geometryRoughness, 1.0);
45
+ #endif
46
+ physicalMaterial.specularColor = mix(vec3(0.04), color.rgb, metalness);
47
+ physicalMaterial.specularF90 = 1.0;
48
+
49
+ GeometricContext geometry;
50
+ geometry.position = -vViewPosition;
51
+ geometry.normal = normal;
52
+ geometry.viewDir = normalize(vViewPosition);
53
+
54
+ IncidentLight directLight;
55
+ #pragma unroll_loop_start
56
+ for (int i = 0; i < dLightCount; ++i) {
57
+ directLight.direction = uLightDirection[i];
58
+ directLight.color = uLightColor[i] * PI; // * PI for punctual light
59
+ RE_Direct_Physical(directLight, geometry, physicalMaterial, reflectedLight);
60
+ }
61
+ #pragma unroll_loop_end
62
+
63
+ vec3 irradiance = uAmbientColor * PI; // * PI for punctual light
64
+ RE_IndirectDiffuse_Physical(irradiance, geometry, physicalMaterial, reflectedLight);
65
+
66
+ // indirect specular only metals
67
+ vec3 radiance = uAmbientColor * metalness;
68
+ vec3 iblIrradiance = uAmbientColor * metalness;
69
+ vec3 clearcoatRadiance = vec3(0.0);
70
+ RE_IndirectSpecular_Physical(radiance, iblIrradiance, clearcoatRadiance, geometry, physicalMaterial, reflectedLight);
71
+
72
+ vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular;
73
+ outgoingLight = clamp(outgoingLight, 0.01, 0.99); // prevents black artifacts on specular highlight with transparent background
74
+
75
+ #if defined(dRenderVariant_color)
76
+ outgoingLight += color.rgb * emissive;
77
+ #endif
78
+
79
+ gl_FragColor = vec4(outgoingLight, color.a);
80
+ #endif
81
+
82
+ #if defined(dXrayShaded_on)
83
+ gl_FragColor.a *= 1.0 - pow(abs(dot(normal, vec3(0.0, 0.0, 1.0))), uXrayEdgeFalloff);
84
+ #elif defined(dXrayShaded_inverted)
85
+ gl_FragColor.a *= pow(abs(dot(normal, vec3(0.0, 0.0, 1.0))), uXrayEdgeFalloff);
86
+ #endif
87
+
88
+ gl_FragColor.rgb *= uExposure;
89
89
  `;