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.
- package/LICENSE +20 -20
- package/README.md +197 -197
- package/build/viewer/embedded.html +52 -52
- package/build/viewer/index.html +129 -129
- package/build/viewer/molstar.js +1 -1
- package/build/viewer/molstar.js.LICENSE.txt +9 -0
- package/lib/apps/docking-viewer/index.html +36 -36
- package/lib/apps/mesoscale-explorer/index.html +100 -100
- package/lib/apps/mesoscale-explorer/style.scss +33 -33
- package/lib/apps/viewer/app.d.ts +2 -1
- package/lib/apps/viewer/app.js +2 -1
- package/lib/apps/viewer/embedded.html +52 -52
- package/lib/apps/viewer/index.html +129 -129
- package/lib/cli/chem-comp-dict/create-ions.js +9 -9
- package/lib/cli/chem-comp-dict/create-saccharides.js +9 -9
- package/lib/cli/cifschema/util/generate.js +12 -12
- package/lib/cli/lipid-params/index.js +9 -9
- package/lib/commonjs/apps/viewer/app.d.ts +2 -1
- package/lib/commonjs/apps/viewer/app.js +1 -0
- package/lib/commonjs/cli/chem-comp-dict/create-ions.js +9 -9
- package/lib/commonjs/cli/chem-comp-dict/create-saccharides.js +9 -9
- package/lib/commonjs/cli/cifschema/util/generate.js +12 -12
- package/lib/commonjs/cli/lipid-params/index.js +9 -9
- package/lib/commonjs/examples/alpha-orbitals/example-data.js +160 -160
- package/lib/commonjs/extensions/alpha-orbitals/gpu/shader.frag.js +136 -136
- package/lib/commonjs/extensions/assembly-symmetry/prop.js +24 -24
- package/lib/commonjs/extensions/dnatco/confal-pyramids/behavior.js +5 -5
- package/lib/commonjs/extensions/dnatco/ntc-tube/behavior.js +5 -5
- package/lib/commonjs/extensions/geo-export/usdz-exporter.js +41 -41
- package/lib/commonjs/extensions/meshes/mesh-extension.d.ts +1 -0
- package/lib/commonjs/extensions/mp4-export/encoder.js +1 -1
- package/lib/commonjs/extensions/mvs/components/annotation-label/representation.d.ts +0 -2
- package/lib/commonjs/extensions/mvs/components/custom-label/representation.d.ts +2 -2
- package/lib/commonjs/extensions/mvs/tree/mvs/mvs-builder.d.ts +8 -2
- package/lib/commonjs/extensions/sb-ncbr/index.d.ts +8 -0
- package/lib/commonjs/extensions/sb-ncbr/index.js +14 -1
- package/lib/commonjs/extensions/sb-ncbr/tunnels/actions.d.ts +20 -0
- package/lib/commonjs/extensions/sb-ncbr/tunnels/actions.js +89 -0
- package/lib/commonjs/extensions/sb-ncbr/tunnels/algorithm.d.ts +26 -0
- package/lib/commonjs/extensions/sb-ncbr/tunnels/algorithm.js +474 -0
- package/lib/commonjs/extensions/sb-ncbr/tunnels/behavior.d.ts +40 -0
- package/lib/commonjs/extensions/sb-ncbr/tunnels/behavior.js +96 -0
- package/lib/commonjs/extensions/sb-ncbr/tunnels/data-model.d.ts +146 -0
- package/lib/commonjs/extensions/sb-ncbr/tunnels/data-model.js +28 -0
- package/lib/commonjs/extensions/sb-ncbr/tunnels/examples.d.ts +12 -0
- package/lib/commonjs/extensions/sb-ncbr/tunnels/examples.js +54 -0
- package/lib/commonjs/extensions/sb-ncbr/tunnels/props.d.ts +19 -0
- package/lib/commonjs/extensions/sb-ncbr/tunnels/props.js +26 -0
- package/lib/commonjs/extensions/sb-ncbr/tunnels/representation.d.ts +29 -0
- package/lib/commonjs/extensions/sb-ncbr/tunnels/representation.js +99 -0
- package/lib/commonjs/mol-canvas3d/canvas3d.d.ts +17 -0
- package/lib/commonjs/mol-canvas3d/canvas3d.js +4 -0
- package/lib/commonjs/mol-canvas3d/passes/dof.d.ts +34 -0
- package/lib/commonjs/mol-canvas3d/passes/dof.js +167 -0
- package/lib/commonjs/mol-canvas3d/passes/draw.d.ts +2 -0
- package/lib/commonjs/mol-canvas3d/passes/draw.js +31 -8
- package/lib/commonjs/mol-canvas3d/passes/image.d.ts +8 -0
- package/lib/commonjs/mol-canvas3d/passes/postprocessing.d.ts +8 -0
- package/lib/commonjs/mol-canvas3d/passes/postprocessing.js +5 -0
- package/lib/commonjs/mol-geo/geometry/lines/lines.d.ts +0 -1
- package/lib/commonjs/mol-gl/shader/background.frag.js +95 -95
- package/lib/commonjs/mol-gl/shader/background.vert.js +11 -11
- package/lib/commonjs/mol-gl/shader/blend-back-dpoit.frag.js +13 -13
- package/lib/commonjs/mol-gl/shader/bloom/blur.frag.js +28 -28
- package/lib/commonjs/mol-gl/shader/bloom/composite.frag.js +33 -33
- package/lib/commonjs/mol-gl/shader/bloom/luminosity.frag.js +52 -52
- package/lib/commonjs/mol-gl/shader/cas.frag.js +144 -144
- package/lib/commonjs/mol-gl/shader/chunks/apply-fog.glsl.js +31 -31
- package/lib/commonjs/mol-gl/shader/chunks/apply-interior-color.glsl.js +12 -12
- package/lib/commonjs/mol-gl/shader/chunks/apply-light-color.glsl.js +77 -77
- package/lib/commonjs/mol-gl/shader/chunks/apply-marker-color.glsl.js +16 -16
- package/lib/commonjs/mol-gl/shader/chunks/assign-clipping-varying.glsl.js +8 -8
- package/lib/commonjs/mol-gl/shader/chunks/assign-color-varying.glsl.js +140 -140
- package/lib/commonjs/mol-gl/shader/chunks/assign-group.glsl.js +6 -6
- package/lib/commonjs/mol-gl/shader/chunks/assign-marker-varying.glsl.js +8 -8
- package/lib/commonjs/mol-gl/shader/chunks/assign-material-color.glsl.js +112 -112
- package/lib/commonjs/mol-gl/shader/chunks/assign-position.glsl.js +14 -14
- package/lib/commonjs/mol-gl/shader/chunks/assign-size.glsl.js +18 -18
- package/lib/commonjs/mol-gl/shader/chunks/check-picking-alpha.glsl.js +12 -12
- package/lib/commonjs/mol-gl/shader/chunks/check-transparency.glsl.js +16 -16
- package/lib/commonjs/mol-gl/shader/chunks/clip-instance.glsl.js +7 -7
- package/lib/commonjs/mol-gl/shader/chunks/clip-pixel.glsl.js +5 -5
- package/lib/commonjs/mol-gl/shader/chunks/color-frag-params.glsl.js +60 -60
- package/lib/commonjs/mol-gl/shader/chunks/color-vert-params.glsl.js +122 -122
- package/lib/commonjs/mol-gl/shader/chunks/common-clip.glsl.js +104 -104
- package/lib/commonjs/mol-gl/shader/chunks/common-frag-params.glsl.js +150 -150
- package/lib/commonjs/mol-gl/shader/chunks/common-vert-params.glsl.js +61 -61
- package/lib/commonjs/mol-gl/shader/chunks/common.glsl.js +234 -234
- package/lib/commonjs/mol-gl/shader/chunks/dpoit-write.glsl.js +62 -62
- package/lib/commonjs/mol-gl/shader/chunks/fade-lod.glsl.js +42 -42
- package/lib/commonjs/mol-gl/shader/chunks/float-to-rgba.glsl.js +39 -39
- package/lib/commonjs/mol-gl/shader/chunks/light-frag-params.glsl.js +127 -127
- package/lib/commonjs/mol-gl/shader/chunks/matrix-scale.glsl.js +5 -5
- package/lib/commonjs/mol-gl/shader/chunks/normal-frag-params.glsl.js +2 -2
- package/lib/commonjs/mol-gl/shader/chunks/read-from-texture.glsl.js +14 -14
- package/lib/commonjs/mol-gl/shader/chunks/rgba-to-float.glsl.js +84 -84
- package/lib/commonjs/mol-gl/shader/chunks/size-vert-params.glsl.js +11 -11
- package/lib/commonjs/mol-gl/shader/chunks/texture3d-from-1d-trilinear.glsl.js +23 -23
- package/lib/commonjs/mol-gl/shader/chunks/texture3d-from-2d-linear.glsl.js +17 -17
- package/lib/commonjs/mol-gl/shader/chunks/texture3d-from-2d-nearest.glsl.js +8 -8
- package/lib/commonjs/mol-gl/shader/chunks/wboit-write.glsl.js +25 -25
- package/lib/commonjs/mol-gl/shader/compose.frag.js +12 -12
- package/lib/commonjs/mol-gl/shader/compute/color-smoothing/accumulate.frag.js +23 -23
- package/lib/commonjs/mol-gl/shader/compute/color-smoothing/accumulate.vert.js +43 -43
- package/lib/commonjs/mol-gl/shader/compute/color-smoothing/normalize.frag.js +15 -15
- package/lib/commonjs/mol-gl/shader/copy.frag.js +11 -11
- package/lib/commonjs/mol-gl/shader/cylinders.frag.js +266 -266
- package/lib/commonjs/mol-gl/shader/cylinders.vert.js +89 -89
- package/lib/commonjs/mol-gl/shader/depth-merge.frag.js +23 -23
- package/lib/commonjs/mol-gl/shader/direct-volume.frag.js +362 -362
- package/lib/commonjs/mol-gl/shader/direct-volume.vert.js +41 -41
- package/lib/commonjs/mol-gl/shader/dof.frag.d.ts +7 -0
- package/lib/commonjs/mol-gl/shader/dof.frag.js +122 -0
- package/lib/commonjs/mol-gl/shader/evaluate-dpoit.frag.js +10 -10
- package/lib/commonjs/mol-gl/shader/evaluate-wboit.frag.js +17 -17
- package/lib/commonjs/mol-gl/shader/fxaa.frag.js +228 -228
- package/lib/commonjs/mol-gl/shader/gaussian-density.frag.js +49 -49
- package/lib/commonjs/mol-gl/shader/gaussian-density.vert.js +27 -27
- package/lib/commonjs/mol-gl/shader/hi-z.frag.js +18 -18
- package/lib/commonjs/mol-gl/shader/histogram-pyramid/reduction.frag.js +58 -58
- package/lib/commonjs/mol-gl/shader/histogram-pyramid/sum.frag.js +19 -19
- package/lib/commonjs/mol-gl/shader/image.frag.js +169 -169
- package/lib/commonjs/mol-gl/shader/image.vert.js +21 -21
- package/lib/commonjs/mol-gl/shader/lines.frag.js +42 -42
- package/lib/commonjs/mol-gl/shader/lines.vert.js +117 -117
- package/lib/commonjs/mol-gl/shader/marching-cubes/active-voxels.frag.js +70 -70
- package/lib/commonjs/mol-gl/shader/marching-cubes/isosurface.frag.js +311 -311
- package/lib/commonjs/mol-gl/shader/marking/edge.frag.js +28 -28
- package/lib/commonjs/mol-gl/shader/marking/overlay.frag.js +26 -26
- package/lib/commonjs/mol-gl/shader/mesh.frag.js +65 -65
- package/lib/commonjs/mol-gl/shader/mesh.vert.js +49 -49
- package/lib/commonjs/mol-gl/shader/outlines.frag.js +95 -95
- package/lib/commonjs/mol-gl/shader/points.frag.js +59 -59
- package/lib/commonjs/mol-gl/shader/points.vert.js +38 -38
- package/lib/commonjs/mol-gl/shader/postprocessing.frag.js +150 -150
- package/lib/commonjs/mol-gl/shader/quad.vert.js +10 -10
- package/lib/commonjs/mol-gl/shader/shadows.frag.js +123 -123
- package/lib/commonjs/mol-gl/shader/smaa/blend.frag.js +56 -56
- package/lib/commonjs/mol-gl/shader/smaa/blend.vert.js +25 -25
- package/lib/commonjs/mol-gl/shader/smaa/edges.frag.js +66 -66
- package/lib/commonjs/mol-gl/shader/smaa/edges.vert.js +26 -26
- package/lib/commonjs/mol-gl/shader/smaa/weights.frag.js +206 -206
- package/lib/commonjs/mol-gl/shader/smaa/weights.vert.js +32 -32
- package/lib/commonjs/mol-gl/shader/spheres.frag.js +148 -148
- package/lib/commonjs/mol-gl/shader/spheres.vert.js +132 -132
- package/lib/commonjs/mol-gl/shader/ssao-blur.frag.js +97 -97
- package/lib/commonjs/mol-gl/shader/ssao.frag.js +211 -211
- package/lib/commonjs/mol-gl/shader/text.frag.js +85 -85
- package/lib/commonjs/mol-gl/shader/text.vert.js +85 -85
- package/lib/commonjs/mol-gl/shader/util/grid3d-template.frag.js +46 -46
- package/lib/commonjs/mol-gl/shader-code.js +15 -15
- package/lib/commonjs/mol-gl/webgl/compat.js +12 -12
- package/lib/commonjs/mol-gl/webgl/context.js +1 -0
- package/lib/commonjs/mol-gl/webgl/timer.d.ts +1 -1
- package/lib/commonjs/mol-gl/webgl/timer.js +8 -1
- package/lib/commonjs/mol-math/linear-algebra/3d/minimize-rmsd.js +2 -1
- package/lib/commonjs/mol-plugin/animation-loop.d.ts +1 -0
- package/lib/commonjs/mol-plugin/behavior/dynamic/volume-streaming/behavior.d.ts +6 -6
- package/lib/commonjs/mol-plugin/behavior/dynamic/volume-streaming/model.d.ts +1 -1
- package/lib/commonjs/mol-plugin/behavior/dynamic/volume-streaming/transformers.d.ts +3 -3
- package/lib/commonjs/mol-plugin-state/animation/built-in/state-snapshots.js +7 -3
- package/lib/commonjs/mol-plugin-ui/viewport/simple-settings.js +3 -0
- package/lib/commonjs/servers/common/swagger-ui/indexTemplate.js +66 -66
- package/lib/commonjs/servers/volume/config.js +5 -5
- package/lib/examples/alpha-orbitals/example-data.js +160 -160
- package/lib/examples/alpha-orbitals/index.html +72 -72
- package/lib/examples/basic-wrapper/index.html +137 -137
- package/lib/examples/lighting/index.html +88 -88
- package/lib/examples/proteopedia-wrapper/index.html +236 -236
- package/lib/extensions/alpha-orbitals/gpu/shader.frag.js +136 -136
- package/lib/extensions/assembly-symmetry/prop.js +24 -24
- package/lib/extensions/dnatco/confal-pyramids/behavior.js +5 -5
- package/lib/extensions/dnatco/ntc-tube/behavior.js +5 -5
- package/lib/extensions/geo-export/usdz-exporter.js +41 -41
- package/lib/extensions/meshes/mesh-extension.d.ts +1 -0
- package/lib/extensions/mp4-export/encoder.js +1 -1
- package/lib/extensions/mvs/components/annotation-label/representation.d.ts +0 -2
- package/lib/extensions/mvs/components/custom-label/representation.d.ts +2 -2
- package/lib/extensions/mvs/tree/mvs/mvs-builder.d.ts +8 -2
- package/lib/extensions/sb-ncbr/index.d.ts +8 -0
- package/lib/extensions/sb-ncbr/index.js +8 -0
- package/lib/extensions/sb-ncbr/tunnels/actions.d.ts +20 -0
- package/lib/extensions/sb-ncbr/tunnels/actions.js +86 -0
- package/lib/extensions/sb-ncbr/tunnels/algorithm.d.ts +26 -0
- package/lib/extensions/sb-ncbr/tunnels/algorithm.js +469 -0
- package/lib/extensions/sb-ncbr/tunnels/behavior.d.ts +40 -0
- package/lib/extensions/sb-ncbr/tunnels/behavior.js +92 -0
- package/lib/extensions/sb-ncbr/tunnels/data-model.d.ts +146 -0
- package/lib/extensions/sb-ncbr/tunnels/data-model.js +23 -0
- package/lib/extensions/sb-ncbr/tunnels/examples.d.ts +12 -0
- package/lib/extensions/sb-ncbr/tunnels/examples.js +49 -0
- package/lib/extensions/sb-ncbr/tunnels/props.d.ts +19 -0
- package/lib/extensions/sb-ncbr/tunnels/props.js +22 -0
- package/lib/extensions/sb-ncbr/tunnels/representation.d.ts +29 -0
- package/lib/extensions/sb-ncbr/tunnels/representation.js +96 -0
- package/lib/mol-canvas3d/canvas3d.d.ts +17 -0
- package/lib/mol-canvas3d/canvas3d.js +4 -0
- package/lib/mol-canvas3d/passes/dof.d.ts +34 -0
- package/lib/mol-canvas3d/passes/dof.js +163 -0
- package/lib/mol-canvas3d/passes/draw.d.ts +2 -0
- package/lib/mol-canvas3d/passes/draw.js +31 -8
- package/lib/mol-canvas3d/passes/image.d.ts +8 -0
- package/lib/mol-canvas3d/passes/postprocessing.d.ts +8 -0
- package/lib/mol-canvas3d/passes/postprocessing.js +5 -0
- package/lib/mol-geo/geometry/lines/lines.d.ts +0 -1
- package/lib/mol-gl/shader/background.frag.js +95 -95
- package/lib/mol-gl/shader/background.vert.js +11 -11
- package/lib/mol-gl/shader/blend-back-dpoit.frag.js +13 -13
- package/lib/mol-gl/shader/bloom/blur.frag.js +28 -28
- package/lib/mol-gl/shader/bloom/composite.frag.js +33 -33
- package/lib/mol-gl/shader/bloom/luminosity.frag.js +52 -52
- package/lib/mol-gl/shader/cas.frag.js +144 -144
- package/lib/mol-gl/shader/chunks/apply-fog.glsl.js +31 -31
- package/lib/mol-gl/shader/chunks/apply-interior-color.glsl.js +12 -12
- package/lib/mol-gl/shader/chunks/apply-light-color.glsl.js +77 -77
- package/lib/mol-gl/shader/chunks/apply-marker-color.glsl.js +16 -16
- package/lib/mol-gl/shader/chunks/assign-clipping-varying.glsl.js +8 -8
- package/lib/mol-gl/shader/chunks/assign-color-varying.glsl.js +140 -140
- package/lib/mol-gl/shader/chunks/assign-group.glsl.js +6 -6
- package/lib/mol-gl/shader/chunks/assign-marker-varying.glsl.js +8 -8
- package/lib/mol-gl/shader/chunks/assign-material-color.glsl.js +112 -112
- package/lib/mol-gl/shader/chunks/assign-position.glsl.js +14 -14
- package/lib/mol-gl/shader/chunks/assign-size.glsl.js +18 -18
- package/lib/mol-gl/shader/chunks/check-picking-alpha.glsl.js +12 -12
- package/lib/mol-gl/shader/chunks/check-transparency.glsl.js +16 -16
- package/lib/mol-gl/shader/chunks/clip-instance.glsl.js +7 -7
- package/lib/mol-gl/shader/chunks/clip-pixel.glsl.js +5 -5
- package/lib/mol-gl/shader/chunks/color-frag-params.glsl.js +60 -60
- package/lib/mol-gl/shader/chunks/color-vert-params.glsl.js +122 -122
- package/lib/mol-gl/shader/chunks/common-clip.glsl.js +104 -104
- package/lib/mol-gl/shader/chunks/common-frag-params.glsl.js +150 -150
- package/lib/mol-gl/shader/chunks/common-vert-params.glsl.js +61 -61
- package/lib/mol-gl/shader/chunks/common.glsl.js +234 -234
- package/lib/mol-gl/shader/chunks/dpoit-write.glsl.js +62 -62
- package/lib/mol-gl/shader/chunks/fade-lod.glsl.js +42 -42
- package/lib/mol-gl/shader/chunks/float-to-rgba.glsl.js +39 -39
- package/lib/mol-gl/shader/chunks/light-frag-params.glsl.js +127 -127
- package/lib/mol-gl/shader/chunks/matrix-scale.glsl.js +5 -5
- package/lib/mol-gl/shader/chunks/normal-frag-params.glsl.js +2 -2
- package/lib/mol-gl/shader/chunks/read-from-texture.glsl.js +14 -14
- package/lib/mol-gl/shader/chunks/rgba-to-float.glsl.js +84 -84
- package/lib/mol-gl/shader/chunks/size-vert-params.glsl.js +11 -11
- package/lib/mol-gl/shader/chunks/texture3d-from-1d-trilinear.glsl.js +23 -23
- package/lib/mol-gl/shader/chunks/texture3d-from-2d-linear.glsl.js +17 -17
- package/lib/mol-gl/shader/chunks/texture3d-from-2d-nearest.glsl.js +8 -8
- package/lib/mol-gl/shader/chunks/wboit-write.glsl.js +25 -25
- package/lib/mol-gl/shader/compose.frag.js +12 -12
- package/lib/mol-gl/shader/compute/color-smoothing/accumulate.frag.js +23 -23
- package/lib/mol-gl/shader/compute/color-smoothing/accumulate.vert.js +43 -43
- package/lib/mol-gl/shader/compute/color-smoothing/normalize.frag.js +15 -15
- package/lib/mol-gl/shader/copy.frag.js +11 -11
- package/lib/mol-gl/shader/cylinders.frag.js +266 -266
- package/lib/mol-gl/shader/cylinders.vert.js +89 -89
- package/lib/mol-gl/shader/depth-merge.frag.js +23 -23
- package/lib/mol-gl/shader/direct-volume.frag.js +362 -362
- package/lib/mol-gl/shader/direct-volume.vert.js +41 -41
- package/lib/mol-gl/shader/dof.frag.d.ts +7 -0
- package/lib/mol-gl/shader/dof.frag.js +119 -0
- package/lib/mol-gl/shader/evaluate-dpoit.frag.js +10 -10
- package/lib/mol-gl/shader/evaluate-wboit.frag.js +17 -17
- package/lib/mol-gl/shader/fxaa.frag.js +228 -228
- package/lib/mol-gl/shader/gaussian-density.frag.js +49 -49
- package/lib/mol-gl/shader/gaussian-density.vert.js +27 -27
- package/lib/mol-gl/shader/hi-z.frag.js +18 -18
- package/lib/mol-gl/shader/histogram-pyramid/reduction.frag.js +58 -58
- package/lib/mol-gl/shader/histogram-pyramid/sum.frag.js +19 -19
- package/lib/mol-gl/shader/image.frag.js +169 -169
- package/lib/mol-gl/shader/image.vert.js +21 -21
- package/lib/mol-gl/shader/lines.frag.js +42 -42
- package/lib/mol-gl/shader/lines.vert.js +117 -117
- package/lib/mol-gl/shader/marching-cubes/active-voxels.frag.js +70 -70
- package/lib/mol-gl/shader/marching-cubes/isosurface.frag.js +311 -311
- package/lib/mol-gl/shader/marking/edge.frag.js +28 -28
- package/lib/mol-gl/shader/marking/overlay.frag.js +26 -26
- package/lib/mol-gl/shader/mesh.frag.js +65 -65
- package/lib/mol-gl/shader/mesh.vert.js +49 -49
- package/lib/mol-gl/shader/outlines.frag.js +95 -95
- package/lib/mol-gl/shader/points.frag.js +59 -59
- package/lib/mol-gl/shader/points.vert.js +38 -38
- package/lib/mol-gl/shader/postprocessing.frag.js +150 -150
- package/lib/mol-gl/shader/quad.vert.js +10 -10
- package/lib/mol-gl/shader/shadows.frag.js +123 -123
- package/lib/mol-gl/shader/smaa/blend.frag.js +56 -56
- package/lib/mol-gl/shader/smaa/blend.vert.js +25 -25
- package/lib/mol-gl/shader/smaa/edges.frag.js +66 -66
- package/lib/mol-gl/shader/smaa/edges.vert.js +26 -26
- package/lib/mol-gl/shader/smaa/weights.frag.js +206 -206
- package/lib/mol-gl/shader/smaa/weights.vert.js +32 -32
- package/lib/mol-gl/shader/spheres.frag.js +148 -148
- package/lib/mol-gl/shader/spheres.vert.js +132 -132
- package/lib/mol-gl/shader/ssao-blur.frag.js +97 -97
- package/lib/mol-gl/shader/ssao.frag.js +211 -211
- package/lib/mol-gl/shader/text.frag.js +85 -85
- package/lib/mol-gl/shader/text.vert.js +85 -85
- package/lib/mol-gl/shader/util/grid3d-template.frag.js +46 -46
- package/lib/mol-gl/shader-code.js +15 -15
- package/lib/mol-gl/webgl/compat.js +12 -12
- package/lib/mol-gl/webgl/context.js +1 -0
- package/lib/mol-gl/webgl/timer.d.ts +1 -1
- package/lib/mol-gl/webgl/timer.js +8 -1
- package/lib/mol-math/linear-algebra/3d/minimize-rmsd.js +2 -1
- package/lib/mol-plugin/animation-loop.d.ts +1 -0
- package/lib/mol-plugin/behavior/dynamic/volume-streaming/behavior.d.ts +6 -6
- package/lib/mol-plugin/behavior/dynamic/volume-streaming/model.d.ts +1 -1
- package/lib/mol-plugin/behavior/dynamic/volume-streaming/transformers.d.ts +3 -3
- package/lib/mol-plugin/version.js +2 -2
- package/lib/mol-plugin-state/animation/built-in/state-snapshots.js +7 -3
- package/lib/mol-plugin-ui/skin/base/base.scss +37 -37
- package/lib/mol-plugin-ui/skin/base/components/controls-base.scss +333 -333
- package/lib/mol-plugin-ui/skin/base/components/controls.scss +445 -445
- package/lib/mol-plugin-ui/skin/base/components/help.scss +27 -27
- package/lib/mol-plugin-ui/skin/base/components/line-graph.scss +67 -67
- package/lib/mol-plugin-ui/skin/base/components/log.scss +100 -100
- package/lib/mol-plugin-ui/skin/base/components/misc.scss +663 -663
- package/lib/mol-plugin-ui/skin/base/components/sequence.scss +125 -125
- package/lib/mol-plugin-ui/skin/base/components/slider.scss +165 -165
- package/lib/mol-plugin-ui/skin/base/components/tasks.scss +99 -99
- package/lib/mol-plugin-ui/skin/base/components/toast.scss +83 -83
- package/lib/mol-plugin-ui/skin/base/components/transformer.scss +163 -163
- package/lib/mol-plugin-ui/skin/base/components/viewport.scss +194 -194
- package/lib/mol-plugin-ui/skin/base/layout/common.scss +71 -71
- package/lib/mol-plugin-ui/skin/base/layout/controls-landscape.scss +89 -89
- package/lib/mol-plugin-ui/skin/base/layout/controls-outside.scss +98 -98
- package/lib/mol-plugin-ui/skin/base/layout/controls-portrait.scss +108 -108
- package/lib/mol-plugin-ui/skin/base/layout.scss +40 -40
- package/lib/mol-plugin-ui/skin/base/logo.scss +12 -12
- package/lib/mol-plugin-ui/skin/base/normalize.scss +209 -209
- package/lib/mol-plugin-ui/skin/base/ui.scss +40 -40
- package/lib/mol-plugin-ui/skin/base/variables.scss +88 -88
- package/lib/mol-plugin-ui/skin/blue.scss +1 -1
- package/lib/mol-plugin-ui/skin/colors/blue.scss +23 -23
- package/lib/mol-plugin-ui/skin/colors/dark.scss +23 -23
- package/lib/mol-plugin-ui/skin/colors/light.scss +29 -29
- package/lib/mol-plugin-ui/skin/dark.scss +1 -1
- package/lib/mol-plugin-ui/skin/light.scss +1 -1
- package/lib/mol-plugin-ui/viewport/simple-settings.js +3 -0
- package/lib/servers/common/swagger-ui/indexTemplate.js +66 -66
- package/lib/servers/volume/config.js +5 -5
- package/package.json +196 -195
|
@@ -7,108 +7,108 @@
|
|
|
7
7
|
*/
|
|
8
8
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
9
|
exports.common_clip = void 0;
|
|
10
|
-
exports.common_clip = `
|
|
11
|
-
#if dClipObjectCount != 0
|
|
12
|
-
vec3 quaternionTransform(const in vec4 q, const in vec3 v) {
|
|
13
|
-
vec3 t = 2.0 * cross(q.xyz, v);
|
|
14
|
-
return v + q.w * t + cross(q.xyz, t);
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
vec4 computePlane(const in vec3 normal, const in vec3 inPoint) {
|
|
18
|
-
return vec4(normalize(normal), -dot(normal, inPoint));
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
float planeSD(const in vec4 plane, const in vec3 center) {
|
|
22
|
-
return -dot(plane.xyz, center - plane.xyz * -plane.w);
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
float sphereSD(const in vec3 position, const in vec4 rotation, const in vec3 size, const in vec3 center) {
|
|
26
|
-
return (
|
|
27
|
-
length(quaternionTransform(vec4(-rotation.x, -rotation.y, -rotation.z, rotation.w), center - position) / size) - 1.0
|
|
28
|
-
) * min(min(size.x, size.y), size.z);
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
float cubeSD(const in vec3 position, const in vec4 rotation, const in vec3 size, const in vec3 center) {
|
|
32
|
-
vec3 d = abs(quaternionTransform(vec4(-rotation.x, -rotation.y, -rotation.z, rotation.w), center - position)) - size;
|
|
33
|
-
return min(max(d.x, max(d.y, d.z)), 0.0) + length(max(d, 0.0));
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
float cylinderSD(const in vec3 position, const in vec4 rotation, const in vec3 size, const in vec3 center) {
|
|
37
|
-
vec3 t = quaternionTransform(vec4(-rotation.x, -rotation.y, -rotation.z, rotation.w), center - position);
|
|
38
|
-
|
|
39
|
-
vec2 d = abs(vec2(length(t.xz), t.y)) - size.xy;
|
|
40
|
-
return min(max(d.x, d.y), 0.0) + length(max(d, 0.0));
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
float infiniteConeSD(const in vec3 position, const in vec4 rotation, const in vec3 size, const in vec3 center) {
|
|
44
|
-
vec3 t = quaternionTransform(vec4(-rotation.x, -rotation.y, -rotation.z, rotation.w), center - position);
|
|
45
|
-
|
|
46
|
-
float q = length(t.xy);
|
|
47
|
-
return dot(size.xy, vec2(q, t.z));
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
float getSignedDistance(const in vec3 center, const in int type, const in vec3 position, const in vec4 rotation, const in vec3 scale) {
|
|
51
|
-
if (type == 1) {
|
|
52
|
-
vec3 normal = quaternionTransform(rotation, vec3(0.0, 1.0, 0.0));
|
|
53
|
-
vec4 plane = computePlane(normal, position);
|
|
54
|
-
return planeSD(plane, center);
|
|
55
|
-
} else if (type == 2) {
|
|
56
|
-
return sphereSD(position, rotation, scale * 0.5, center);
|
|
57
|
-
} else if (type == 3) {
|
|
58
|
-
return cubeSD(position, rotation, scale * 0.5, center);
|
|
59
|
-
} else if (type == 4) {
|
|
60
|
-
return cylinderSD(position, rotation, scale * 0.5, center);
|
|
61
|
-
} else if (type == 5) {
|
|
62
|
-
return infiniteConeSD(position, rotation, scale * 0.5, center);
|
|
63
|
-
} else {
|
|
64
|
-
return 0.1;
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
#if __VERSION__ == 100
|
|
69
|
-
// 8-bit
|
|
70
|
-
int bitwiseAnd(in int a, in int b) {
|
|
71
|
-
int d = 128;
|
|
72
|
-
int result = 0;
|
|
73
|
-
for (int i = 0; i < 8; ++i) {
|
|
74
|
-
if (d <= 0) break;
|
|
75
|
-
if (a >= d && b >= d) result += d;
|
|
76
|
-
if (a >= d) a -= d;
|
|
77
|
-
if (b >= d) b -= d;
|
|
78
|
-
d /= 2;
|
|
79
|
-
}
|
|
80
|
-
return result;
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
bool hasBit(const in int mask, const in int bit) {
|
|
84
|
-
return bitwiseAnd(mask, bit) == 0;
|
|
85
|
-
}
|
|
86
|
-
#else
|
|
87
|
-
bool hasBit(const in int mask, const in int bit) {
|
|
88
|
-
return (mask & bit) == 0;
|
|
89
|
-
}
|
|
90
|
-
#endif
|
|
91
|
-
|
|
92
|
-
bool clipTest(const in vec4 sphere) {
|
|
93
|
-
// flag is a bit-flag for clip-objects to ignore (note, object ids start at 1 not 0)
|
|
94
|
-
#if defined(dClipping)
|
|
95
|
-
int flag = int(floor(vClipping * 255.0 + 0.5));
|
|
96
|
-
#else
|
|
97
|
-
int flag = 0;
|
|
98
|
-
#endif
|
|
99
|
-
|
|
100
|
-
#pragma unroll_loop_start
|
|
101
|
-
for (int i = 0; i < dClipObjectCount; ++i) {
|
|
102
|
-
if (flag == 0 || hasBit(flag, UNROLLED_LOOP_INDEX + 1)) {
|
|
103
|
-
// TODO take sphere radius into account?
|
|
104
|
-
bool test = getSignedDistance(sphere.xyz, uClipObjectType[i], uClipObjectPosition[i], uClipObjectRotation[i], uClipObjectScale[i]) <= 0.0;
|
|
105
|
-
if ((!uClipObjectInvert[i] && test) || (uClipObjectInvert[i] && !test)) {
|
|
106
|
-
return true;
|
|
107
|
-
}
|
|
108
|
-
}
|
|
109
|
-
}
|
|
110
|
-
#pragma unroll_loop_end
|
|
111
|
-
return false;
|
|
112
|
-
}
|
|
113
|
-
#endif
|
|
10
|
+
exports.common_clip = `
|
|
11
|
+
#if dClipObjectCount != 0
|
|
12
|
+
vec3 quaternionTransform(const in vec4 q, const in vec3 v) {
|
|
13
|
+
vec3 t = 2.0 * cross(q.xyz, v);
|
|
14
|
+
return v + q.w * t + cross(q.xyz, t);
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
vec4 computePlane(const in vec3 normal, const in vec3 inPoint) {
|
|
18
|
+
return vec4(normalize(normal), -dot(normal, inPoint));
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
float planeSD(const in vec4 plane, const in vec3 center) {
|
|
22
|
+
return -dot(plane.xyz, center - plane.xyz * -plane.w);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
float sphereSD(const in vec3 position, const in vec4 rotation, const in vec3 size, const in vec3 center) {
|
|
26
|
+
return (
|
|
27
|
+
length(quaternionTransform(vec4(-rotation.x, -rotation.y, -rotation.z, rotation.w), center - position) / size) - 1.0
|
|
28
|
+
) * min(min(size.x, size.y), size.z);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
float cubeSD(const in vec3 position, const in vec4 rotation, const in vec3 size, const in vec3 center) {
|
|
32
|
+
vec3 d = abs(quaternionTransform(vec4(-rotation.x, -rotation.y, -rotation.z, rotation.w), center - position)) - size;
|
|
33
|
+
return min(max(d.x, max(d.y, d.z)), 0.0) + length(max(d, 0.0));
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
float cylinderSD(const in vec3 position, const in vec4 rotation, const in vec3 size, const in vec3 center) {
|
|
37
|
+
vec3 t = quaternionTransform(vec4(-rotation.x, -rotation.y, -rotation.z, rotation.w), center - position);
|
|
38
|
+
|
|
39
|
+
vec2 d = abs(vec2(length(t.xz), t.y)) - size.xy;
|
|
40
|
+
return min(max(d.x, d.y), 0.0) + length(max(d, 0.0));
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
float infiniteConeSD(const in vec3 position, const in vec4 rotation, const in vec3 size, const in vec3 center) {
|
|
44
|
+
vec3 t = quaternionTransform(vec4(-rotation.x, -rotation.y, -rotation.z, rotation.w), center - position);
|
|
45
|
+
|
|
46
|
+
float q = length(t.xy);
|
|
47
|
+
return dot(size.xy, vec2(q, t.z));
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
float getSignedDistance(const in vec3 center, const in int type, const in vec3 position, const in vec4 rotation, const in vec3 scale) {
|
|
51
|
+
if (type == 1) {
|
|
52
|
+
vec3 normal = quaternionTransform(rotation, vec3(0.0, 1.0, 0.0));
|
|
53
|
+
vec4 plane = computePlane(normal, position);
|
|
54
|
+
return planeSD(plane, center);
|
|
55
|
+
} else if (type == 2) {
|
|
56
|
+
return sphereSD(position, rotation, scale * 0.5, center);
|
|
57
|
+
} else if (type == 3) {
|
|
58
|
+
return cubeSD(position, rotation, scale * 0.5, center);
|
|
59
|
+
} else if (type == 4) {
|
|
60
|
+
return cylinderSD(position, rotation, scale * 0.5, center);
|
|
61
|
+
} else if (type == 5) {
|
|
62
|
+
return infiniteConeSD(position, rotation, scale * 0.5, center);
|
|
63
|
+
} else {
|
|
64
|
+
return 0.1;
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
#if __VERSION__ == 100
|
|
69
|
+
// 8-bit
|
|
70
|
+
int bitwiseAnd(in int a, in int b) {
|
|
71
|
+
int d = 128;
|
|
72
|
+
int result = 0;
|
|
73
|
+
for (int i = 0; i < 8; ++i) {
|
|
74
|
+
if (d <= 0) break;
|
|
75
|
+
if (a >= d && b >= d) result += d;
|
|
76
|
+
if (a >= d) a -= d;
|
|
77
|
+
if (b >= d) b -= d;
|
|
78
|
+
d /= 2;
|
|
79
|
+
}
|
|
80
|
+
return result;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
bool hasBit(const in int mask, const in int bit) {
|
|
84
|
+
return bitwiseAnd(mask, bit) == 0;
|
|
85
|
+
}
|
|
86
|
+
#else
|
|
87
|
+
bool hasBit(const in int mask, const in int bit) {
|
|
88
|
+
return (mask & bit) == 0;
|
|
89
|
+
}
|
|
90
|
+
#endif
|
|
91
|
+
|
|
92
|
+
bool clipTest(const in vec4 sphere) {
|
|
93
|
+
// flag is a bit-flag for clip-objects to ignore (note, object ids start at 1 not 0)
|
|
94
|
+
#if defined(dClipping)
|
|
95
|
+
int flag = int(floor(vClipping * 255.0 + 0.5));
|
|
96
|
+
#else
|
|
97
|
+
int flag = 0;
|
|
98
|
+
#endif
|
|
99
|
+
|
|
100
|
+
#pragma unroll_loop_start
|
|
101
|
+
for (int i = 0; i < dClipObjectCount; ++i) {
|
|
102
|
+
if (flag == 0 || hasBit(flag, UNROLLED_LOOP_INDEX + 1)) {
|
|
103
|
+
// TODO take sphere radius into account?
|
|
104
|
+
bool test = getSignedDistance(sphere.xyz, uClipObjectType[i], uClipObjectPosition[i], uClipObjectRotation[i], uClipObjectScale[i]) <= 0.0;
|
|
105
|
+
if ((!uClipObjectInvert[i] && test) || (uClipObjectInvert[i] && !test)) {
|
|
106
|
+
return true;
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
#pragma unroll_loop_end
|
|
111
|
+
return false;
|
|
112
|
+
}
|
|
113
|
+
#endif
|
|
114
114
|
`;
|
|
@@ -1,154 +1,154 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.common_frag_params = void 0;
|
|
4
|
-
exports.common_frag_params = `
|
|
5
|
-
uniform int uObjectId;
|
|
6
|
-
uniform int uInstanceCount;
|
|
7
|
-
uniform int uGroupCount;
|
|
8
|
-
|
|
9
|
-
uniform int uPickType;
|
|
10
|
-
uniform int uMarkingType;
|
|
11
|
-
|
|
12
|
-
uniform vec4 uCameraPlane;
|
|
13
|
-
uniform vec4 uLod;
|
|
14
|
-
|
|
15
|
-
#if dClipObjectCount != 0
|
|
16
|
-
uniform int uClipObjectType[dClipObjectCount];
|
|
17
|
-
uniform bool uClipObjectInvert[dClipObjectCount];
|
|
18
|
-
uniform vec3 uClipObjectPosition[dClipObjectCount];
|
|
19
|
-
uniform vec4 uClipObjectRotation[dClipObjectCount];
|
|
20
|
-
uniform vec3 uClipObjectScale[dClipObjectCount];
|
|
21
|
-
|
|
22
|
-
#if defined(dClipping)
|
|
23
|
-
#if __VERSION__ == 100 || defined(dClippingType_instance) || !defined(dVaryingGroup)
|
|
24
|
-
varying float vClipping;
|
|
25
|
-
#else
|
|
26
|
-
flat in float vClipping;
|
|
27
|
-
#endif
|
|
28
|
-
#endif
|
|
29
|
-
#endif
|
|
30
|
-
|
|
31
|
-
#if defined(dColorMarker)
|
|
32
|
-
uniform vec3 uHighlightColor;
|
|
33
|
-
uniform vec3 uSelectColor;
|
|
34
|
-
uniform vec3 uDimColor;
|
|
35
|
-
uniform float uHighlightStrength;
|
|
36
|
-
uniform float uSelectStrength;
|
|
37
|
-
uniform float uDimStrength;
|
|
38
|
-
uniform int uMarkerPriority;
|
|
39
|
-
uniform float uMarkerAverage;
|
|
40
|
-
#endif
|
|
41
|
-
|
|
42
|
-
#if defined(dNeedsMarker)
|
|
43
|
-
uniform float uMarker;
|
|
44
|
-
#if __VERSION__ == 100 || defined(dMarkerType_instance) || !defined(dVaryingGroup)
|
|
45
|
-
varying float vMarker;
|
|
46
|
-
#else
|
|
47
|
-
flat in float vMarker;
|
|
48
|
-
#endif
|
|
49
|
-
#endif
|
|
50
|
-
|
|
51
|
-
#if defined(dRenderVariant_colorDpoit)
|
|
52
|
-
#define MAX_DPOIT_DEPTH 99999.0 // NOTE constant also set in TypeScript
|
|
53
|
-
uniform sampler2D tDpoitDepth;
|
|
54
|
-
uniform sampler2D tDpoitFrontColor;
|
|
55
|
-
#endif
|
|
56
|
-
|
|
57
|
-
varying vec3 vModelPosition;
|
|
58
|
-
varying vec3 vViewPosition;
|
|
59
|
-
|
|
60
|
-
uniform vec2 uViewOffset;
|
|
61
|
-
|
|
62
|
-
uniform float uNear;
|
|
63
|
-
uniform float uFar;
|
|
64
|
-
uniform float uIsOrtho;
|
|
65
|
-
|
|
66
|
-
uniform bool uFog;
|
|
67
|
-
uniform float uFogNear;
|
|
68
|
-
uniform float uFogFar;
|
|
69
|
-
uniform vec3 uFogColor;
|
|
70
|
-
|
|
71
|
-
uniform float uAlpha;
|
|
72
|
-
uniform float uPickingAlphaThreshold;
|
|
73
|
-
uniform bool uTransparentBackground;
|
|
74
|
-
|
|
75
|
-
uniform bool uDoubleSided;
|
|
76
|
-
uniform float uInteriorDarkening;
|
|
77
|
-
uniform bool uInteriorColorFlag;
|
|
78
|
-
uniform vec3 uInteriorColor;
|
|
79
|
-
bool interior;
|
|
80
|
-
|
|
81
|
-
uniform float uXrayEdgeFalloff;
|
|
82
|
-
uniform float uExposure;
|
|
83
|
-
|
|
84
|
-
uniform mat4 uProjection;
|
|
85
|
-
|
|
86
|
-
uniform int uRenderMask;
|
|
87
|
-
uniform bool uMarkingDepthTest;
|
|
88
|
-
|
|
89
|
-
uniform sampler2D tDepth;
|
|
90
|
-
uniform vec2 uDrawingBufferSize;
|
|
91
|
-
|
|
92
|
-
float getDepthPacked(const in vec2 coords) {
|
|
93
|
-
return unpackRGBAToDepth(texture2D(tDepth, coords));
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
float getDepth(const in vec2 coords) {
|
|
97
|
-
#ifdef depthTextureSupport
|
|
98
|
-
return texture2D(tDepth, coords).r;
|
|
99
|
-
#else
|
|
100
|
-
return unpackRGBAToDepth(texture2D(tDepth, coords));
|
|
101
|
-
#endif
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
float calcDepth(const in vec3 pos) {
|
|
105
|
-
vec2 clipZW = pos.z * uProjection[2].zw + uProjection[3].zw;
|
|
106
|
-
return 0.5 + 0.5 * clipZW.x / clipZW.y;
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
// "Bump Mapping Unparametrized Surfaces on the GPU" Morten S. Mikkelsen
|
|
110
|
-
// https://mmikk.github.io/papers3d/mm_sfgrad_bump.pdf
|
|
111
|
-
vec3 perturbNormal(in vec3 position, in vec3 normal, in float height, in float scale) {
|
|
112
|
-
vec3 sigmaS = dFdx(position);
|
|
113
|
-
vec3 sigmaT = dFdy(position);
|
|
114
|
-
|
|
115
|
-
vec3 r1 = cross(sigmaT, normal);
|
|
116
|
-
vec3 r2 = cross(normal, sigmaS);
|
|
117
|
-
float det = dot(sigmaS, r1);
|
|
118
|
-
if (det == 0.0) return normal;
|
|
119
|
-
|
|
120
|
-
float bs = dFdx(height);
|
|
121
|
-
float bt = dFdy(height);
|
|
122
|
-
|
|
123
|
-
vec3 surfGrad = sign(det) * (bs * r1 + bt * r2);
|
|
124
|
-
return normalize(abs(det) * normal - scale * surfGrad);
|
|
125
|
-
}
|
|
126
|
-
|
|
127
|
-
float hash(in float h) {
|
|
128
|
-
return fract(sin(h) * 43758.5453123);
|
|
129
|
-
}
|
|
130
|
-
|
|
131
|
-
float noise(in vec3 x) {
|
|
132
|
-
vec3 p = floor(x);
|
|
133
|
-
vec3 f = fract(x);
|
|
134
|
-
f = f * f * (3.0 - 2.0 * f);
|
|
135
|
-
|
|
136
|
-
float n = p.x + p.y * 157.0 + 113.0 * p.z;
|
|
137
|
-
return mix(
|
|
138
|
-
mix(mix(hash(n + 0.0), hash(n + 1.0), f.x),
|
|
139
|
-
mix(hash(n + 157.0), hash(n + 158.0), f.x), f.y),
|
|
140
|
-
mix(mix(hash(n + 113.0), hash(n + 114.0), f.x),
|
|
141
|
-
mix(hash(n + 270.0), hash(n + 271.0), f.x), f.y), f.z);
|
|
142
|
-
}
|
|
143
|
-
|
|
144
|
-
float fbm(in vec3 p) {
|
|
145
|
-
float f = 0.0;
|
|
146
|
-
f += 0.5 * noise(p);
|
|
147
|
-
p *= 2.01;
|
|
148
|
-
f += 0.25 * noise(p);
|
|
149
|
-
p *= 2.02;
|
|
150
|
-
f += 0.125 * noise(p);
|
|
151
|
-
|
|
152
|
-
return f;
|
|
153
|
-
}
|
|
4
|
+
exports.common_frag_params = `
|
|
5
|
+
uniform int uObjectId;
|
|
6
|
+
uniform int uInstanceCount;
|
|
7
|
+
uniform int uGroupCount;
|
|
8
|
+
|
|
9
|
+
uniform int uPickType;
|
|
10
|
+
uniform int uMarkingType;
|
|
11
|
+
|
|
12
|
+
uniform vec4 uCameraPlane;
|
|
13
|
+
uniform vec4 uLod;
|
|
14
|
+
|
|
15
|
+
#if dClipObjectCount != 0
|
|
16
|
+
uniform int uClipObjectType[dClipObjectCount];
|
|
17
|
+
uniform bool uClipObjectInvert[dClipObjectCount];
|
|
18
|
+
uniform vec3 uClipObjectPosition[dClipObjectCount];
|
|
19
|
+
uniform vec4 uClipObjectRotation[dClipObjectCount];
|
|
20
|
+
uniform vec3 uClipObjectScale[dClipObjectCount];
|
|
21
|
+
|
|
22
|
+
#if defined(dClipping)
|
|
23
|
+
#if __VERSION__ == 100 || defined(dClippingType_instance) || !defined(dVaryingGroup)
|
|
24
|
+
varying float vClipping;
|
|
25
|
+
#else
|
|
26
|
+
flat in float vClipping;
|
|
27
|
+
#endif
|
|
28
|
+
#endif
|
|
29
|
+
#endif
|
|
30
|
+
|
|
31
|
+
#if defined(dColorMarker)
|
|
32
|
+
uniform vec3 uHighlightColor;
|
|
33
|
+
uniform vec3 uSelectColor;
|
|
34
|
+
uniform vec3 uDimColor;
|
|
35
|
+
uniform float uHighlightStrength;
|
|
36
|
+
uniform float uSelectStrength;
|
|
37
|
+
uniform float uDimStrength;
|
|
38
|
+
uniform int uMarkerPriority;
|
|
39
|
+
uniform float uMarkerAverage;
|
|
40
|
+
#endif
|
|
41
|
+
|
|
42
|
+
#if defined(dNeedsMarker)
|
|
43
|
+
uniform float uMarker;
|
|
44
|
+
#if __VERSION__ == 100 || defined(dMarkerType_instance) || !defined(dVaryingGroup)
|
|
45
|
+
varying float vMarker;
|
|
46
|
+
#else
|
|
47
|
+
flat in float vMarker;
|
|
48
|
+
#endif
|
|
49
|
+
#endif
|
|
50
|
+
|
|
51
|
+
#if defined(dRenderVariant_colorDpoit)
|
|
52
|
+
#define MAX_DPOIT_DEPTH 99999.0 // NOTE constant also set in TypeScript
|
|
53
|
+
uniform sampler2D tDpoitDepth;
|
|
54
|
+
uniform sampler2D tDpoitFrontColor;
|
|
55
|
+
#endif
|
|
56
|
+
|
|
57
|
+
varying vec3 vModelPosition;
|
|
58
|
+
varying vec3 vViewPosition;
|
|
59
|
+
|
|
60
|
+
uniform vec2 uViewOffset;
|
|
61
|
+
|
|
62
|
+
uniform float uNear;
|
|
63
|
+
uniform float uFar;
|
|
64
|
+
uniform float uIsOrtho;
|
|
65
|
+
|
|
66
|
+
uniform bool uFog;
|
|
67
|
+
uniform float uFogNear;
|
|
68
|
+
uniform float uFogFar;
|
|
69
|
+
uniform vec3 uFogColor;
|
|
70
|
+
|
|
71
|
+
uniform float uAlpha;
|
|
72
|
+
uniform float uPickingAlphaThreshold;
|
|
73
|
+
uniform bool uTransparentBackground;
|
|
74
|
+
|
|
75
|
+
uniform bool uDoubleSided;
|
|
76
|
+
uniform float uInteriorDarkening;
|
|
77
|
+
uniform bool uInteriorColorFlag;
|
|
78
|
+
uniform vec3 uInteriorColor;
|
|
79
|
+
bool interior;
|
|
80
|
+
|
|
81
|
+
uniform float uXrayEdgeFalloff;
|
|
82
|
+
uniform float uExposure;
|
|
83
|
+
|
|
84
|
+
uniform mat4 uProjection;
|
|
85
|
+
|
|
86
|
+
uniform int uRenderMask;
|
|
87
|
+
uniform bool uMarkingDepthTest;
|
|
88
|
+
|
|
89
|
+
uniform sampler2D tDepth;
|
|
90
|
+
uniform vec2 uDrawingBufferSize;
|
|
91
|
+
|
|
92
|
+
float getDepthPacked(const in vec2 coords) {
|
|
93
|
+
return unpackRGBAToDepth(texture2D(tDepth, coords));
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
float getDepth(const in vec2 coords) {
|
|
97
|
+
#ifdef depthTextureSupport
|
|
98
|
+
return texture2D(tDepth, coords).r;
|
|
99
|
+
#else
|
|
100
|
+
return unpackRGBAToDepth(texture2D(tDepth, coords));
|
|
101
|
+
#endif
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
float calcDepth(const in vec3 pos) {
|
|
105
|
+
vec2 clipZW = pos.z * uProjection[2].zw + uProjection[3].zw;
|
|
106
|
+
return 0.5 + 0.5 * clipZW.x / clipZW.y;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
// "Bump Mapping Unparametrized Surfaces on the GPU" Morten S. Mikkelsen
|
|
110
|
+
// https://mmikk.github.io/papers3d/mm_sfgrad_bump.pdf
|
|
111
|
+
vec3 perturbNormal(in vec3 position, in vec3 normal, in float height, in float scale) {
|
|
112
|
+
vec3 sigmaS = dFdx(position);
|
|
113
|
+
vec3 sigmaT = dFdy(position);
|
|
114
|
+
|
|
115
|
+
vec3 r1 = cross(sigmaT, normal);
|
|
116
|
+
vec3 r2 = cross(normal, sigmaS);
|
|
117
|
+
float det = dot(sigmaS, r1);
|
|
118
|
+
if (det == 0.0) return normal;
|
|
119
|
+
|
|
120
|
+
float bs = dFdx(height);
|
|
121
|
+
float bt = dFdy(height);
|
|
122
|
+
|
|
123
|
+
vec3 surfGrad = sign(det) * (bs * r1 + bt * r2);
|
|
124
|
+
return normalize(abs(det) * normal - scale * surfGrad);
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
float hash(in float h) {
|
|
128
|
+
return fract(sin(h) * 43758.5453123);
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
float noise(in vec3 x) {
|
|
132
|
+
vec3 p = floor(x);
|
|
133
|
+
vec3 f = fract(x);
|
|
134
|
+
f = f * f * (3.0 - 2.0 * f);
|
|
135
|
+
|
|
136
|
+
float n = p.x + p.y * 157.0 + 113.0 * p.z;
|
|
137
|
+
return mix(
|
|
138
|
+
mix(mix(hash(n + 0.0), hash(n + 1.0), f.x),
|
|
139
|
+
mix(hash(n + 157.0), hash(n + 158.0), f.x), f.y),
|
|
140
|
+
mix(mix(hash(n + 113.0), hash(n + 114.0), f.x),
|
|
141
|
+
mix(hash(n + 270.0), hash(n + 271.0), f.x), f.y), f.z);
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
float fbm(in vec3 p) {
|
|
145
|
+
float f = 0.0;
|
|
146
|
+
f += 0.5 * noise(p);
|
|
147
|
+
p *= 2.01;
|
|
148
|
+
f += 0.25 * noise(p);
|
|
149
|
+
p *= 2.02;
|
|
150
|
+
f += 0.125 * noise(p);
|
|
151
|
+
|
|
152
|
+
return f;
|
|
153
|
+
}
|
|
154
154
|
`;
|
|
@@ -1,65 +1,65 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.common_vert_params = void 0;
|
|
4
|
-
exports.common_vert_params = `
|
|
5
|
-
uniform mat4 uProjection, uModel, uView;
|
|
6
|
-
uniform vec3 uCameraPosition;
|
|
7
|
-
uniform vec4 uCameraPlane;
|
|
8
|
-
|
|
9
|
-
uniform int uObjectId;
|
|
10
|
-
uniform int uVertexCount;
|
|
11
|
-
uniform int uInstanceCount;
|
|
12
|
-
uniform int uGroupCount;
|
|
13
|
-
uniform vec4 uInvariantBoundingSphere;
|
|
14
|
-
uniform vec4 uLod;
|
|
15
|
-
|
|
16
|
-
uniform bool uDoubleSided;
|
|
17
|
-
uniform int uPickType;
|
|
18
|
-
|
|
19
|
-
#if dClipObjectCount != 0
|
|
20
|
-
uniform int uClipObjectType[dClipObjectCount];
|
|
21
|
-
uniform bool uClipObjectInvert[dClipObjectCount];
|
|
22
|
-
uniform vec3 uClipObjectPosition[dClipObjectCount];
|
|
23
|
-
uniform vec4 uClipObjectRotation[dClipObjectCount];
|
|
24
|
-
uniform vec3 uClipObjectScale[dClipObjectCount];
|
|
25
|
-
|
|
26
|
-
#if defined(dClipping)
|
|
27
|
-
uniform vec2 uClippingTexDim;
|
|
28
|
-
uniform sampler2D tClipping;
|
|
29
|
-
#if __VERSION__ == 100 || defined(dClippingType_instance) || !defined(dVaryingGroup)
|
|
30
|
-
varying float vClipping;
|
|
31
|
-
#else
|
|
32
|
-
flat out float vClipping;
|
|
33
|
-
#endif
|
|
34
|
-
#endif
|
|
35
|
-
#endif
|
|
36
|
-
|
|
37
|
-
#if defined(dNeedsMarker)
|
|
38
|
-
uniform float uMarker;
|
|
39
|
-
uniform vec2 uMarkerTexDim;
|
|
40
|
-
uniform sampler2D tMarker;
|
|
41
|
-
#if __VERSION__ == 100 || defined(dMarkerType_instance) || !defined(dVaryingGroup)
|
|
42
|
-
varying float vMarker;
|
|
43
|
-
#else
|
|
44
|
-
flat out float vMarker;
|
|
45
|
-
#endif
|
|
46
|
-
#endif
|
|
47
|
-
|
|
48
|
-
varying vec3 vModelPosition;
|
|
49
|
-
varying vec3 vViewPosition;
|
|
50
|
-
|
|
51
|
-
#if defined(noNonInstancedActiveAttribs)
|
|
52
|
-
// int() is needed for some Safari versions
|
|
53
|
-
// see https://bugs.webkit.org/show_bug.cgi?id=244152
|
|
54
|
-
#define VertexID int(gl_VertexID)
|
|
55
|
-
#else
|
|
56
|
-
attribute float aVertex;
|
|
57
|
-
#define VertexID int(aVertex)
|
|
58
|
-
#endif
|
|
59
|
-
|
|
60
|
-
#if defined(enabledMultiDraw)
|
|
61
|
-
#define DrawID gl_DrawID
|
|
62
|
-
#else
|
|
63
|
-
#define DrawID uDrawId
|
|
64
|
-
#endif
|
|
4
|
+
exports.common_vert_params = `
|
|
5
|
+
uniform mat4 uProjection, uModel, uView;
|
|
6
|
+
uniform vec3 uCameraPosition;
|
|
7
|
+
uniform vec4 uCameraPlane;
|
|
8
|
+
|
|
9
|
+
uniform int uObjectId;
|
|
10
|
+
uniform int uVertexCount;
|
|
11
|
+
uniform int uInstanceCount;
|
|
12
|
+
uniform int uGroupCount;
|
|
13
|
+
uniform vec4 uInvariantBoundingSphere;
|
|
14
|
+
uniform vec4 uLod;
|
|
15
|
+
|
|
16
|
+
uniform bool uDoubleSided;
|
|
17
|
+
uniform int uPickType;
|
|
18
|
+
|
|
19
|
+
#if dClipObjectCount != 0
|
|
20
|
+
uniform int uClipObjectType[dClipObjectCount];
|
|
21
|
+
uniform bool uClipObjectInvert[dClipObjectCount];
|
|
22
|
+
uniform vec3 uClipObjectPosition[dClipObjectCount];
|
|
23
|
+
uniform vec4 uClipObjectRotation[dClipObjectCount];
|
|
24
|
+
uniform vec3 uClipObjectScale[dClipObjectCount];
|
|
25
|
+
|
|
26
|
+
#if defined(dClipping)
|
|
27
|
+
uniform vec2 uClippingTexDim;
|
|
28
|
+
uniform sampler2D tClipping;
|
|
29
|
+
#if __VERSION__ == 100 || defined(dClippingType_instance) || !defined(dVaryingGroup)
|
|
30
|
+
varying float vClipping;
|
|
31
|
+
#else
|
|
32
|
+
flat out float vClipping;
|
|
33
|
+
#endif
|
|
34
|
+
#endif
|
|
35
|
+
#endif
|
|
36
|
+
|
|
37
|
+
#if defined(dNeedsMarker)
|
|
38
|
+
uniform float uMarker;
|
|
39
|
+
uniform vec2 uMarkerTexDim;
|
|
40
|
+
uniform sampler2D tMarker;
|
|
41
|
+
#if __VERSION__ == 100 || defined(dMarkerType_instance) || !defined(dVaryingGroup)
|
|
42
|
+
varying float vMarker;
|
|
43
|
+
#else
|
|
44
|
+
flat out float vMarker;
|
|
45
|
+
#endif
|
|
46
|
+
#endif
|
|
47
|
+
|
|
48
|
+
varying vec3 vModelPosition;
|
|
49
|
+
varying vec3 vViewPosition;
|
|
50
|
+
|
|
51
|
+
#if defined(noNonInstancedActiveAttribs)
|
|
52
|
+
// int() is needed for some Safari versions
|
|
53
|
+
// see https://bugs.webkit.org/show_bug.cgi?id=244152
|
|
54
|
+
#define VertexID int(gl_VertexID)
|
|
55
|
+
#else
|
|
56
|
+
attribute float aVertex;
|
|
57
|
+
#define VertexID int(aVertex)
|
|
58
|
+
#endif
|
|
59
|
+
|
|
60
|
+
#if defined(enabledMultiDraw)
|
|
61
|
+
#define DrawID gl_DrawID
|
|
62
|
+
#else
|
|
63
|
+
#define DrawID uDrawId
|
|
64
|
+
#endif
|
|
65
65
|
`;
|