molstar 3.7.0 → 3.8.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 +202 -202
- package/build/viewer/embedded.html +43 -43
- package/build/viewer/index.html +106 -106
- package/build/viewer/molstar.js +1 -1
- package/build/viewer/molstar.js.LICENSE.txt +0 -15
- package/lib/apps/docking-viewer/index.html +36 -36
- package/lib/apps/viewer/embedded.html +43 -43
- package/lib/apps/viewer/index.html +106 -106
- package/lib/cli/chem-comp-dict/create-ions.d.ts +2 -1
- package/lib/cli/chem-comp-dict/create-ions.js +3 -2
- package/lib/cli/cifschema/index.js +1 -1
- package/lib/cli/cifschema/util/cif-dic.js +1 -0
- package/lib/commonjs/cli/chem-comp-dict/create-ions.d.ts +2 -1
- package/lib/commonjs/cli/chem-comp-dict/create-ions.js +3 -2
- package/lib/commonjs/cli/cifschema/index.js +1 -1
- package/lib/commonjs/cli/cifschema/util/cif-dic.js +1 -0
- package/lib/commonjs/examples/proteopedia-wrapper/coloring.d.ts +20 -5
- package/lib/commonjs/extensions/rcsb/graphql/types.d.ts +284 -0
- package/lib/commonjs/mol-canvas3d/passes/draw.d.ts +0 -2
- package/lib/commonjs/mol-canvas3d/passes/draw.js +35 -70
- package/lib/commonjs/mol-canvas3d/passes/pick.d.ts +1 -1
- package/lib/commonjs/mol-canvas3d/passes/pick.js +1 -1
- package/lib/commonjs/mol-canvas3d/passes/postprocessing.d.ts +1 -0
- package/lib/commonjs/mol-canvas3d/passes/postprocessing.js +16 -11
- package/lib/commonjs/mol-geo/geometry/color-data.d.ts +5 -2
- package/lib/commonjs/mol-geo/geometry/color-data.js +7 -17
- package/lib/commonjs/mol-geo/geometry/cylinders/cylinders.d.ts +1 -1
- package/lib/commonjs/mol-geo/geometry/cylinders/cylinders.js +2 -2
- package/lib/commonjs/mol-geo/geometry/lines/lines.d.ts +1 -0
- package/lib/commonjs/mol-geo/geometry/mesh/mesh.js +2 -2
- package/lib/commonjs/mol-geo/geometry/points/points.d.ts +1 -1
- package/lib/commonjs/mol-geo/geometry/spheres/spheres.js +2 -2
- package/lib/commonjs/mol-geo/geometry/texture-mesh/texture-mesh.js +2 -2
- package/lib/commonjs/mol-geo/geometry/transparency-data.d.ts +1 -1
- package/lib/commonjs/mol-geo/geometry/transparency-data.js +3 -1
- package/lib/commonjs/mol-gl/renderable/cylinders.d.ts +1 -1
- package/lib/commonjs/mol-gl/renderable/cylinders.js +1 -1
- package/lib/commonjs/mol-gl/renderable/mesh.d.ts +1 -1
- package/lib/commonjs/mol-gl/renderable/mesh.js +1 -1
- package/lib/commonjs/mol-gl/renderable/schema.d.ts +2 -2
- package/lib/commonjs/mol-gl/renderable/schema.js +2 -2
- package/lib/commonjs/mol-gl/renderable/spheres.d.ts +1 -1
- package/lib/commonjs/mol-gl/renderable/spheres.js +1 -1
- package/lib/commonjs/mol-gl/renderable/texture-mesh.d.ts +1 -1
- package/lib/commonjs/mol-gl/renderable/texture-mesh.js +1 -1
- package/lib/commonjs/mol-gl/renderer.d.ts +5 -5
- package/lib/commonjs/mol-gl/renderer.js +64 -45
- package/lib/commonjs/mol-gl/scene.d.ts +1 -0
- package/lib/commonjs/mol-gl/scene.js +26 -1
- package/lib/commonjs/mol-gl/shader/chunks/apply-interior-color.glsl.d.ts +1 -1
- package/lib/commonjs/mol-gl/shader/chunks/apply-interior-color.glsl.js +1 -1
- package/lib/commonjs/mol-gl/shader/chunks/assign-material-color.glsl.d.ts +1 -1
- package/lib/commonjs/mol-gl/shader/chunks/assign-material-color.glsl.js +1 -1
- package/lib/commonjs/mol-gl/shader/chunks/check-picking-alpha.glsl.d.ts +1 -1
- package/lib/commonjs/mol-gl/shader/chunks/check-picking-alpha.glsl.js +1 -1
- package/lib/commonjs/mol-gl/shader/chunks/common-frag-params.glsl.d.ts +1 -1
- package/lib/commonjs/mol-gl/shader/chunks/common-frag-params.glsl.js +1 -1
- package/lib/commonjs/mol-gl/shader/chunks/common.glsl.d.ts +1 -1
- package/lib/commonjs/mol-gl/shader/chunks/common.glsl.js +1 -1
- package/lib/commonjs/mol-gl/shader/chunks/wboit-write.glsl.d.ts +1 -1
- package/lib/commonjs/mol-gl/shader/chunks/wboit-write.glsl.js +1 -1
- package/lib/commonjs/mol-gl/shader/direct-volume.frag.d.ts +1 -1
- package/lib/commonjs/mol-gl/shader/direct-volume.frag.js +1 -1
- package/lib/commonjs/mol-gl/shader/image.frag.d.ts +1 -1
- package/lib/commonjs/mol-gl/shader/image.frag.js +1 -1
- package/lib/commonjs/mol-gl/shader/outlines.frag.d.ts +3 -2
- package/lib/commonjs/mol-gl/shader/outlines.frag.js +3 -2
- package/lib/commonjs/mol-gl/shader/postprocessing.frag.d.ts +1 -1
- package/lib/commonjs/mol-gl/shader/postprocessing.frag.js +1 -1
- package/lib/commonjs/mol-gl/shader/ssao.frag.d.ts +2 -2
- package/lib/commonjs/mol-gl/shader/ssao.frag.js +2 -2
- package/lib/commonjs/mol-gl/webgl/render-target.d.ts +3 -1
- package/lib/commonjs/mol-gl/webgl/render-target.js +3 -1
- package/lib/commonjs/mol-gl/webgl/renderbuffer.d.ts +2 -1
- package/lib/commonjs/mol-gl/webgl/renderbuffer.js +8 -1
- package/lib/commonjs/mol-gl/webgl/state.d.ts +7 -1
- package/lib/commonjs/mol-gl/webgl/state.js +28 -1
- package/lib/commonjs/mol-gl/webgl/texture.js +3 -0
- package/lib/commonjs/mol-io/reader/cif/schema/bird.d.ts +1 -1
- package/lib/commonjs/mol-io/reader/cif/schema/bird.js +1 -1
- package/lib/commonjs/mol-io/reader/cif/schema/ccd.d.ts +1 -1
- package/lib/commonjs/mol-io/reader/cif/schema/ccd.js +1 -1
- package/lib/commonjs/mol-io/reader/cif/schema/cif-core.d.ts +1 -1
- package/lib/commonjs/mol-io/reader/cif/schema/cif-core.js +1 -1
- package/lib/commonjs/mol-io/reader/cif/schema/mmcif.d.ts +3 -4
- package/lib/commonjs/mol-io/reader/cif/schema/mmcif.js +2 -3
- package/lib/commonjs/mol-io/reader/dx/parser.js +1 -1
- package/lib/commonjs/mol-math/geometry/lookup3d/grid.d.ts +1 -1
- package/lib/commonjs/mol-math/geometry/lookup3d/grid.js +3 -3
- package/lib/commonjs/mol-model/structure/model/properties/seconday-structure.d.ts +4 -2
- package/lib/commonjs/mol-model/structure/model/properties/seconday-structure.js +2 -1
- package/lib/commonjs/mol-model/structure/model/types/ions.d.ts +2 -2
- package/lib/commonjs/mol-model/structure/model/types/ions.js +2 -2
- package/lib/commonjs/mol-model/structure/model/types/saccharides.js +1 -1
- package/lib/commonjs/mol-model/structure/model/types.d.ts +1 -1
- package/lib/commonjs/mol-model/structure/model/types.js +43 -41
- package/lib/commonjs/mol-model-formats/structure/common/property.js +2 -0
- package/lib/commonjs/mol-model-formats/structure/property/secondary-structure.d.ts +1 -1
- package/lib/commonjs/mol-model-formats/structure/property/secondary-structure.js +2 -2
- package/lib/commonjs/mol-plugin/behavior/dynamic/volume-streaming/model.d.ts +3 -2
- package/lib/commonjs/mol-plugin-state/helpers/root-structure.js +3 -1
- package/lib/commonjs/mol-repr/volume/slice.js +1 -1
- package/lib/commonjs/mol-script/language/builder.d.ts +0 -1
- package/lib/commonjs/mol-theme/color/volume-value.d.ts +3 -2
- package/lib/commonjs/mol-theme/color/volume-value.js +1 -3
- package/lib/commonjs/mol-theme/color.d.ts +47 -38
- package/lib/commonjs/mol-theme/theme.d.ts +8 -7
- package/lib/commonjs/mol-theme/theme.js +1 -1
- package/lib/examples/alpha-orbitals/index.html +61 -61
- package/lib/examples/basic-wrapper/index.html +137 -137
- package/lib/examples/lighting/index.html +88 -88
- package/lib/examples/proteopedia-wrapper/coloring.d.ts +20 -5
- package/lib/examples/proteopedia-wrapper/index.html +236 -236
- package/lib/extensions/rcsb/graphql/types.d.ts +284 -0
- package/lib/mol-canvas3d/passes/draw.d.ts +0 -2
- package/lib/mol-canvas3d/passes/draw.js +32 -67
- package/lib/mol-canvas3d/passes/pick.d.ts +1 -1
- package/lib/mol-canvas3d/passes/pick.js +1 -1
- package/lib/mol-canvas3d/passes/postprocessing.d.ts +1 -0
- package/lib/mol-canvas3d/passes/postprocessing.js +16 -11
- package/lib/mol-geo/geometry/color-data.d.ts +5 -2
- package/lib/mol-geo/geometry/color-data.js +7 -17
- package/lib/mol-geo/geometry/cylinders/cylinders.d.ts +1 -1
- package/lib/mol-geo/geometry/cylinders/cylinders.js +2 -2
- package/lib/mol-geo/geometry/lines/lines.d.ts +1 -0
- package/lib/mol-geo/geometry/mesh/mesh.js +2 -2
- package/lib/mol-geo/geometry/points/points.d.ts +1 -1
- package/lib/mol-geo/geometry/spheres/spheres.js +2 -2
- package/lib/mol-geo/geometry/texture-mesh/texture-mesh.js +2 -2
- package/lib/mol-geo/geometry/transparency-data.d.ts +1 -1
- package/lib/mol-geo/geometry/transparency-data.js +3 -1
- package/lib/mol-gl/renderable/cylinders.d.ts +1 -1
- package/lib/mol-gl/renderable/cylinders.js +1 -1
- package/lib/mol-gl/renderable/mesh.d.ts +1 -1
- package/lib/mol-gl/renderable/mesh.js +1 -1
- package/lib/mol-gl/renderable/schema.d.ts +2 -2
- package/lib/mol-gl/renderable/schema.js +2 -2
- package/lib/mol-gl/renderable/spheres.d.ts +1 -1
- package/lib/mol-gl/renderable/spheres.js +1 -1
- package/lib/mol-gl/renderable/texture-mesh.d.ts +1 -1
- package/lib/mol-gl/renderable/texture-mesh.js +1 -1
- package/lib/mol-gl/renderer.d.ts +5 -5
- package/lib/mol-gl/renderer.js +64 -45
- package/lib/mol-gl/scene.d.ts +1 -0
- package/lib/mol-gl/scene.js +26 -1
- package/lib/mol-gl/shader/chunks/apply-interior-color.glsl.d.ts +1 -1
- package/lib/mol-gl/shader/chunks/apply-interior-color.glsl.js +1 -1
- package/lib/mol-gl/shader/chunks/assign-material-color.glsl.d.ts +1 -1
- package/lib/mol-gl/shader/chunks/assign-material-color.glsl.js +1 -1
- package/lib/mol-gl/shader/chunks/check-picking-alpha.glsl.d.ts +1 -1
- package/lib/mol-gl/shader/chunks/check-picking-alpha.glsl.js +1 -1
- package/lib/mol-gl/shader/chunks/common-frag-params.glsl.d.ts +1 -1
- package/lib/mol-gl/shader/chunks/common-frag-params.glsl.js +1 -1
- package/lib/mol-gl/shader/chunks/common.glsl.d.ts +1 -1
- package/lib/mol-gl/shader/chunks/common.glsl.js +1 -1
- package/lib/mol-gl/shader/chunks/wboit-write.glsl.d.ts +1 -1
- package/lib/mol-gl/shader/chunks/wboit-write.glsl.js +1 -1
- package/lib/mol-gl/shader/direct-volume.frag.d.ts +1 -1
- package/lib/mol-gl/shader/direct-volume.frag.js +1 -1
- package/lib/mol-gl/shader/image.frag.d.ts +1 -1
- package/lib/mol-gl/shader/image.frag.js +1 -1
- package/lib/mol-gl/shader/outlines.frag.d.ts +3 -2
- package/lib/mol-gl/shader/outlines.frag.js +3 -2
- package/lib/mol-gl/shader/postprocessing.frag.d.ts +1 -1
- package/lib/mol-gl/shader/postprocessing.frag.js +1 -1
- package/lib/mol-gl/shader/ssao.frag.d.ts +2 -2
- package/lib/mol-gl/shader/ssao.frag.js +2 -2
- package/lib/mol-gl/webgl/render-target.d.ts +3 -1
- package/lib/mol-gl/webgl/render-target.js +3 -1
- package/lib/mol-gl/webgl/renderbuffer.d.ts +2 -1
- package/lib/mol-gl/webgl/renderbuffer.js +8 -1
- package/lib/mol-gl/webgl/state.d.ts +7 -1
- package/lib/mol-gl/webgl/state.js +28 -1
- package/lib/mol-gl/webgl/texture.js +3 -0
- package/lib/mol-io/reader/cif/schema/bird.d.ts +1 -1
- package/lib/mol-io/reader/cif/schema/bird.js +1 -1
- package/lib/mol-io/reader/cif/schema/ccd.d.ts +1 -1
- package/lib/mol-io/reader/cif/schema/ccd.js +1 -1
- package/lib/mol-io/reader/cif/schema/cif-core.d.ts +1 -1
- package/lib/mol-io/reader/cif/schema/cif-core.js +1 -1
- package/lib/mol-io/reader/cif/schema/mmcif.d.ts +3 -4
- package/lib/mol-io/reader/cif/schema/mmcif.js +2 -3
- package/lib/mol-io/reader/dx/parser.js +1 -1
- package/lib/mol-math/geometry/lookup3d/grid.d.ts +1 -1
- package/lib/mol-math/geometry/lookup3d/grid.js +3 -3
- package/lib/mol-model/structure/model/properties/seconday-structure.d.ts +4 -2
- package/lib/mol-model/structure/model/properties/seconday-structure.js +2 -1
- package/lib/mol-model/structure/model/types/ions.d.ts +2 -2
- package/lib/mol-model/structure/model/types/ions.js +2 -2
- package/lib/mol-model/structure/model/types/saccharides.js +1 -1
- package/lib/mol-model/structure/model/types.d.ts +1 -1
- package/lib/mol-model/structure/model/types.js +43 -41
- package/lib/mol-model-formats/structure/common/property.js +2 -0
- package/lib/mol-model-formats/structure/property/secondary-structure.d.ts +1 -1
- package/lib/mol-model-formats/structure/property/secondary-structure.js +2 -2
- package/lib/mol-plugin/behavior/dynamic/volume-streaming/model.d.ts +3 -2
- package/lib/mol-plugin/version.js +2 -2
- package/lib/mol-plugin-state/helpers/root-structure.js +3 -1
- package/lib/mol-plugin-ui/skin/base/base.scss +32 -32
- package/lib/mol-plugin-ui/skin/base/components/controls-base.scss +333 -333
- package/lib/mol-plugin-ui/skin/base/components/controls.scss +418 -418
- 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 +643 -643
- 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 +128 -128
- 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 +85 -85
- 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-repr/volume/slice.js +1 -1
- package/lib/mol-script/language/builder.d.ts +0 -1
- package/lib/mol-theme/color/volume-value.d.ts +3 -2
- package/lib/mol-theme/color/volume-value.js +2 -4
- package/lib/mol-theme/color.d.ts +47 -38
- package/lib/mol-theme/theme.d.ts +8 -7
- package/lib/mol-theme/theme.js +1 -1
- package/package.json +162 -162
|
@@ -21,9 +21,11 @@ import { postprocessing_frag } from '../../mol-gl/shader/postprocessing.frag';
|
|
|
21
21
|
import { Color } from '../../mol-util/color';
|
|
22
22
|
import { FxaaParams, FxaaPass } from './fxaa';
|
|
23
23
|
import { SmaaParams, SmaaPass } from './smaa';
|
|
24
|
-
var OutlinesSchema = __assign(__assign({}, QuadSchema), {
|
|
25
|
-
function getOutlinesRenderable(ctx,
|
|
26
|
-
var
|
|
24
|
+
var OutlinesSchema = __assign(__assign({}, QuadSchema), { tDepthOpaque: TextureSpec('texture', 'rgba', 'ubyte', 'nearest'), tDepthTransparent: TextureSpec('texture', 'rgba', 'ubyte', 'nearest'), uTexSize: UniformSpec('v2'), dOrthographic: DefineSpec('number'), uNear: UniformSpec('f'), uFar: UniformSpec('f'), uMaxPossibleViewZDiff: UniformSpec('f') });
|
|
25
|
+
function getOutlinesRenderable(ctx, depthTextureOpaque, depthTextureTransparent) {
|
|
26
|
+
var width = depthTextureOpaque.getWidth();
|
|
27
|
+
var height = depthTextureOpaque.getHeight();
|
|
28
|
+
var values = __assign(__assign({}, QuadValues), { tDepthOpaque: ValueCell.create(depthTextureOpaque), tDepthTransparent: ValueCell.create(depthTextureTransparent), uTexSize: ValueCell.create(Vec2.create(width, height)), dOrthographic: ValueCell.create(0), uNear: ValueCell.create(1), uFar: ValueCell.create(10000), uMaxPossibleViewZDiff: ValueCell.create(0.5) });
|
|
27
29
|
var schema = __assign({}, OutlinesSchema);
|
|
28
30
|
var shaderCode = ShaderCode('outlines', quad_vert, outlines_frag);
|
|
29
31
|
var renderItem = createComputeRenderItem(ctx, 'triangles', shaderCode, schema, values);
|
|
@@ -65,9 +67,9 @@ function getSamples(vectorSamples, nSamples) {
|
|
|
65
67
|
}
|
|
66
68
|
return samples;
|
|
67
69
|
}
|
|
68
|
-
var PostprocessingSchema = __assign(__assign({}, QuadSchema), { tSsaoDepth: TextureSpec('texture', 'rgba', 'ubyte', 'nearest'), tColor: TextureSpec('texture', 'rgba', 'ubyte', 'nearest'),
|
|
69
|
-
function getPostprocessingRenderable(ctx, colorTexture,
|
|
70
|
-
var values = __assign(__assign({}, QuadValues), { tSsaoDepth: ValueCell.create(ssaoDepthTexture), tColor: ValueCell.create(colorTexture),
|
|
70
|
+
var PostprocessingSchema = __assign(__assign({}, QuadSchema), { tSsaoDepth: TextureSpec('texture', 'rgba', 'ubyte', 'nearest'), tColor: TextureSpec('texture', 'rgba', 'ubyte', 'nearest'), tDepthOpaque: TextureSpec('texture', 'rgba', 'ubyte', 'nearest'), tDepthTransparent: TextureSpec('texture', 'rgba', 'ubyte', 'nearest'), tOutlines: TextureSpec('texture', 'rgba', 'ubyte', 'nearest'), uTexSize: UniformSpec('v2'), dOrthographic: DefineSpec('number'), uNear: UniformSpec('f'), uFar: UniformSpec('f'), uFogNear: UniformSpec('f'), uFogFar: UniformSpec('f'), uFogColor: UniformSpec('v3'), uOutlineColor: UniformSpec('v3'), uTransparentBackground: UniformSpec('b'), uMaxPossibleViewZDiff: UniformSpec('f'), dOcclusionEnable: DefineSpec('boolean'), uOcclusionOffset: UniformSpec('v2'), dOutlineEnable: DefineSpec('boolean'), dOutlineScale: DefineSpec('number'), uOutlineThreshold: UniformSpec('f') });
|
|
71
|
+
function getPostprocessingRenderable(ctx, colorTexture, depthTextureOpaque, depthTextureTransparent, outlinesTexture, ssaoDepthTexture) {
|
|
72
|
+
var values = __assign(__assign({}, QuadValues), { tSsaoDepth: ValueCell.create(ssaoDepthTexture), tColor: ValueCell.create(colorTexture), tDepthOpaque: ValueCell.create(depthTextureOpaque), tDepthTransparent: ValueCell.create(depthTextureTransparent), tOutlines: ValueCell.create(outlinesTexture), uTexSize: ValueCell.create(Vec2.create(colorTexture.getWidth(), colorTexture.getHeight())), dOrthographic: ValueCell.create(0), uNear: ValueCell.create(1), uFar: ValueCell.create(10000), uFogNear: ValueCell.create(10000), uFogFar: ValueCell.create(10000), uFogColor: ValueCell.create(Vec3.create(1, 1, 1)), uOutlineColor: ValueCell.create(Vec3.create(0, 0, 0)), uTransparentBackground: ValueCell.create(false), uMaxPossibleViewZDiff: ValueCell.create(0.5), dOcclusionEnable: ValueCell.create(true), uOcclusionOffset: ValueCell.create(Vec2.create(0, 0)), dOutlineEnable: ValueCell.create(false), dOutlineScale: ValueCell.create(1), uOutlineThreshold: ValueCell.create(0.33) });
|
|
71
73
|
var schema = __assign({}, PostprocessingSchema);
|
|
72
74
|
var shaderCode = ShaderCode('postprocessing', quad_vert, postprocessing_frag);
|
|
73
75
|
var renderItem = createComputeRenderItem(ctx, 'triangles', shaderCode, schema, values);
|
|
@@ -103,7 +105,7 @@ var PostprocessingPass = /** @class */ (function () {
|
|
|
103
105
|
this.webgl = webgl;
|
|
104
106
|
this.drawPass = drawPass;
|
|
105
107
|
this.occlusionOffset = [0, 0];
|
|
106
|
-
var colorTarget = drawPass.colorTarget, depthTexture = drawPass.
|
|
108
|
+
var colorTarget = drawPass.colorTarget, depthTextureTransparent = drawPass.depthTexture, depthTextureOpaque = drawPass.depthTexturePrimitives;
|
|
107
109
|
var width = colorTarget.getWidth();
|
|
108
110
|
var height = colorTarget.getHeight();
|
|
109
111
|
this.nSamples = 1;
|
|
@@ -113,7 +115,7 @@ var PostprocessingPass = /** @class */ (function () {
|
|
|
113
115
|
// needs to be linear for anti-aliasing pass
|
|
114
116
|
this.target = webgl.createRenderTarget(width, height, false, 'uint8', 'linear');
|
|
115
117
|
this.outlinesTarget = webgl.createRenderTarget(width, height, false);
|
|
116
|
-
this.outlinesRenderable = getOutlinesRenderable(webgl,
|
|
118
|
+
this.outlinesRenderable = getOutlinesRenderable(webgl, depthTextureOpaque, depthTextureTransparent);
|
|
117
119
|
this.randomHemisphereVector = [];
|
|
118
120
|
for (var i = 0; i < 256; i++) {
|
|
119
121
|
var v = Vec3();
|
|
@@ -130,7 +132,7 @@ var PostprocessingPass = /** @class */ (function () {
|
|
|
130
132
|
var sw = Math.floor(width * this.ssaoScale);
|
|
131
133
|
var sh = Math.floor(height * this.ssaoScale);
|
|
132
134
|
this.downsampledDepthTarget = webgl.createRenderTarget(sw, sh, false, 'uint8', 'linear');
|
|
133
|
-
this.downsampleDepthRenderable = createCopyRenderable(webgl,
|
|
135
|
+
this.downsampleDepthRenderable = createCopyRenderable(webgl, depthTextureOpaque);
|
|
134
136
|
this.ssaoDepthTexture = webgl.resources.texture('image-uint8', 'rgba', 'ubyte', 'linear');
|
|
135
137
|
this.ssaoDepthTexture.define(sw, sh);
|
|
136
138
|
this.ssaoDepthTexture.attachFramebuffer(this.ssaoFramebuffer, 'color0');
|
|
@@ -138,14 +140,17 @@ var PostprocessingPass = /** @class */ (function () {
|
|
|
138
140
|
this.ssaoDepthBlurProxyTexture.define(sw, sh);
|
|
139
141
|
this.ssaoDepthBlurProxyTexture.attachFramebuffer(this.ssaoBlurFirstPassFramebuffer, 'color0');
|
|
140
142
|
this.ssaoDepthTexture.attachFramebuffer(this.ssaoBlurSecondPassFramebuffer, 'color0');
|
|
141
|
-
this.ssaoRenderable = getSsaoRenderable(webgl, this.downsampleFactor === 1 ?
|
|
143
|
+
this.ssaoRenderable = getSsaoRenderable(webgl, this.downsampleFactor === 1 ? depthTextureOpaque : this.downsampledDepthTarget.texture);
|
|
142
144
|
this.ssaoBlurFirstPassRenderable = getSsaoBlurRenderable(webgl, this.ssaoDepthTexture, 'horizontal');
|
|
143
145
|
this.ssaoBlurSecondPassRenderable = getSsaoBlurRenderable(webgl, this.ssaoDepthBlurProxyTexture, 'vertical');
|
|
144
|
-
this.renderable = getPostprocessingRenderable(webgl, colorTarget.texture,
|
|
146
|
+
this.renderable = getPostprocessingRenderable(webgl, colorTarget.texture, depthTextureOpaque, depthTextureTransparent, this.outlinesTarget.texture, this.ssaoDepthTexture);
|
|
145
147
|
}
|
|
146
148
|
PostprocessingPass.isEnabled = function (props) {
|
|
147
149
|
return props.occlusion.name === 'on' || props.outline.name === 'on';
|
|
148
150
|
};
|
|
151
|
+
PostprocessingPass.isOutlineEnabled = function (props) {
|
|
152
|
+
return props.outline.name === 'on';
|
|
153
|
+
};
|
|
149
154
|
PostprocessingPass.prototype.calcSsaoScale = function () {
|
|
150
155
|
// downscale ssao for high pixel-ratios
|
|
151
156
|
return Math.min(1, 1 / this.webgl.pixelRatio) * this.downsampleFactor;
|
|
@@ -11,7 +11,10 @@ import { Vec2, Vec3, Vec4 } from '../../mol-math/linear-algebra';
|
|
|
11
11
|
import { LocationIterator } from '../util/location-iterator';
|
|
12
12
|
import { ColorTheme, ColorVolume } from '../../mol-theme/color';
|
|
13
13
|
import { Texture } from '../../mol-gl/webgl/texture';
|
|
14
|
-
export declare type
|
|
14
|
+
export declare type ColorTypeLocation = 'uniform' | 'instance' | 'group' | 'groupInstance' | 'vertex' | 'vertexInstance';
|
|
15
|
+
export declare type ColorTypeGrid = 'volume' | 'volumeInstance';
|
|
16
|
+
export declare type ColorTypeDirect = 'direct';
|
|
17
|
+
export declare type ColorType = ColorTypeLocation | ColorTypeGrid | ColorTypeDirect;
|
|
15
18
|
export declare type ColorData = {
|
|
16
19
|
uColor: ValueCell<Vec3>;
|
|
17
20
|
tColor: ValueCell<TextureImage<Uint8Array>>;
|
|
@@ -23,7 +26,7 @@ export declare type ColorData = {
|
|
|
23
26
|
dColorType: ValueCell<string>;
|
|
24
27
|
dUsePalette: ValueCell<boolean>;
|
|
25
28
|
};
|
|
26
|
-
export declare function createColors(locationIt: LocationIterator, positionIt: LocationIterator, colorTheme: ColorTheme<any>, colorData?: ColorData): ColorData;
|
|
29
|
+
export declare function createColors(locationIt: LocationIterator, positionIt: LocationIterator, colorTheme: ColorTheme<any, any>, colorData?: ColorData): ColorData;
|
|
27
30
|
export declare function createValueColor(value: Color, colorData?: ColorData): ColorData;
|
|
28
31
|
export declare function createTextureColor(colors: TextureImage<Uint8Array>, type: ColorType, colorData?: ColorData): ColorData;
|
|
29
32
|
export declare function createGridColor(grid: ColorVolume, type: ColorType, colorData?: ColorData): ColorData;
|
|
@@ -9,7 +9,6 @@ import { createTextureImage } from '../../mol-gl/renderable/util';
|
|
|
9
9
|
import { Color } from '../../mol-util/color';
|
|
10
10
|
import { Vec2, Vec3, Vec4 } from '../../mol-math/linear-algebra';
|
|
11
11
|
import { NullLocation } from '../../mol-model/location';
|
|
12
|
-
import { Geometry } from './geometry';
|
|
13
12
|
import { createNullTexture } from '../../mol-gl/webgl/texture';
|
|
14
13
|
export function createColors(locationIt, positionIt, colorTheme, colorData) {
|
|
15
14
|
var data = _createColors(locationIt, positionIt, colorTheme, colorData);
|
|
@@ -23,27 +22,18 @@ export function createColors(locationIt, positionIt, colorTheme, colorData) {
|
|
|
23
22
|
return data;
|
|
24
23
|
}
|
|
25
24
|
function _createColors(locationIt, positionIt, colorTheme, colorData) {
|
|
26
|
-
switch (
|
|
25
|
+
switch (colorTheme.granularity) {
|
|
27
26
|
case 'uniform': return createUniformColor(locationIt, colorTheme.color, colorData);
|
|
28
|
-
case 'instance':
|
|
27
|
+
case 'instance':
|
|
28
|
+
return locationIt.nonInstanceable
|
|
29
|
+
? createInstanceColor(locationIt, colorTheme.color, colorData)
|
|
30
|
+
: createGroupColor(locationIt, colorTheme.color, colorData);
|
|
29
31
|
case 'group': return createGroupColor(locationIt, colorTheme.color, colorData);
|
|
30
32
|
case 'groupInstance': return createGroupInstanceColor(locationIt, colorTheme.color, colorData);
|
|
31
33
|
case 'vertex': return createVertexColor(positionIt, colorTheme.color, colorData);
|
|
32
34
|
case 'vertexInstance': return createVertexInstanceColor(positionIt, colorTheme.color, colorData);
|
|
33
|
-
case 'volume':
|
|
34
|
-
|
|
35
|
-
return createGridColor(colorTheme.grid, 'volume', colorData);
|
|
36
|
-
}
|
|
37
|
-
else {
|
|
38
|
-
throw new Error('Grid missing for "volume" color theme');
|
|
39
|
-
}
|
|
40
|
-
case 'volumeInstance':
|
|
41
|
-
if (colorTheme.grid) {
|
|
42
|
-
return createGridColor(colorTheme.grid, 'volumeInstance', colorData);
|
|
43
|
-
}
|
|
44
|
-
else {
|
|
45
|
-
throw new Error('Grid missing for "volume" color theme');
|
|
46
|
-
}
|
|
35
|
+
case 'volume': return createGridColor(colorTheme.grid, 'volume', colorData);
|
|
36
|
+
case 'volumeInstance': return createGridColor(colorTheme.grid, 'volumeInstance', colorData);
|
|
47
37
|
case 'direct': return createDirectColor(colorData);
|
|
48
38
|
}
|
|
49
39
|
}
|
|
@@ -50,8 +50,8 @@ export declare namespace Cylinders {
|
|
|
50
50
|
quality: PD.Select<"auto" | "medium" | "high" | "low" | "custom" | "highest" | "higher" | "lower" | "lowest">;
|
|
51
51
|
material: PD.Group<PD.Normalize<{
|
|
52
52
|
metalness: number;
|
|
53
|
-
roughness: number;
|
|
54
53
|
/** Number of cylinders */
|
|
54
|
+
roughness: number;
|
|
55
55
|
bumpiness: number;
|
|
56
56
|
}>>;
|
|
57
57
|
clip: PD.Group<PD.Normalize<{
|
|
@@ -153,7 +153,7 @@ export var Cylinders;
|
|
|
153
153
|
var padding = getMaxSize(size) * props.sizeFactor;
|
|
154
154
|
var invariantBoundingSphere = Sphere3D.clone(cylinders.boundingSphere);
|
|
155
155
|
var boundingSphere = calculateTransformBoundingSphere(invariantBoundingSphere, transform.aTransform.ref.value, instanceCount);
|
|
156
|
-
return __assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign({ dGeometryType: ValueCell.create('cylinders'), aMapping: cylinders.mappingBuffer, aGroup: cylinders.groupBuffer, aStart: cylinders.startBuffer, aEnd: cylinders.endBuffer, aScale: cylinders.scaleBuffer, aCap: cylinders.capBuffer, elements: cylinders.indexBuffer, boundingSphere: ValueCell.create(boundingSphere), invariantBoundingSphere: ValueCell.create(invariantBoundingSphere), uInvariantBoundingSphere: ValueCell.create(Vec4.ofSphere(invariantBoundingSphere)) }, color), size), marker), overpaint), transparency), material), clipping), transform), { padding: ValueCell.create(padding) }), BaseGeometry.createValues(props, counts)), { uSizeFactor: ValueCell.create(props.sizeFactor * props.sizeAspectRatio), uDoubleSided: ValueCell.create(props.doubleSided), dIgnoreLight: ValueCell.create(props.ignoreLight), dXrayShaded: ValueCell.create(props.xrayShaded),
|
|
156
|
+
return __assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign({ dGeometryType: ValueCell.create('cylinders'), aMapping: cylinders.mappingBuffer, aGroup: cylinders.groupBuffer, aStart: cylinders.startBuffer, aEnd: cylinders.endBuffer, aScale: cylinders.scaleBuffer, aCap: cylinders.capBuffer, elements: cylinders.indexBuffer, boundingSphere: ValueCell.create(boundingSphere), invariantBoundingSphere: ValueCell.create(invariantBoundingSphere), uInvariantBoundingSphere: ValueCell.create(Vec4.ofSphere(invariantBoundingSphere)) }, color), size), marker), overpaint), transparency), material), clipping), transform), { padding: ValueCell.create(padding) }), BaseGeometry.createValues(props, counts)), { uSizeFactor: ValueCell.create(props.sizeFactor * props.sizeAspectRatio), uDoubleSided: ValueCell.create(props.doubleSided), dIgnoreLight: ValueCell.create(props.ignoreLight), dXrayShaded: ValueCell.create(props.xrayShaded), dTransparentBackfaces: ValueCell.create(props.transparentBackfaces), uBumpFrequency: ValueCell.create(props.bumpFrequency), uBumpAmplitude: ValueCell.create(props.bumpAmplitude) });
|
|
157
157
|
}
|
|
158
158
|
function createValuesSimple(cylinders, props, colorValue, sizeValue, transform) {
|
|
159
159
|
var s = BaseGeometry.createSimple(colorValue, sizeValue, transform);
|
|
@@ -166,7 +166,7 @@ export var Cylinders;
|
|
|
166
166
|
ValueCell.updateIfChanged(values.uDoubleSided, props.doubleSided);
|
|
167
167
|
ValueCell.updateIfChanged(values.dIgnoreLight, props.ignoreLight);
|
|
168
168
|
ValueCell.updateIfChanged(values.dXrayShaded, props.xrayShaded);
|
|
169
|
-
ValueCell.updateIfChanged(values.
|
|
169
|
+
ValueCell.updateIfChanged(values.dTransparentBackfaces, props.transparentBackfaces);
|
|
170
170
|
ValueCell.updateIfChanged(values.uBumpFrequency, props.bumpFrequency);
|
|
171
171
|
ValueCell.updateIfChanged(values.uBumpAmplitude, props.bumpAmplitude);
|
|
172
172
|
}
|
|
@@ -593,7 +593,7 @@ export var Mesh;
|
|
|
593
593
|
var counts = { drawCount: mesh.triangleCount * 3, vertexCount: mesh.vertexCount, groupCount: groupCount, instanceCount: instanceCount };
|
|
594
594
|
var invariantBoundingSphere = Sphere3D.clone(mesh.boundingSphere);
|
|
595
595
|
var boundingSphere = calculateTransformBoundingSphere(invariantBoundingSphere, transform.aTransform.ref.value, instanceCount);
|
|
596
|
-
return __assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign({ dGeometryType: ValueCell.create('mesh'), aPosition: mesh.vertexBuffer, aNormal: mesh.normalBuffer, aGroup: mesh.groupBuffer, elements: mesh.indexBuffer, boundingSphere: ValueCell.create(boundingSphere), invariantBoundingSphere: ValueCell.create(invariantBoundingSphere), uInvariantBoundingSphere: ValueCell.create(Vec4.ofSphere(invariantBoundingSphere)) }, color), marker), overpaint), transparency), material), clipping), transform), BaseGeometry.createValues(props, counts)), { uDoubleSided: ValueCell.create(props.doubleSided), dFlatShaded: ValueCell.create(props.flatShaded), dFlipSided: ValueCell.create(props.flipSided), dIgnoreLight: ValueCell.create(props.ignoreLight), dXrayShaded: ValueCell.create(props.xrayShaded),
|
|
596
|
+
return __assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign({ dGeometryType: ValueCell.create('mesh'), aPosition: mesh.vertexBuffer, aNormal: mesh.normalBuffer, aGroup: mesh.groupBuffer, elements: mesh.indexBuffer, boundingSphere: ValueCell.create(boundingSphere), invariantBoundingSphere: ValueCell.create(invariantBoundingSphere), uInvariantBoundingSphere: ValueCell.create(Vec4.ofSphere(invariantBoundingSphere)) }, color), marker), overpaint), transparency), material), clipping), transform), BaseGeometry.createValues(props, counts)), { uDoubleSided: ValueCell.create(props.doubleSided), dFlatShaded: ValueCell.create(props.flatShaded), dFlipSided: ValueCell.create(props.flipSided), dIgnoreLight: ValueCell.create(props.ignoreLight), dXrayShaded: ValueCell.create(props.xrayShaded), dTransparentBackfaces: ValueCell.create(props.transparentBackfaces), uBumpFrequency: ValueCell.create(props.bumpFrequency), uBumpAmplitude: ValueCell.create(props.bumpAmplitude), meta: ValueCell.create(mesh.meta) });
|
|
597
597
|
}
|
|
598
598
|
function createValuesSimple(mesh, props, colorValue, sizeValue, transform) {
|
|
599
599
|
var s = BaseGeometry.createSimple(colorValue, sizeValue, transform);
|
|
@@ -607,7 +607,7 @@ export var Mesh;
|
|
|
607
607
|
ValueCell.updateIfChanged(values.dFlipSided, props.flipSided);
|
|
608
608
|
ValueCell.updateIfChanged(values.dIgnoreLight, props.ignoreLight);
|
|
609
609
|
ValueCell.updateIfChanged(values.dXrayShaded, props.xrayShaded);
|
|
610
|
-
ValueCell.updateIfChanged(values.
|
|
610
|
+
ValueCell.updateIfChanged(values.dTransparentBackfaces, props.transparentBackfaces);
|
|
611
611
|
ValueCell.updateIfChanged(values.uBumpFrequency, props.bumpFrequency);
|
|
612
612
|
ValueCell.updateIfChanged(values.uBumpAmplitude, props.bumpAmplitude);
|
|
613
613
|
}
|
|
@@ -43,7 +43,7 @@ export declare namespace Points {
|
|
|
43
43
|
quality: PD.Select<"auto" | "medium" | "high" | "low" | "custom" | "highest" | "higher" | "lower" | "lowest">;
|
|
44
44
|
material: PD.Group<PD.Normalize<{
|
|
45
45
|
metalness: number;
|
|
46
|
-
roughness: number;
|
|
46
|
+
roughness: number;
|
|
47
47
|
bumpiness: number;
|
|
48
48
|
}>>;
|
|
49
49
|
clip: PD.Group<PD.Normalize<{
|
|
@@ -132,7 +132,7 @@ export var Spheres;
|
|
|
132
132
|
var padding = spheres.boundingSphere.radius ? getMaxSize(size) * props.sizeFactor : 0;
|
|
133
133
|
var invariantBoundingSphere = Sphere3D.expand(Sphere3D(), spheres.boundingSphere, padding);
|
|
134
134
|
var boundingSphere = calculateTransformBoundingSphere(invariantBoundingSphere, transform.aTransform.ref.value, instanceCount);
|
|
135
|
-
return __assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign({ dGeometryType: ValueCell.create('spheres'), aPosition: spheres.centerBuffer, aMapping: spheres.mappingBuffer, aGroup: spheres.groupBuffer, elements: spheres.indexBuffer, boundingSphere: ValueCell.create(boundingSphere), invariantBoundingSphere: ValueCell.create(invariantBoundingSphere), uInvariantBoundingSphere: ValueCell.create(Vec4.ofSphere(invariantBoundingSphere)) }, color), size), marker), overpaint), transparency), material), clipping), transform), { padding: ValueCell.create(padding) }), BaseGeometry.createValues(props, counts)), { uSizeFactor: ValueCell.create(props.sizeFactor), uDoubleSided: ValueCell.create(props.doubleSided), dIgnoreLight: ValueCell.create(props.ignoreLight), dXrayShaded: ValueCell.create(props.xrayShaded),
|
|
135
|
+
return __assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign({ dGeometryType: ValueCell.create('spheres'), aPosition: spheres.centerBuffer, aMapping: spheres.mappingBuffer, aGroup: spheres.groupBuffer, elements: spheres.indexBuffer, boundingSphere: ValueCell.create(boundingSphere), invariantBoundingSphere: ValueCell.create(invariantBoundingSphere), uInvariantBoundingSphere: ValueCell.create(Vec4.ofSphere(invariantBoundingSphere)) }, color), size), marker), overpaint), transparency), material), clipping), transform), { padding: ValueCell.create(padding) }), BaseGeometry.createValues(props, counts)), { uSizeFactor: ValueCell.create(props.sizeFactor), uDoubleSided: ValueCell.create(props.doubleSided), dIgnoreLight: ValueCell.create(props.ignoreLight), dXrayShaded: ValueCell.create(props.xrayShaded), dTransparentBackfaces: ValueCell.create(props.transparentBackfaces), uBumpFrequency: ValueCell.create(props.bumpFrequency), uBumpAmplitude: ValueCell.create(props.bumpAmplitude) });
|
|
136
136
|
}
|
|
137
137
|
function createValuesSimple(spheres, props, colorValue, sizeValue, transform) {
|
|
138
138
|
var s = BaseGeometry.createSimple(colorValue, sizeValue, transform);
|
|
@@ -145,7 +145,7 @@ export var Spheres;
|
|
|
145
145
|
ValueCell.updateIfChanged(values.uDoubleSided, props.doubleSided);
|
|
146
146
|
ValueCell.updateIfChanged(values.dIgnoreLight, props.ignoreLight);
|
|
147
147
|
ValueCell.updateIfChanged(values.dXrayShaded, props.xrayShaded);
|
|
148
|
-
ValueCell.updateIfChanged(values.
|
|
148
|
+
ValueCell.updateIfChanged(values.dTransparentBackfaces, props.transparentBackfaces);
|
|
149
149
|
ValueCell.updateIfChanged(values.uBumpFrequency, props.bumpFrequency);
|
|
150
150
|
ValueCell.updateIfChanged(values.uBumpAmplitude, props.bumpAmplitude);
|
|
151
151
|
}
|
|
@@ -110,7 +110,7 @@ export var TextureMesh;
|
|
|
110
110
|
var counts = { drawCount: textureMesh.vertexCount, vertexCount: textureMesh.vertexCount, groupCount: groupCount, instanceCount: instanceCount };
|
|
111
111
|
var invariantBoundingSphere = Sphere3D.clone(textureMesh.boundingSphere);
|
|
112
112
|
var boundingSphere = calculateTransformBoundingSphere(invariantBoundingSphere, transform.aTransform.ref.value, instanceCount);
|
|
113
|
-
return __assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign({ dGeometryType: ValueCell.create('textureMesh'), uGeoTexDim: textureMesh.geoTextureDim, tPosition: textureMesh.vertexTexture, tGroup: textureMesh.groupTexture, tNormal: textureMesh.normalTexture, boundingSphere: ValueCell.create(boundingSphere), invariantBoundingSphere: ValueCell.create(invariantBoundingSphere), uInvariantBoundingSphere: ValueCell.create(Vec4.ofSphere(invariantBoundingSphere)) }, color), marker), overpaint), transparency), substance), clipping), transform), BaseGeometry.createValues(props, counts)), { uDoubleSided: ValueCell.create(props.doubleSided), dFlatShaded: ValueCell.create(props.flatShaded), dFlipSided: ValueCell.create(props.flipSided), dIgnoreLight: ValueCell.create(props.ignoreLight), dXrayShaded: ValueCell.create(props.xrayShaded),
|
|
113
|
+
return __assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign({ dGeometryType: ValueCell.create('textureMesh'), uGeoTexDim: textureMesh.geoTextureDim, tPosition: textureMesh.vertexTexture, tGroup: textureMesh.groupTexture, tNormal: textureMesh.normalTexture, boundingSphere: ValueCell.create(boundingSphere), invariantBoundingSphere: ValueCell.create(invariantBoundingSphere), uInvariantBoundingSphere: ValueCell.create(Vec4.ofSphere(invariantBoundingSphere)) }, color), marker), overpaint), transparency), substance), clipping), transform), BaseGeometry.createValues(props, counts)), { uDoubleSided: ValueCell.create(props.doubleSided), dFlatShaded: ValueCell.create(props.flatShaded), dFlipSided: ValueCell.create(props.flipSided), dIgnoreLight: ValueCell.create(props.ignoreLight), dXrayShaded: ValueCell.create(props.xrayShaded), dTransparentBackfaces: ValueCell.create(props.transparentBackfaces), uBumpFrequency: ValueCell.create(props.bumpFrequency), uBumpAmplitude: ValueCell.create(props.bumpAmplitude), meta: ValueCell.create(textureMesh.meta) });
|
|
114
114
|
}
|
|
115
115
|
function createValuesSimple(textureMesh, props, colorValue, sizeValue, transform) {
|
|
116
116
|
var s = BaseGeometry.createSimple(colorValue, sizeValue, transform);
|
|
@@ -124,7 +124,7 @@ export var TextureMesh;
|
|
|
124
124
|
ValueCell.updateIfChanged(values.dFlipSided, props.flipSided);
|
|
125
125
|
ValueCell.updateIfChanged(values.dIgnoreLight, props.ignoreLight);
|
|
126
126
|
ValueCell.updateIfChanged(values.dXrayShaded, props.xrayShaded);
|
|
127
|
-
ValueCell.updateIfChanged(values.
|
|
127
|
+
ValueCell.updateIfChanged(values.dTransparentBackfaces, props.transparentBackfaces);
|
|
128
128
|
ValueCell.updateIfChanged(values.uBumpFrequency, props.bumpFrequency);
|
|
129
129
|
ValueCell.updateIfChanged(values.uBumpAmplitude, props.bumpAmplitude);
|
|
130
130
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Copyright (c) 2019-
|
|
2
|
+
* Copyright (c) 2019-2022 mol* contributors, licensed under MIT, See LICENSE file for more info.
|
|
3
3
|
*
|
|
4
4
|
* @author Alexander Rose <alexander.rose@weirdbyte.de>
|
|
5
5
|
*/
|
|
@@ -14,6 +14,8 @@ export function applyTransparencyValue(array, start, end, value) {
|
|
|
14
14
|
return true;
|
|
15
15
|
}
|
|
16
16
|
export function getTransparencyAverage(array, count) {
|
|
17
|
+
if (count === 0 || array.length < count)
|
|
18
|
+
return 0;
|
|
17
19
|
var sum = 0;
|
|
18
20
|
for (var i = 0; i < count; ++i) {
|
|
19
21
|
sum += array[i];
|
|
@@ -19,7 +19,7 @@ export declare const CylindersSchema: {
|
|
|
19
19
|
uDoubleSided: UniformSpec<"b">;
|
|
20
20
|
dIgnoreLight: DefineSpec<"boolean">;
|
|
21
21
|
dXrayShaded: DefineSpec<"boolean">;
|
|
22
|
-
|
|
22
|
+
dTransparentBackfaces: DefineSpec<"string">;
|
|
23
23
|
uBumpFrequency: UniformSpec<"f">;
|
|
24
24
|
uBumpAmplitude: UniformSpec<"f">;
|
|
25
25
|
uSize: UniformSpec<"f">;
|
|
@@ -9,7 +9,7 @@ import { createGraphicsRenderItem } from '../webgl/render-item';
|
|
|
9
9
|
import { GlobalUniformSchema, BaseSchema, AttributeSpec, InternalSchema, SizeSchema, ElementsSpec, ValueSpec, DefineSpec, GlobalTextureSchema, UniformSpec } from './schema';
|
|
10
10
|
import { CylindersShaderCode } from '../shader-code';
|
|
11
11
|
import { ValueCell } from '../../mol-util';
|
|
12
|
-
export var CylindersSchema = __assign(__assign(__assign({}, BaseSchema), SizeSchema), { aGroup: AttributeSpec('float32', 1, 0), aStart: AttributeSpec('float32', 3, 0), aEnd: AttributeSpec('float32', 3, 0), aMapping: AttributeSpec('float32', 3, 0), aScale: AttributeSpec('float32', 1, 0), aCap: AttributeSpec('float32', 1, 0), elements: ElementsSpec('uint32'), padding: ValueSpec('number'), uDoubleSided: UniformSpec('b'), dIgnoreLight: DefineSpec('boolean'), dXrayShaded: DefineSpec('boolean'),
|
|
12
|
+
export var CylindersSchema = __assign(__assign(__assign({}, BaseSchema), SizeSchema), { aGroup: AttributeSpec('float32', 1, 0), aStart: AttributeSpec('float32', 3, 0), aEnd: AttributeSpec('float32', 3, 0), aMapping: AttributeSpec('float32', 3, 0), aScale: AttributeSpec('float32', 1, 0), aCap: AttributeSpec('float32', 1, 0), elements: ElementsSpec('uint32'), padding: ValueSpec('number'), uDoubleSided: UniformSpec('b'), dIgnoreLight: DefineSpec('boolean'), dXrayShaded: DefineSpec('boolean'), dTransparentBackfaces: DefineSpec('string', ['off', 'on', 'opaque']), uBumpFrequency: UniformSpec('f'), uBumpAmplitude: UniformSpec('f') });
|
|
13
13
|
export function CylindersRenderable(ctx, id, values, state, materialId, variants) {
|
|
14
14
|
var schema = __assign(__assign(__assign(__assign({}, GlobalUniformSchema), GlobalTextureSchema), InternalSchema), CylindersSchema);
|
|
15
15
|
var internalValues = {
|
|
@@ -17,7 +17,7 @@ export declare const MeshSchema: {
|
|
|
17
17
|
readonly dFlipSided: DefineSpec<"boolean">;
|
|
18
18
|
readonly dIgnoreLight: DefineSpec<"boolean">;
|
|
19
19
|
readonly dXrayShaded: DefineSpec<"boolean">;
|
|
20
|
-
readonly
|
|
20
|
+
readonly dTransparentBackfaces: DefineSpec<"string">;
|
|
21
21
|
readonly uBumpFrequency: UniformSpec<"f">;
|
|
22
22
|
readonly uBumpAmplitude: UniformSpec<"f">;
|
|
23
23
|
readonly meta: ValueSpec<"unknown">;
|
|
@@ -9,7 +9,7 @@ import { createGraphicsRenderItem } from '../webgl/render-item';
|
|
|
9
9
|
import { GlobalUniformSchema, BaseSchema, AttributeSpec, ElementsSpec, DefineSpec, InternalSchema, GlobalTextureSchema, ValueSpec, UniformSpec } from './schema';
|
|
10
10
|
import { MeshShaderCode } from '../shader-code';
|
|
11
11
|
import { ValueCell } from '../../mol-util';
|
|
12
|
-
export var MeshSchema = __assign(__assign({}, BaseSchema), { aGroup: AttributeSpec('float32', 1, 0), aPosition: AttributeSpec('float32', 3, 0), aNormal: AttributeSpec('float32', 3, 0), elements: ElementsSpec('uint32'), dFlatShaded: DefineSpec('boolean'), uDoubleSided: UniformSpec('b'), dFlipSided: DefineSpec('boolean'), dIgnoreLight: DefineSpec('boolean'), dXrayShaded: DefineSpec('boolean'),
|
|
12
|
+
export var MeshSchema = __assign(__assign({}, BaseSchema), { aGroup: AttributeSpec('float32', 1, 0), aPosition: AttributeSpec('float32', 3, 0), aNormal: AttributeSpec('float32', 3, 0), elements: ElementsSpec('uint32'), dFlatShaded: DefineSpec('boolean'), uDoubleSided: UniformSpec('b'), dFlipSided: DefineSpec('boolean'), dIgnoreLight: DefineSpec('boolean'), dXrayShaded: DefineSpec('boolean'), dTransparentBackfaces: DefineSpec('string', ['off', 'on', 'opaque']), uBumpFrequency: UniformSpec('f'), uBumpAmplitude: UniformSpec('f'), meta: ValueSpec('unknown') });
|
|
13
13
|
export function MeshRenderable(ctx, id, values, state, materialId, variants) {
|
|
14
14
|
var schema = __assign(__assign(__assign(__assign({}, GlobalUniformSchema), GlobalTextureSchema), InternalSchema), MeshSchema);
|
|
15
15
|
var internalValues = {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Copyright (c) 2018-
|
|
2
|
+
* Copyright (c) 2018-2022 mol* contributors, licensed under MIT, See LICENSE file for more info.
|
|
3
3
|
*
|
|
4
4
|
* @author Alexander Rose <alexander.rose@weirdbyte.de>
|
|
5
5
|
*/
|
|
@@ -119,7 +119,7 @@ export declare const GlobalUniformSchema: {
|
|
|
119
119
|
readonly uSelectStrength: UniformSpec<"f">;
|
|
120
120
|
readonly uMarkerPriority: UniformSpec<"i">;
|
|
121
121
|
readonly uXrayEdgeFalloff: UniformSpec<"f">;
|
|
122
|
-
readonly
|
|
122
|
+
readonly uRenderMask: UniformSpec<"i">;
|
|
123
123
|
readonly uMarkingDepthTest: UniformSpec<"b">;
|
|
124
124
|
readonly uMarkingType: UniformSpec<"i">;
|
|
125
125
|
readonly uPickType: UniformSpec<"i">;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Copyright (c) 2018-
|
|
2
|
+
* Copyright (c) 2018-2022 mol* contributors, licensed under MIT, See LICENSE file for more info.
|
|
3
3
|
*
|
|
4
4
|
* @author Alexander Rose <alexander.rose@weirdbyte.de>
|
|
5
5
|
*/
|
|
@@ -94,7 +94,7 @@ export var GlobalUniformSchema = {
|
|
|
94
94
|
uSelectStrength: UniformSpec('f'),
|
|
95
95
|
uMarkerPriority: UniformSpec('i'),
|
|
96
96
|
uXrayEdgeFalloff: UniformSpec('f'),
|
|
97
|
-
|
|
97
|
+
uRenderMask: UniformSpec('i'),
|
|
98
98
|
uMarkingDepthTest: UniformSpec('b'),
|
|
99
99
|
uMarkingType: UniformSpec('i'),
|
|
100
100
|
uPickType: UniformSpec('i'),
|
|
@@ -16,7 +16,7 @@ export declare const SpheresSchema: {
|
|
|
16
16
|
uDoubleSided: UniformSpec<"b">;
|
|
17
17
|
dIgnoreLight: DefineSpec<"boolean">;
|
|
18
18
|
dXrayShaded: DefineSpec<"boolean">;
|
|
19
|
-
|
|
19
|
+
dTransparentBackfaces: DefineSpec<"string">;
|
|
20
20
|
uBumpFrequency: UniformSpec<"f">;
|
|
21
21
|
uBumpAmplitude: UniformSpec<"f">;
|
|
22
22
|
uSize: UniformSpec<"f">;
|
|
@@ -9,7 +9,7 @@ import { createGraphicsRenderItem } from '../webgl/render-item';
|
|
|
9
9
|
import { GlobalUniformSchema, BaseSchema, AttributeSpec, InternalSchema, SizeSchema, ElementsSpec, ValueSpec, DefineSpec, GlobalTextureSchema, UniformSpec } from './schema';
|
|
10
10
|
import { SpheresShaderCode } from '../shader-code';
|
|
11
11
|
import { ValueCell } from '../../mol-util';
|
|
12
|
-
export var SpheresSchema = __assign(__assign(__assign({}, BaseSchema), SizeSchema), { aGroup: AttributeSpec('float32', 1, 0), aPosition: AttributeSpec('float32', 3, 0), aMapping: AttributeSpec('float32', 2, 0), elements: ElementsSpec('uint32'), padding: ValueSpec('number'), uDoubleSided: UniformSpec('b'), dIgnoreLight: DefineSpec('boolean'), dXrayShaded: DefineSpec('boolean'),
|
|
12
|
+
export var SpheresSchema = __assign(__assign(__assign({}, BaseSchema), SizeSchema), { aGroup: AttributeSpec('float32', 1, 0), aPosition: AttributeSpec('float32', 3, 0), aMapping: AttributeSpec('float32', 2, 0), elements: ElementsSpec('uint32'), padding: ValueSpec('number'), uDoubleSided: UniformSpec('b'), dIgnoreLight: DefineSpec('boolean'), dXrayShaded: DefineSpec('boolean'), dTransparentBackfaces: DefineSpec('string', ['off', 'on', 'opaque']), uBumpFrequency: UniformSpec('f'), uBumpAmplitude: UniformSpec('f') });
|
|
13
13
|
export function SpheresRenderable(ctx, id, values, state, materialId, variants) {
|
|
14
14
|
var schema = __assign(__assign(__assign(__assign({}, GlobalUniformSchema), GlobalTextureSchema), InternalSchema), SpheresSchema);
|
|
15
15
|
var internalValues = {
|
|
@@ -17,7 +17,7 @@ export declare const TextureMeshSchema: {
|
|
|
17
17
|
dFlipSided: DefineSpec<"boolean">;
|
|
18
18
|
dIgnoreLight: DefineSpec<"boolean">;
|
|
19
19
|
dXrayShaded: DefineSpec<"boolean">;
|
|
20
|
-
|
|
20
|
+
dTransparentBackfaces: DefineSpec<"string">;
|
|
21
21
|
uBumpFrequency: UniformSpec<"f">;
|
|
22
22
|
uBumpAmplitude: UniformSpec<"f">;
|
|
23
23
|
meta: ValueSpec<"unknown">;
|
|
@@ -9,7 +9,7 @@ import { createGraphicsRenderItem } from '../webgl/render-item';
|
|
|
9
9
|
import { GlobalUniformSchema, BaseSchema, DefineSpec, InternalSchema, UniformSpec, TextureSpec, GlobalTextureSchema, ValueSpec } from './schema';
|
|
10
10
|
import { MeshShaderCode } from '../shader-code';
|
|
11
11
|
import { ValueCell } from '../../mol-util';
|
|
12
|
-
export var TextureMeshSchema = __assign(__assign({}, BaseSchema), { uGeoTexDim: UniformSpec('v2', 'buffered'), tPosition: TextureSpec('texture', 'rgb', 'float', 'nearest'), tGroup: TextureSpec('texture', 'alpha', 'float', 'nearest'), tNormal: TextureSpec('texture', 'rgb', 'float', 'nearest'), dFlatShaded: DefineSpec('boolean'), uDoubleSided: UniformSpec('b'), dFlipSided: DefineSpec('boolean'), dIgnoreLight: DefineSpec('boolean'), dXrayShaded: DefineSpec('boolean'),
|
|
12
|
+
export var TextureMeshSchema = __assign(__assign({}, BaseSchema), { uGeoTexDim: UniformSpec('v2', 'buffered'), tPosition: TextureSpec('texture', 'rgb', 'float', 'nearest'), tGroup: TextureSpec('texture', 'alpha', 'float', 'nearest'), tNormal: TextureSpec('texture', 'rgb', 'float', 'nearest'), dFlatShaded: DefineSpec('boolean'), uDoubleSided: UniformSpec('b'), dFlipSided: DefineSpec('boolean'), dIgnoreLight: DefineSpec('boolean'), dXrayShaded: DefineSpec('boolean'), dTransparentBackfaces: DefineSpec('string', ['off', 'on', 'opaque']), uBumpFrequency: UniformSpec('f'), uBumpAmplitude: UniformSpec('f'), meta: ValueSpec('unknown') });
|
|
13
13
|
export function TextureMeshRenderable(ctx, id, values, state, materialId, variants) {
|
|
14
14
|
var schema = __assign(__assign(__assign(__assign({}, GlobalUniformSchema), GlobalTextureSchema), InternalSchema), TextureMeshSchema);
|
|
15
15
|
var internalValues = {
|
package/lib/mol-gl/renderer.d.ts
CHANGED
|
@@ -7,7 +7,6 @@ import { ICamera } from '../mol-canvas3d/camera';
|
|
|
7
7
|
import { Scene } from './scene';
|
|
8
8
|
import { WebGLContext } from './webgl/context';
|
|
9
9
|
import { Color } from '../mol-util/color';
|
|
10
|
-
import { GraphicsRenderVariant } from './webgl/render-item';
|
|
11
10
|
import { ParamDefinition as PD } from '../mol-util/param-definition';
|
|
12
11
|
import { Texture } from './webgl/texture';
|
|
13
12
|
export interface RendererStats {
|
|
@@ -38,17 +37,18 @@ interface Renderer {
|
|
|
38
37
|
readonly stats: RendererStats;
|
|
39
38
|
readonly props: Readonly<RendererProps>;
|
|
40
39
|
clear: (toBackgroundColor: boolean, ignoreTransparentBackground?: boolean) => void;
|
|
41
|
-
clearDepth: () => void;
|
|
40
|
+
clearDepth: (packed?: boolean) => void;
|
|
42
41
|
update: (camera: ICamera) => void;
|
|
43
|
-
renderPick: (group: Scene.Group, camera: ICamera, variant:
|
|
42
|
+
renderPick: (group: Scene.Group, camera: ICamera, variant: 'pick' | 'depth', depthTexture: Texture | null, pickType: PickType) => void;
|
|
44
43
|
renderDepth: (group: Scene.Group, camera: ICamera, depthTexture: Texture | null) => void;
|
|
44
|
+
renderDepthOpaque: (group: Scene.Group, camera: ICamera, depthTexture: Texture | null) => void;
|
|
45
|
+
renderDepthTransparent: (group: Scene.Group, camera: ICamera, depthTexture: Texture | null) => void;
|
|
45
46
|
renderMarkingDepth: (group: Scene.Group, camera: ICamera, depthTexture: Texture | null) => void;
|
|
46
47
|
renderMarkingMask: (group: Scene.Group, camera: ICamera, depthTexture: Texture | null) => void;
|
|
47
48
|
renderBlended: (group: Scene.Group, camera: ICamera, depthTexture: Texture | null) => void;
|
|
48
49
|
renderBlendedOpaque: (group: Scene.Group, camera: ICamera, depthTexture: Texture | null) => void;
|
|
49
50
|
renderBlendedTransparent: (group: Scene.Group, camera: ICamera, depthTexture: Texture | null) => void;
|
|
50
|
-
|
|
51
|
-
renderBlendedVolumeTransparent: (group: Scene.Group, camera: ICamera, depthTexture: Texture | null) => void;
|
|
51
|
+
renderBlendedVolume: (group: Scene.Group, camera: ICamera, depthTexture: Texture | null) => void;
|
|
52
52
|
renderWboitOpaque: (group: Scene.Group, camera: ICamera, depthTexture: Texture | null) => void;
|
|
53
53
|
renderWboitTransparent: (group: Scene.Group, camera: ICamera, depthTexture: Texture | null) => void;
|
|
54
54
|
setProps: (props: Partial<RendererProps>) => void;
|