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
|
@@ -18,6 +18,7 @@ import { DpoitPass } from './dpoit';
|
|
|
18
18
|
import { AntialiasingPass, PostprocessingPass, PostprocessingProps } from './postprocessing';
|
|
19
19
|
import { MarkingPass, MarkingProps } from './marking';
|
|
20
20
|
import { AssetManager } from '../../mol-util/assets';
|
|
21
|
+
import { DofPass } from './dof';
|
|
21
22
|
import { BloomPass } from './bloom';
|
|
22
23
|
type Props = {
|
|
23
24
|
postprocessing: PostprocessingProps;
|
|
@@ -49,6 +50,7 @@ export declare class DrawPass {
|
|
|
49
50
|
readonly postprocessing: PostprocessingPass;
|
|
50
51
|
readonly antialiasing: AntialiasingPass;
|
|
51
52
|
readonly bloom: BloomPass;
|
|
53
|
+
readonly dof: DofPass;
|
|
52
54
|
private transparencyMode;
|
|
53
55
|
setTransparency(transparency: 'wboit' | 'dpoit' | 'blended'): void;
|
|
54
56
|
get transparency(): TransparencyMode;
|
|
@@ -18,6 +18,7 @@ const postprocessing_1 = require("./postprocessing");
|
|
|
18
18
|
const marking_1 = require("./marking");
|
|
19
19
|
const util_1 = require("../../mol-gl/compute/util");
|
|
20
20
|
const debug_1 = require("../../mol-util/debug");
|
|
21
|
+
const dof_1 = require("./dof");
|
|
21
22
|
const bloom_1 = require("./bloom");
|
|
22
23
|
class DrawPass {
|
|
23
24
|
setTransparency(transparency) {
|
|
@@ -61,6 +62,7 @@ class DrawPass {
|
|
|
61
62
|
this.postprocessing = new postprocessing_1.PostprocessingPass(webgl, assetManager, this);
|
|
62
63
|
this.antialiasing = new postprocessing_1.AntialiasingPass(webgl, width, height);
|
|
63
64
|
this.bloom = new bloom_1.BloomPass(webgl, width, height);
|
|
65
|
+
this.dof = new dof_1.DofPass(webgl, width, height);
|
|
64
66
|
this.copyFboTarget = (0, util_1.createCopyRenderable)(webgl, this.colorTarget.texture);
|
|
65
67
|
this.copyFboPostprocessing = (0, util_1.createCopyRenderable)(webgl, this.postprocessing.target.texture);
|
|
66
68
|
this.setTransparency(transparency);
|
|
@@ -93,6 +95,7 @@ class DrawPass {
|
|
|
93
95
|
this.marking.setSize(width, height);
|
|
94
96
|
this.postprocessing.setSize(width, height);
|
|
95
97
|
this.antialiasing.setSize(width, height);
|
|
98
|
+
this.dof.setSize(width, height);
|
|
96
99
|
this.bloom.setSize(width, height);
|
|
97
100
|
}
|
|
98
101
|
_renderDpoit(renderer, camera, scene, iterations, transparentBackground, postprocessingProps) {
|
|
@@ -105,7 +108,7 @@ class DrawPass {
|
|
|
105
108
|
renderer.renderDpoitOpaque(scene.primitives, camera, null);
|
|
106
109
|
}
|
|
107
110
|
if (postprocessing_1.PostprocessingPass.isEnabled(postprocessingProps)) {
|
|
108
|
-
if (postprocessing_1.PostprocessingPass.isTransparentOutlineEnabled(postprocessingProps)) {
|
|
111
|
+
if (postprocessing_1.PostprocessingPass.isTransparentOutlineEnabled(postprocessingProps) || dof_1.DofPass.isEnabled(postprocessingProps)) {
|
|
109
112
|
this.depthTargetTransparent.bind();
|
|
110
113
|
renderer.clearDepth(true);
|
|
111
114
|
if (scene.opacityAverage < 1) {
|
|
@@ -150,7 +153,7 @@ class DrawPass {
|
|
|
150
153
|
renderer.renderWboitOpaque(scene.primitives, camera, null);
|
|
151
154
|
}
|
|
152
155
|
if (postprocessing_1.PostprocessingPass.isEnabled(postprocessingProps)) {
|
|
153
|
-
if (postprocessing_1.PostprocessingPass.isTransparentOutlineEnabled(postprocessingProps)) {
|
|
156
|
+
if (postprocessing_1.PostprocessingPass.isTransparentOutlineEnabled(postprocessingProps) || dof_1.DofPass.isEnabled(postprocessingProps)) {
|
|
154
157
|
this.depthTargetTransparent.bind();
|
|
155
158
|
renderer.clearDepth(true);
|
|
156
159
|
if (scene.opacityAverage < 1) {
|
|
@@ -211,7 +214,7 @@ class DrawPass {
|
|
|
211
214
|
else {
|
|
212
215
|
(_a = this.colorTarget.depthRenderbuffer) === null || _a === void 0 ? void 0 : _a.detachFramebuffer(this.postprocessing.target.framebuffer);
|
|
213
216
|
}
|
|
214
|
-
if (postprocessing_1.PostprocessingPass.isTransparentOutlineEnabled(postprocessingProps)) {
|
|
217
|
+
if (postprocessing_1.PostprocessingPass.isTransparentOutlineEnabled(postprocessingProps) || dof_1.DofPass.isEnabled(postprocessingProps)) {
|
|
215
218
|
this.depthTargetTransparent.bind();
|
|
216
219
|
renderer.clearDepth(true);
|
|
217
220
|
if (scene.opacityAverage < 1) {
|
|
@@ -251,11 +254,12 @@ class DrawPass {
|
|
|
251
254
|
}
|
|
252
255
|
}
|
|
253
256
|
_render(renderer, camera, scene, helper, toDrawingBuffer, transparentBackground, props) {
|
|
254
|
-
var _a;
|
|
257
|
+
var _a, _b;
|
|
255
258
|
const volumeRendering = scene.volumes.renderables.length > 0;
|
|
256
259
|
const postprocessingEnabled = postprocessing_1.PostprocessingPass.isEnabled(props.postprocessing);
|
|
257
260
|
const antialiasingEnabled = postprocessing_1.AntialiasingPass.isEnabled(props.postprocessing);
|
|
258
261
|
const markingEnabled = marking_1.MarkingPass.isEnabled(props.marking);
|
|
262
|
+
const dofEnabled = dof_1.DofPass.isEnabled(props.postprocessing);
|
|
259
263
|
const { x, y, width, height } = camera.viewport;
|
|
260
264
|
renderer.setViewport(x, y, width, height);
|
|
261
265
|
renderer.update(camera, scene);
|
|
@@ -308,13 +312,29 @@ class DrawPass {
|
|
|
308
312
|
renderer.update(helper.camera.camera, helper.camera.scene);
|
|
309
313
|
renderer.renderBlended(helper.camera.scene, helper.camera.camera);
|
|
310
314
|
}
|
|
315
|
+
let needsTargetCopy = false;
|
|
311
316
|
if (antialiasingEnabled) {
|
|
312
317
|
const input = postprocessing_1.PostprocessingPass.isEnabled(props.postprocessing)
|
|
313
318
|
? this.postprocessing.target.texture
|
|
314
319
|
: this.colorTarget.texture;
|
|
315
|
-
this.antialiasing.render(camera, input, toDrawingBuffer, props.postprocessing);
|
|
320
|
+
this.antialiasing.render(camera, input, toDrawingBuffer && !dofEnabled, props.postprocessing);
|
|
316
321
|
}
|
|
317
|
-
else if (toDrawingBuffer) {
|
|
322
|
+
else if (toDrawingBuffer && !dof_1.DofPass.isEnabled(props.postprocessing)) {
|
|
323
|
+
needsTargetCopy = true;
|
|
324
|
+
}
|
|
325
|
+
if (props.postprocessing.dof.name === 'on') {
|
|
326
|
+
const input = postprocessing_1.AntialiasingPass.isEnabled(props.postprocessing)
|
|
327
|
+
? this.antialiasing.target.texture
|
|
328
|
+
: postprocessing_1.PostprocessingPass.isEnabled(props.postprocessing)
|
|
329
|
+
? this.postprocessing.target.texture
|
|
330
|
+
: this.colorTarget.texture;
|
|
331
|
+
this.dof.update(camera, input, ((_a = this.depthTargetOpaque) === null || _a === void 0 ? void 0 : _a.texture) || this.depthTextureOpaque, this.depthTextureTransparent, props.postprocessing.dof.params, scene.boundingSphereVisible);
|
|
332
|
+
this.dof.render(camera.viewport, toDrawingBuffer ? undefined : this.getColorTarget(props.postprocessing));
|
|
333
|
+
}
|
|
334
|
+
else if (toDrawingBuffer && !postprocessing_1.AntialiasingPass.isEnabled(props.postprocessing)) {
|
|
335
|
+
needsTargetCopy = true;
|
|
336
|
+
}
|
|
337
|
+
if (needsTargetCopy) {
|
|
318
338
|
this.drawTarget.bind();
|
|
319
339
|
this.webgl.state.disable(this.webgl.gl.DEPTH_TEST);
|
|
320
340
|
if (postprocessingEnabled) {
|
|
@@ -333,7 +353,7 @@ class DrawPass {
|
|
|
333
353
|
renderer.renderEmissive(scene.primitives, camera, null);
|
|
334
354
|
}
|
|
335
355
|
if (!emissiveBloom || scene.emissiveAverage > 0) {
|
|
336
|
-
this.bloom.update(this.colorTarget.texture, this.bloom.emissiveTarget.texture, ((
|
|
356
|
+
this.bloom.update(this.colorTarget.texture, this.bloom.emissiveTarget.texture, ((_b = this.depthTargetOpaque) === null || _b === void 0 ? void 0 : _b.texture) || this.depthTextureOpaque, props.postprocessing.bloom.params);
|
|
337
357
|
this.bloom.render(camera.viewport, toDrawingBuffer ? undefined : this.getColorTarget(props.postprocessing));
|
|
338
358
|
}
|
|
339
359
|
}
|
|
@@ -367,7 +387,10 @@ class DrawPass {
|
|
|
367
387
|
this.webgl.timer.markEnd('DrawPass.render');
|
|
368
388
|
}
|
|
369
389
|
getColorTarget(postprocessingProps) {
|
|
370
|
-
if (
|
|
390
|
+
if (dof_1.DofPass.isEnabled(postprocessingProps)) {
|
|
391
|
+
return this.dof.target;
|
|
392
|
+
}
|
|
393
|
+
else if (postprocessing_1.AntialiasingPass.isEnabled(postprocessingProps)) {
|
|
371
394
|
return this.antialiasing.target;
|
|
372
395
|
}
|
|
373
396
|
else if (postprocessing_1.PostprocessingPass.isEnabled(postprocessingProps)) {
|
|
@@ -42,6 +42,14 @@ export declare const ImageParams: {
|
|
|
42
42
|
color: any;
|
|
43
43
|
includeTransparent: any;
|
|
44
44
|
}>, "on">;
|
|
45
|
+
dof: PD.NamedParams<PD.Normalize<unknown>, "off"> | PD.NamedParams<PD.Normalize<{
|
|
46
|
+
blurSize: any;
|
|
47
|
+
blurSpread: any;
|
|
48
|
+
inFocus: any;
|
|
49
|
+
PPM: any;
|
|
50
|
+
center: any;
|
|
51
|
+
mode: any;
|
|
52
|
+
}>, "on">;
|
|
45
53
|
antialiasing: PD.NamedParams<PD.Normalize<unknown>, "off"> | PD.NamedParams<PD.Normalize<{
|
|
46
54
|
edgeThreshold: any;
|
|
47
55
|
maxSearchSteps: any;
|
|
@@ -60,6 +60,14 @@ export declare const PostprocessingParams: {
|
|
|
60
60
|
color: Color;
|
|
61
61
|
includeTransparent: boolean;
|
|
62
62
|
}>, "on">>;
|
|
63
|
+
dof: PD.Mapped<PD.NamedParams<PD.Normalize<unknown>, "off"> | PD.NamedParams<PD.Normalize<{
|
|
64
|
+
blurSize: number;
|
|
65
|
+
blurSpread: number;
|
|
66
|
+
inFocus: number;
|
|
67
|
+
PPM: number;
|
|
68
|
+
center: string;
|
|
69
|
+
mode: string;
|
|
70
|
+
}>, "on">>;
|
|
63
71
|
antialiasing: PD.Mapped<PD.NamedParams<PD.Normalize<unknown>, "off"> | PD.NamedParams<PD.Normalize<{
|
|
64
72
|
edgeThreshold: number;
|
|
65
73
|
maxSearchSteps: number;
|
|
@@ -28,6 +28,7 @@ const debug_1 = require("../../mol-util/debug");
|
|
|
28
28
|
const background_1 = require("./background");
|
|
29
29
|
const shadows_frag_1 = require("../../mol-gl/shader/shadows.frag");
|
|
30
30
|
const cas_1 = require("./cas");
|
|
31
|
+
const dof_1 = require("./dof");
|
|
31
32
|
const bloom_1 = require("./bloom");
|
|
32
33
|
exports.OutlinesSchema = {
|
|
33
34
|
...util_1.QuadSchema,
|
|
@@ -318,6 +319,10 @@ exports.PostprocessingParams = {
|
|
|
318
319
|
}),
|
|
319
320
|
off: param_definition_1.ParamDefinition.Group({})
|
|
320
321
|
}, { cycle: true, description: 'Draw outline around 3D objects' }),
|
|
322
|
+
dof: param_definition_1.ParamDefinition.MappedStatic('off', {
|
|
323
|
+
on: param_definition_1.ParamDefinition.Group(dof_1.DofParams),
|
|
324
|
+
off: param_definition_1.ParamDefinition.Group({})
|
|
325
|
+
}, { cycle: true, description: 'DOF' }),
|
|
321
326
|
antialiasing: param_definition_1.ParamDefinition.MappedStatic('smaa', {
|
|
322
327
|
fxaa: param_definition_1.ParamDefinition.Group(fxaa_1.FxaaParams),
|
|
323
328
|
smaa: param_definition_1.ParamDefinition.Group(smaa_1.SmaaParams),
|
|
@@ -42,7 +42,6 @@ export declare namespace Lines {
|
|
|
42
42
|
alpha: PD.Numeric;
|
|
43
43
|
quality: PD.Select<"auto" | "medium" | "high" | "low" | "custom" | "highest" | "higher" | "lower" | "lowest">;
|
|
44
44
|
material: PD.Group<PD.Normalize<{
|
|
45
|
-
/** Wide line */
|
|
46
45
|
metalness: number;
|
|
47
46
|
roughness: number;
|
|
48
47
|
bumpiness: number;
|
|
@@ -1,99 +1,99 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.background_frag = void 0;
|
|
4
|
-
exports.background_frag = `
|
|
5
|
-
precision mediump float;
|
|
6
|
-
precision mediump samplerCube;
|
|
7
|
-
precision mediump sampler2D;
|
|
8
|
-
|
|
9
|
-
#if defined(dVariant_skybox)
|
|
10
|
-
uniform samplerCube tSkybox;
|
|
11
|
-
uniform mat4 uViewDirectionProjectionInverse;
|
|
12
|
-
uniform float uBlur;
|
|
13
|
-
uniform float uOpacity;
|
|
14
|
-
uniform float uSaturation;
|
|
15
|
-
uniform float uLightness;
|
|
16
|
-
uniform mat3 uRotation;
|
|
17
|
-
#elif defined(dVariant_image)
|
|
18
|
-
uniform sampler2D tImage;
|
|
19
|
-
uniform vec2 uImageScale;
|
|
20
|
-
uniform vec2 uImageOffset;
|
|
21
|
-
uniform float uBlur;
|
|
22
|
-
uniform float uOpacity;
|
|
23
|
-
uniform float uSaturation;
|
|
24
|
-
uniform float uLightness;
|
|
25
|
-
#elif defined(dVariant_horizontalGradient) || defined(dVariant_radialGradient)
|
|
26
|
-
uniform vec3 uGradientColorA;
|
|
27
|
-
uniform vec3 uGradientColorB;
|
|
28
|
-
uniform float uGradientRatio;
|
|
29
|
-
#endif
|
|
30
|
-
|
|
31
|
-
uniform vec2 uTexSize;
|
|
32
|
-
uniform vec4 uViewport;
|
|
33
|
-
uniform bool uViewportAdjusted;
|
|
34
|
-
varying vec4 vPosition;
|
|
35
|
-
|
|
36
|
-
// TODO: add as general pp option to remove banding?
|
|
37
|
-
// Iestyn's RGB dither from http://alex.vlachos.com/graphics/Alex_Vlachos_Advanced_VR_Rendering_GDC2015.pdf
|
|
38
|
-
vec3 ScreenSpaceDither(vec2 vScreenPos) {
|
|
39
|
-
vec3 vDither = vec3(dot(vec2(171.0, 231.0), vScreenPos.xy));
|
|
40
|
-
vDither.rgb = fract(vDither.rgb / vec3(103.0, 71.0, 97.0));
|
|
41
|
-
return vDither.rgb / 255.0;
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
vec3 saturateColor(vec3 c, float amount) {
|
|
45
|
-
// https://www.w3.org/TR/WCAG21/#dfn-relative-luminance
|
|
46
|
-
const vec3 W = vec3(0.2125, 0.7154, 0.0721);
|
|
47
|
-
vec3 intensity = vec3(dot(c, W));
|
|
48
|
-
return mix(intensity, c, 1.0 + amount);
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
vec3 lightenColor(vec3 c, float amount) {
|
|
52
|
-
return c + amount;
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
void main() {
|
|
56
|
-
#if defined(dVariant_skybox)
|
|
57
|
-
vec4 t = uViewDirectionProjectionInverse * vPosition;
|
|
58
|
-
#ifdef enabledShaderTextureLod
|
|
59
|
-
gl_FragColor = textureCubeLodEXT(tSkybox, uRotation * normalize(t.xyz / t.w), uBlur * 8.0);
|
|
60
|
-
#else
|
|
61
|
-
gl_FragColor = textureCube(tSkybox, uRotation * normalize(t.xyz / t.w));
|
|
62
|
-
#endif
|
|
63
|
-
gl_FragColor.a = uOpacity;
|
|
64
|
-
gl_FragColor.rgb = lightenColor(saturateColor(gl_FragColor.rgb, uSaturation), uLightness);
|
|
65
|
-
#elif defined(dVariant_image)
|
|
66
|
-
vec2 coords;
|
|
67
|
-
if (uViewportAdjusted) {
|
|
68
|
-
coords = ((gl_FragCoord.xy - uViewport.xy) * (uTexSize / uViewport.zw) / uImageScale) + uImageOffset;
|
|
69
|
-
} else {
|
|
70
|
-
coords = (gl_FragCoord.xy / uImageScale) + uImageOffset;
|
|
71
|
-
}
|
|
72
|
-
#ifdef enabledShaderTextureLod
|
|
73
|
-
gl_FragColor = texture2DLodEXT(tImage, vec2(coords.x, 1.0 - coords.y), uBlur * 8.0);
|
|
74
|
-
#else
|
|
75
|
-
gl_FragColor = texture2D(tImage, vec2(coords.x, 1.0 - coords.y));
|
|
76
|
-
#endif
|
|
77
|
-
gl_FragColor.a = uOpacity;
|
|
78
|
-
gl_FragColor.rgb = lightenColor(saturateColor(gl_FragColor.rgb, uSaturation), uLightness);
|
|
79
|
-
#elif defined(dVariant_horizontalGradient)
|
|
80
|
-
float d;
|
|
81
|
-
if (uViewportAdjusted) {
|
|
82
|
-
d = ((gl_FragCoord.y - uViewport.y) * (uTexSize.y / uViewport.w) / uTexSize.y) + 1.0 - (uGradientRatio * 2.0);
|
|
83
|
-
} else {
|
|
84
|
-
d = (gl_FragCoord.y / uTexSize.y) + 1.0 - (uGradientRatio * 2.0);
|
|
85
|
-
}
|
|
86
|
-
gl_FragColor = vec4(mix(uGradientColorB, uGradientColorA, clamp(d, 0.0, 1.0)), 1.0);
|
|
87
|
-
gl_FragColor.rgb += ScreenSpaceDither(gl_FragCoord.xy);
|
|
88
|
-
#elif defined(dVariant_radialGradient)
|
|
89
|
-
float d;
|
|
90
|
-
if (uViewportAdjusted) {
|
|
91
|
-
d = distance(vec2(0.5), (gl_FragCoord.xy - uViewport.xy) * (uTexSize / uViewport.zw) / uTexSize) + uGradientRatio - 0.5;
|
|
92
|
-
} else {
|
|
93
|
-
d = distance(vec2(0.5), gl_FragCoord.xy / uTexSize) + uGradientRatio - 0.5;
|
|
94
|
-
}
|
|
95
|
-
gl_FragColor = vec4(mix(uGradientColorB, uGradientColorA, 1.0 - clamp(d, 0.0, 1.0)), 1.0);
|
|
96
|
-
gl_FragColor.rgb += ScreenSpaceDither(gl_FragCoord.xy);
|
|
97
|
-
#endif
|
|
98
|
-
}
|
|
4
|
+
exports.background_frag = `
|
|
5
|
+
precision mediump float;
|
|
6
|
+
precision mediump samplerCube;
|
|
7
|
+
precision mediump sampler2D;
|
|
8
|
+
|
|
9
|
+
#if defined(dVariant_skybox)
|
|
10
|
+
uniform samplerCube tSkybox;
|
|
11
|
+
uniform mat4 uViewDirectionProjectionInverse;
|
|
12
|
+
uniform float uBlur;
|
|
13
|
+
uniform float uOpacity;
|
|
14
|
+
uniform float uSaturation;
|
|
15
|
+
uniform float uLightness;
|
|
16
|
+
uniform mat3 uRotation;
|
|
17
|
+
#elif defined(dVariant_image)
|
|
18
|
+
uniform sampler2D tImage;
|
|
19
|
+
uniform vec2 uImageScale;
|
|
20
|
+
uniform vec2 uImageOffset;
|
|
21
|
+
uniform float uBlur;
|
|
22
|
+
uniform float uOpacity;
|
|
23
|
+
uniform float uSaturation;
|
|
24
|
+
uniform float uLightness;
|
|
25
|
+
#elif defined(dVariant_horizontalGradient) || defined(dVariant_radialGradient)
|
|
26
|
+
uniform vec3 uGradientColorA;
|
|
27
|
+
uniform vec3 uGradientColorB;
|
|
28
|
+
uniform float uGradientRatio;
|
|
29
|
+
#endif
|
|
30
|
+
|
|
31
|
+
uniform vec2 uTexSize;
|
|
32
|
+
uniform vec4 uViewport;
|
|
33
|
+
uniform bool uViewportAdjusted;
|
|
34
|
+
varying vec4 vPosition;
|
|
35
|
+
|
|
36
|
+
// TODO: add as general pp option to remove banding?
|
|
37
|
+
// Iestyn's RGB dither from http://alex.vlachos.com/graphics/Alex_Vlachos_Advanced_VR_Rendering_GDC2015.pdf
|
|
38
|
+
vec3 ScreenSpaceDither(vec2 vScreenPos) {
|
|
39
|
+
vec3 vDither = vec3(dot(vec2(171.0, 231.0), vScreenPos.xy));
|
|
40
|
+
vDither.rgb = fract(vDither.rgb / vec3(103.0, 71.0, 97.0));
|
|
41
|
+
return vDither.rgb / 255.0;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
vec3 saturateColor(vec3 c, float amount) {
|
|
45
|
+
// https://www.w3.org/TR/WCAG21/#dfn-relative-luminance
|
|
46
|
+
const vec3 W = vec3(0.2125, 0.7154, 0.0721);
|
|
47
|
+
vec3 intensity = vec3(dot(c, W));
|
|
48
|
+
return mix(intensity, c, 1.0 + amount);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
vec3 lightenColor(vec3 c, float amount) {
|
|
52
|
+
return c + amount;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
void main() {
|
|
56
|
+
#if defined(dVariant_skybox)
|
|
57
|
+
vec4 t = uViewDirectionProjectionInverse * vPosition;
|
|
58
|
+
#ifdef enabledShaderTextureLod
|
|
59
|
+
gl_FragColor = textureCubeLodEXT(tSkybox, uRotation * normalize(t.xyz / t.w), uBlur * 8.0);
|
|
60
|
+
#else
|
|
61
|
+
gl_FragColor = textureCube(tSkybox, uRotation * normalize(t.xyz / t.w));
|
|
62
|
+
#endif
|
|
63
|
+
gl_FragColor.a = uOpacity;
|
|
64
|
+
gl_FragColor.rgb = lightenColor(saturateColor(gl_FragColor.rgb, uSaturation), uLightness);
|
|
65
|
+
#elif defined(dVariant_image)
|
|
66
|
+
vec2 coords;
|
|
67
|
+
if (uViewportAdjusted) {
|
|
68
|
+
coords = ((gl_FragCoord.xy - uViewport.xy) * (uTexSize / uViewport.zw) / uImageScale) + uImageOffset;
|
|
69
|
+
} else {
|
|
70
|
+
coords = (gl_FragCoord.xy / uImageScale) + uImageOffset;
|
|
71
|
+
}
|
|
72
|
+
#ifdef enabledShaderTextureLod
|
|
73
|
+
gl_FragColor = texture2DLodEXT(tImage, vec2(coords.x, 1.0 - coords.y), uBlur * 8.0);
|
|
74
|
+
#else
|
|
75
|
+
gl_FragColor = texture2D(tImage, vec2(coords.x, 1.0 - coords.y));
|
|
76
|
+
#endif
|
|
77
|
+
gl_FragColor.a = uOpacity;
|
|
78
|
+
gl_FragColor.rgb = lightenColor(saturateColor(gl_FragColor.rgb, uSaturation), uLightness);
|
|
79
|
+
#elif defined(dVariant_horizontalGradient)
|
|
80
|
+
float d;
|
|
81
|
+
if (uViewportAdjusted) {
|
|
82
|
+
d = ((gl_FragCoord.y - uViewport.y) * (uTexSize.y / uViewport.w) / uTexSize.y) + 1.0 - (uGradientRatio * 2.0);
|
|
83
|
+
} else {
|
|
84
|
+
d = (gl_FragCoord.y / uTexSize.y) + 1.0 - (uGradientRatio * 2.0);
|
|
85
|
+
}
|
|
86
|
+
gl_FragColor = vec4(mix(uGradientColorB, uGradientColorA, clamp(d, 0.0, 1.0)), 1.0);
|
|
87
|
+
gl_FragColor.rgb += ScreenSpaceDither(gl_FragCoord.xy);
|
|
88
|
+
#elif defined(dVariant_radialGradient)
|
|
89
|
+
float d;
|
|
90
|
+
if (uViewportAdjusted) {
|
|
91
|
+
d = distance(vec2(0.5), (gl_FragCoord.xy - uViewport.xy) * (uTexSize / uViewport.zw) / uTexSize) + uGradientRatio - 0.5;
|
|
92
|
+
} else {
|
|
93
|
+
d = distance(vec2(0.5), gl_FragCoord.xy / uTexSize) + uGradientRatio - 0.5;
|
|
94
|
+
}
|
|
95
|
+
gl_FragColor = vec4(mix(uGradientColorB, uGradientColorA, 1.0 - clamp(d, 0.0, 1.0)), 1.0);
|
|
96
|
+
gl_FragColor.rgb += ScreenSpaceDither(gl_FragCoord.xy);
|
|
97
|
+
#endif
|
|
98
|
+
}
|
|
99
99
|
`;
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.background_vert = void 0;
|
|
4
|
-
exports.background_vert = `
|
|
5
|
-
precision mediump float;
|
|
6
|
-
|
|
7
|
-
attribute vec2 aPosition;
|
|
8
|
-
|
|
9
|
-
varying vec4 vPosition;
|
|
10
|
-
|
|
11
|
-
void main() {
|
|
12
|
-
vPosition = vec4(aPosition, 1.0, 1.0);
|
|
13
|
-
gl_Position = vec4(aPosition, 1.0, 1.0);
|
|
14
|
-
}
|
|
4
|
+
exports.background_vert = `
|
|
5
|
+
precision mediump float;
|
|
6
|
+
|
|
7
|
+
attribute vec2 aPosition;
|
|
8
|
+
|
|
9
|
+
varying vec4 vPosition;
|
|
10
|
+
|
|
11
|
+
void main() {
|
|
12
|
+
vPosition = vec4(aPosition, 1.0, 1.0);
|
|
13
|
+
gl_Position = vec4(aPosition, 1.0, 1.0);
|
|
14
|
+
}
|
|
15
15
|
`;
|
|
@@ -6,17 +6,17 @@
|
|
|
6
6
|
*/
|
|
7
7
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
8
|
exports.blendBackDpoit_frag = void 0;
|
|
9
|
-
exports.blendBackDpoit_frag = `
|
|
10
|
-
precision highp float;
|
|
11
|
-
|
|
12
|
-
uniform sampler2D tDpoitBackColor;
|
|
13
|
-
uniform vec2 uTexSize;
|
|
14
|
-
|
|
15
|
-
void main() {
|
|
16
|
-
vec2 coords = gl_FragCoord.xy / uTexSize;
|
|
17
|
-
gl_FragColor = texture2D(tDpoitBackColor, coords);
|
|
18
|
-
if (gl_FragColor.a == 0.0) {
|
|
19
|
-
discard;
|
|
20
|
-
}
|
|
21
|
-
}
|
|
9
|
+
exports.blendBackDpoit_frag = `
|
|
10
|
+
precision highp float;
|
|
11
|
+
|
|
12
|
+
uniform sampler2D tDpoitBackColor;
|
|
13
|
+
uniform vec2 uTexSize;
|
|
14
|
+
|
|
15
|
+
void main() {
|
|
16
|
+
vec2 coords = gl_FragCoord.xy / uTexSize;
|
|
17
|
+
gl_FragColor = texture2D(tDpoitBackColor, coords);
|
|
18
|
+
if (gl_FragColor.a == 0.0) {
|
|
19
|
+
discard;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
22
|
`;
|
|
@@ -1,32 +1,32 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.blur_frag = void 0;
|
|
4
|
-
exports.blur_frag = `
|
|
5
|
-
precision highp float;
|
|
6
|
-
precision highp int;
|
|
7
|
-
precision highp sampler2D;
|
|
8
|
-
|
|
9
|
-
uniform sampler2D tInput;
|
|
10
|
-
uniform vec2 uTexSizeInv;
|
|
11
|
-
|
|
12
|
-
uniform vec2 uDirection;
|
|
13
|
-
uniform float uGaussianCoefficients[dKernelRadius];
|
|
14
|
-
|
|
15
|
-
void main(void) {
|
|
16
|
-
vec2 coords = gl_FragCoord.xy * uTexSizeInv;
|
|
17
|
-
float weightSum = uGaussianCoefficients[0];
|
|
18
|
-
vec4 diffuseSum = texture2D(tInput, coords) * weightSum;
|
|
19
|
-
|
|
20
|
-
for(int i = 1; i < dKernelRadius; ++i) {
|
|
21
|
-
float x = float(i);
|
|
22
|
-
float w = uGaussianCoefficients[i];
|
|
23
|
-
vec2 offset = uDirection * uTexSizeInv * x;
|
|
24
|
-
vec4 sample1 = texture2D(tInput, coords + offset);
|
|
25
|
-
vec4 sample2 = texture2D(tInput, coords - offset);
|
|
26
|
-
diffuseSum += (sample1 + sample2) * w;
|
|
27
|
-
weightSum += 2.0 * w;
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
gl_FragColor = diffuseSum / weightSum;
|
|
31
|
-
}
|
|
4
|
+
exports.blur_frag = `
|
|
5
|
+
precision highp float;
|
|
6
|
+
precision highp int;
|
|
7
|
+
precision highp sampler2D;
|
|
8
|
+
|
|
9
|
+
uniform sampler2D tInput;
|
|
10
|
+
uniform vec2 uTexSizeInv;
|
|
11
|
+
|
|
12
|
+
uniform vec2 uDirection;
|
|
13
|
+
uniform float uGaussianCoefficients[dKernelRadius];
|
|
14
|
+
|
|
15
|
+
void main(void) {
|
|
16
|
+
vec2 coords = gl_FragCoord.xy * uTexSizeInv;
|
|
17
|
+
float weightSum = uGaussianCoefficients[0];
|
|
18
|
+
vec4 diffuseSum = texture2D(tInput, coords) * weightSum;
|
|
19
|
+
|
|
20
|
+
for(int i = 1; i < dKernelRadius; ++i) {
|
|
21
|
+
float x = float(i);
|
|
22
|
+
float w = uGaussianCoefficients[i];
|
|
23
|
+
vec2 offset = uDirection * uTexSizeInv * x;
|
|
24
|
+
vec4 sample1 = texture2D(tInput, coords + offset);
|
|
25
|
+
vec4 sample2 = texture2D(tInput, coords - offset);
|
|
26
|
+
diffuseSum += (sample1 + sample2) * w;
|
|
27
|
+
weightSum += 2.0 * w;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
gl_FragColor = diffuseSum / weightSum;
|
|
31
|
+
}
|
|
32
32
|
`;
|
|
@@ -1,37 +1,37 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.composite_frag = void 0;
|
|
4
|
-
exports.composite_frag = `
|
|
5
|
-
precision highp float;
|
|
6
|
-
precision highp int;
|
|
7
|
-
precision highp sampler2D;
|
|
8
|
-
|
|
9
|
-
uniform vec2 uTexSizeInv;
|
|
10
|
-
|
|
11
|
-
uniform sampler2D tBlur1;
|
|
12
|
-
uniform sampler2D tBlur2;
|
|
13
|
-
uniform sampler2D tBlur3;
|
|
14
|
-
uniform sampler2D tBlur4;
|
|
15
|
-
uniform sampler2D tBlur5;
|
|
16
|
-
uniform float uBloomStrength;
|
|
17
|
-
uniform float uBloomRadius;
|
|
18
|
-
uniform float uBloomFactors[5];
|
|
19
|
-
uniform vec3 uBloomTints[5];
|
|
20
|
-
|
|
21
|
-
float lerpBloomFactor(const in float factor) {
|
|
22
|
-
float mirrorFactor = 1.2 - factor;
|
|
23
|
-
return mix(factor, mirrorFactor, uBloomRadius);
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
void main(void) {
|
|
27
|
-
vec2 coords = gl_FragCoord.xy * uTexSizeInv;
|
|
28
|
-
|
|
29
|
-
gl_FragColor = uBloomStrength * (
|
|
30
|
-
lerpBloomFactor(uBloomFactors[0]) * vec4(uBloomTints[0], 1.0) * texture2D(tBlur1, coords) +
|
|
31
|
-
lerpBloomFactor(uBloomFactors[1]) * vec4(uBloomTints[1], 1.0) * texture2D(tBlur2, coords) +
|
|
32
|
-
lerpBloomFactor(uBloomFactors[2]) * vec4(uBloomTints[2], 1.0) * texture2D(tBlur3, coords) +
|
|
33
|
-
lerpBloomFactor(uBloomFactors[3]) * vec4(uBloomTints[3], 1.0) * texture2D(tBlur4, coords) +
|
|
34
|
-
lerpBloomFactor(uBloomFactors[4]) * vec4(uBloomTints[4], 1.0) * texture2D(tBlur5, coords)
|
|
35
|
-
);
|
|
36
|
-
}
|
|
4
|
+
exports.composite_frag = `
|
|
5
|
+
precision highp float;
|
|
6
|
+
precision highp int;
|
|
7
|
+
precision highp sampler2D;
|
|
8
|
+
|
|
9
|
+
uniform vec2 uTexSizeInv;
|
|
10
|
+
|
|
11
|
+
uniform sampler2D tBlur1;
|
|
12
|
+
uniform sampler2D tBlur2;
|
|
13
|
+
uniform sampler2D tBlur3;
|
|
14
|
+
uniform sampler2D tBlur4;
|
|
15
|
+
uniform sampler2D tBlur5;
|
|
16
|
+
uniform float uBloomStrength;
|
|
17
|
+
uniform float uBloomRadius;
|
|
18
|
+
uniform float uBloomFactors[5];
|
|
19
|
+
uniform vec3 uBloomTints[5];
|
|
20
|
+
|
|
21
|
+
float lerpBloomFactor(const in float factor) {
|
|
22
|
+
float mirrorFactor = 1.2 - factor;
|
|
23
|
+
return mix(factor, mirrorFactor, uBloomRadius);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
void main(void) {
|
|
27
|
+
vec2 coords = gl_FragCoord.xy * uTexSizeInv;
|
|
28
|
+
|
|
29
|
+
gl_FragColor = uBloomStrength * (
|
|
30
|
+
lerpBloomFactor(uBloomFactors[0]) * vec4(uBloomTints[0], 1.0) * texture2D(tBlur1, coords) +
|
|
31
|
+
lerpBloomFactor(uBloomFactors[1]) * vec4(uBloomTints[1], 1.0) * texture2D(tBlur2, coords) +
|
|
32
|
+
lerpBloomFactor(uBloomFactors[2]) * vec4(uBloomTints[2], 1.0) * texture2D(tBlur3, coords) +
|
|
33
|
+
lerpBloomFactor(uBloomFactors[3]) * vec4(uBloomTints[3], 1.0) * texture2D(tBlur4, coords) +
|
|
34
|
+
lerpBloomFactor(uBloomFactors[4]) * vec4(uBloomTints[4], 1.0) * texture2D(tBlur5, coords)
|
|
35
|
+
);
|
|
36
|
+
}
|
|
37
37
|
`;
|