molstar 3.7.0 → 3.8.2
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/canvas3d.d.ts +1 -1
- package/lib/commonjs/mol-canvas3d/canvas3d.js +4 -4
- package/lib/commonjs/mol-canvas3d/helper/camera-helper.d.ts +1 -1
- package/lib/commonjs/mol-canvas3d/helper/camera-helper.js +7 -5
- package/lib/commonjs/mol-canvas3d/helper/handle-helper.d.ts +1 -1
- package/lib/commonjs/mol-canvas3d/helper/handle-helper.js +7 -5
- package/lib/commonjs/mol-canvas3d/passes/draw.d.ts +4 -8
- package/lib/commonjs/mol-canvas3d/passes/draw.js +60 -103
- package/lib/commonjs/mol-canvas3d/passes/pick.d.ts +1 -1
- package/lib/commonjs/mol-canvas3d/passes/pick.js +1 -3
- package/lib/commonjs/mol-canvas3d/passes/postprocessing.d.ts +1 -0
- package/lib/commonjs/mol-canvas3d/passes/postprocessing.js +17 -12
- 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 +2 -1
- package/lib/commonjs/mol-gl/scene.js +44 -11
- 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/program.js +10 -1
- 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-gl/webgl/uniform.d.ts +1 -0
- package/lib/commonjs/mol-gl/webgl/uniform.js +5 -1
- 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/canvas3d.d.ts +1 -1
- package/lib/mol-canvas3d/canvas3d.js +4 -4
- package/lib/mol-canvas3d/helper/camera-helper.d.ts +1 -1
- package/lib/mol-canvas3d/helper/camera-helper.js +8 -6
- package/lib/mol-canvas3d/helper/handle-helper.d.ts +1 -1
- package/lib/mol-canvas3d/helper/handle-helper.js +8 -6
- package/lib/mol-canvas3d/passes/draw.d.ts +4 -8
- package/lib/mol-canvas3d/passes/draw.js +57 -100
- package/lib/mol-canvas3d/passes/pick.d.ts +1 -1
- package/lib/mol-canvas3d/passes/pick.js +1 -3
- package/lib/mol-canvas3d/passes/postprocessing.d.ts +1 -0
- package/lib/mol-canvas3d/passes/postprocessing.js +17 -12
- 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 +2 -1
- package/lib/mol-gl/scene.js +44 -11
- 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/program.js +11 -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-gl/webgl/uniform.d.ts +1 -0
- package/lib/mol-gl/webgl/uniform.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
|
@@ -7,30 +7,14 @@
|
|
|
7
7
|
*/
|
|
8
8
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
9
|
exports.DrawPass = void 0;
|
|
10
|
-
var tslib_1 = require("tslib");
|
|
11
10
|
var render_target_1 = require("../../mol-gl/webgl/render-target");
|
|
12
|
-
var util_1 = require("../../mol-gl/compute/util");
|
|
13
|
-
var schema_1 = require("../../mol-gl/renderable/schema");
|
|
14
|
-
var renderable_1 = require("../../mol-gl/renderable");
|
|
15
|
-
var shader_code_1 = require("../../mol-gl/shader-code");
|
|
16
|
-
var render_item_1 = require("../../mol-gl/webgl/render-item");
|
|
17
11
|
var mol_util_1 = require("../../mol-util");
|
|
18
12
|
var linear_algebra_1 = require("../../mol-math/linear-algebra");
|
|
19
|
-
var quad_vert_1 = require("../../mol-gl/shader/quad.vert");
|
|
20
|
-
var depth_merge_frag_1 = require("../../mol-gl/shader/depth-merge.frag");
|
|
21
13
|
var stereo_1 = require("../camera/stereo");
|
|
22
14
|
var wboit_1 = require("./wboit");
|
|
23
15
|
var postprocessing_1 = require("./postprocessing");
|
|
24
16
|
var marking_1 = require("./marking");
|
|
25
|
-
var
|
|
26
|
-
var DepthMergeSchema = tslib_1.__assign(tslib_1.__assign({}, util_1.QuadSchema), { tDepthPrimitives: (0, schema_1.TextureSpec)('texture', 'depth', 'ushort', 'nearest'), tDepthVolumes: (0, schema_1.TextureSpec)('texture', 'depth', 'ushort', 'nearest'), uTexSize: (0, schema_1.UniformSpec)('v2'), dPackedDepth: (0, schema_1.DefineSpec)('boolean') });
|
|
27
|
-
var DepthMergeShaderCode = (0, shader_code_1.ShaderCode)('depth-merge', quad_vert_1.quad_vert, depth_merge_frag_1.depthMerge_frag);
|
|
28
|
-
function getDepthMergeRenderable(ctx, depthTexturePrimitives, depthTextureVolumes, packedDepth) {
|
|
29
|
-
var values = tslib_1.__assign(tslib_1.__assign({}, util_1.QuadValues), { tDepthPrimitives: mol_util_1.ValueCell.create(depthTexturePrimitives), tDepthVolumes: mol_util_1.ValueCell.create(depthTextureVolumes), uTexSize: mol_util_1.ValueCell.create(linear_algebra_1.Vec2.create(depthTexturePrimitives.getWidth(), depthTexturePrimitives.getHeight())), dPackedDepth: mol_util_1.ValueCell.create(packedDepth) });
|
|
30
|
-
var schema = tslib_1.__assign({}, DepthMergeSchema);
|
|
31
|
-
var renderItem = (0, render_item_1.createComputeRenderItem)(ctx, 'triangles', DepthMergeShaderCode, schema, values);
|
|
32
|
-
return (0, renderable_1.createComputeRenderable)(renderItem, values);
|
|
33
|
-
}
|
|
17
|
+
var util_1 = require("../../mol-gl/compute/util");
|
|
34
18
|
var DrawPass = /** @class */ (function () {
|
|
35
19
|
function DrawPass(webgl, width, height, enableWboit) {
|
|
36
20
|
this.webgl = webgl;
|
|
@@ -38,23 +22,19 @@ var DrawPass = /** @class */ (function () {
|
|
|
38
22
|
this.drawTarget = (0, render_target_1.createNullRenderTarget)(webgl.gl);
|
|
39
23
|
this.colorTarget = webgl.createRenderTarget(width, height, true, 'uint8', 'linear');
|
|
40
24
|
this.packedDepth = !extensions.depthTexture;
|
|
41
|
-
this.
|
|
42
|
-
this.
|
|
43
|
-
this.
|
|
44
|
-
this.
|
|
45
|
-
this.depthTexturePrimitives = this.depthTargetPrimitives ? this.depthTargetPrimitives.texture : resources.texture('image-depth', 'depth', isWebGL2 ? 'float' : 'ushort', 'nearest');
|
|
46
|
-
this.depthTextureVolumes = this.depthTargetVolumes ? this.depthTargetVolumes.texture : resources.texture('image-depth', 'depth', isWebGL2 ? 'float' : 'ushort', 'nearest');
|
|
25
|
+
this.depthTargetTransparent = webgl.createRenderTarget(width, height);
|
|
26
|
+
this.depthTextureTransparent = this.depthTargetTransparent.texture;
|
|
27
|
+
this.depthTargetOpaque = this.packedDepth ? webgl.createRenderTarget(width, height) : null;
|
|
28
|
+
this.depthTextureOpaque = this.depthTargetOpaque ? this.depthTargetOpaque.texture : resources.texture('image-depth', 'depth', isWebGL2 ? 'float' : 'ushort', 'nearest');
|
|
47
29
|
if (!this.packedDepth) {
|
|
48
|
-
this.
|
|
49
|
-
this.depthTextureVolumes.define(width, height);
|
|
30
|
+
this.depthTextureOpaque.define(width, height);
|
|
50
31
|
}
|
|
51
|
-
this.depthMerge = getDepthMergeRenderable(webgl, this.depthTexturePrimitives, this.depthTextureVolumes, this.packedDepth);
|
|
52
32
|
this.wboit = enableWboit ? new wboit_1.WboitPass(webgl, width, height) : undefined;
|
|
53
33
|
this.marking = new marking_1.MarkingPass(webgl, width, height);
|
|
54
34
|
this.postprocessing = new postprocessing_1.PostprocessingPass(webgl, this);
|
|
55
35
|
this.antialiasing = new postprocessing_1.AntialiasingPass(webgl, this);
|
|
56
|
-
this.copyFboTarget = (0,
|
|
57
|
-
this.copyFboPostprocessing = (0,
|
|
36
|
+
this.copyFboTarget = (0, util_1.createCopyRenderable)(webgl, this.colorTarget.texture);
|
|
37
|
+
this.copyFboPostprocessing = (0, util_1.createCopyRenderable)(webgl, this.postprocessing.target.texture);
|
|
58
38
|
}
|
|
59
39
|
Object.defineProperty(DrawPass.prototype, "wboitEnabled", {
|
|
60
40
|
get: function () {
|
|
@@ -74,20 +54,13 @@ var DrawPass = /** @class */ (function () {
|
|
|
74
54
|
var h = this.colorTarget.getHeight();
|
|
75
55
|
if (width !== w || height !== h) {
|
|
76
56
|
this.colorTarget.setSize(width, height);
|
|
77
|
-
this.
|
|
78
|
-
if (this.
|
|
79
|
-
this.
|
|
80
|
-
}
|
|
81
|
-
else {
|
|
82
|
-
this.depthTexturePrimitives.define(width, height);
|
|
83
|
-
}
|
|
84
|
-
if (this.depthTargetVolumes) {
|
|
85
|
-
this.depthTargetVolumes.setSize(width, height);
|
|
57
|
+
this.depthTargetTransparent.setSize(width, height);
|
|
58
|
+
if (this.depthTargetOpaque) {
|
|
59
|
+
this.depthTargetOpaque.setSize(width, height);
|
|
86
60
|
}
|
|
87
61
|
else {
|
|
88
|
-
this.
|
|
62
|
+
this.depthTextureOpaque.define(width, height);
|
|
89
63
|
}
|
|
90
|
-
mol_util_1.ValueCell.update(this.depthMerge.values.uTexSize, linear_algebra_1.Vec2.set(this.depthMerge.values.uTexSize.ref.value, width, height));
|
|
91
64
|
mol_util_1.ValueCell.update(this.copyFboTarget.values.uTexSize, linear_algebra_1.Vec2.set(this.copyFboTarget.values.uTexSize.ref.value, width, height));
|
|
92
65
|
mol_util_1.ValueCell.update(this.copyFboPostprocessing.values.uTexSize, linear_algebra_1.Vec2.set(this.copyFboPostprocessing.values.uTexSize.ref.value, width, height));
|
|
93
66
|
if ((_a = this.wboit) === null || _a === void 0 ? void 0 : _a.supported) {
|
|
@@ -98,18 +71,6 @@ var DrawPass = /** @class */ (function () {
|
|
|
98
71
|
this.antialiasing.setSize(width, height);
|
|
99
72
|
}
|
|
100
73
|
};
|
|
101
|
-
DrawPass.prototype._depthMerge = function () {
|
|
102
|
-
var _a = this.webgl, state = _a.state, gl = _a.gl;
|
|
103
|
-
this.depthMerge.update();
|
|
104
|
-
this.depthTarget.bind();
|
|
105
|
-
state.disable(gl.BLEND);
|
|
106
|
-
state.disable(gl.DEPTH_TEST);
|
|
107
|
-
state.disable(gl.CULL_FACE);
|
|
108
|
-
state.depthMask(false);
|
|
109
|
-
state.clearColor(1, 1, 1, 1);
|
|
110
|
-
gl.clear(gl.COLOR_BUFFER_BIT);
|
|
111
|
-
this.depthMerge.render();
|
|
112
|
-
};
|
|
113
74
|
DrawPass.prototype._renderWboit = function (renderer, camera, scene, transparentBackground, postprocessingProps) {
|
|
114
75
|
var _a;
|
|
115
76
|
if (!((_a = this.wboit) === null || _a === void 0 ? void 0 : _a.supported))
|
|
@@ -117,43 +78,44 @@ var DrawPass = /** @class */ (function () {
|
|
|
117
78
|
this.colorTarget.bind();
|
|
118
79
|
renderer.clear(true);
|
|
119
80
|
// render opaque primitives
|
|
120
|
-
this.
|
|
81
|
+
this.depthTextureOpaque.attachFramebuffer(this.colorTarget.framebuffer, 'depth');
|
|
121
82
|
this.colorTarget.bind();
|
|
122
83
|
renderer.clearDepth();
|
|
123
84
|
renderer.renderWboitOpaque(scene.primitives, camera, null);
|
|
124
|
-
// render opaque volumes
|
|
125
|
-
this.depthTextureVolumes.attachFramebuffer(this.colorTarget.framebuffer, 'depth');
|
|
126
|
-
this.colorTarget.bind();
|
|
127
|
-
renderer.clearDepth();
|
|
128
|
-
renderer.renderWboitOpaque(scene.volumes, camera, this.depthTexturePrimitives);
|
|
129
|
-
// merge depth of opaque primitives and volumes
|
|
130
|
-
this._depthMerge();
|
|
131
85
|
if (postprocessing_1.PostprocessingPass.isEnabled(postprocessingProps)) {
|
|
86
|
+
if (postprocessing_1.PostprocessingPass.isOutlineEnabled(postprocessingProps)) {
|
|
87
|
+
this.depthTargetTransparent.bind();
|
|
88
|
+
renderer.clearDepth(true);
|
|
89
|
+
if (scene.opacityAverage < 1) {
|
|
90
|
+
renderer.renderDepthTransparent(scene.primitives, camera, this.depthTextureOpaque);
|
|
91
|
+
}
|
|
92
|
+
}
|
|
132
93
|
this.postprocessing.render(camera, false, transparentBackground, renderer.props.backgroundColor, postprocessingProps);
|
|
133
94
|
}
|
|
134
95
|
// render transparent primitives and volumes
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
96
|
+
if (scene.opacityAverage < 1 || scene.volumes.renderables.length > 0) {
|
|
97
|
+
this.wboit.bind();
|
|
98
|
+
renderer.renderWboitTransparent(scene.primitives, camera, this.depthTextureOpaque);
|
|
99
|
+
renderer.renderWboitTransparent(scene.volumes, camera, this.depthTextureOpaque);
|
|
100
|
+
// evaluate wboit
|
|
101
|
+
if (postprocessing_1.PostprocessingPass.isEnabled(postprocessingProps)) {
|
|
102
|
+
this.postprocessing.target.bind();
|
|
103
|
+
}
|
|
104
|
+
else {
|
|
105
|
+
this.colorTarget.bind();
|
|
106
|
+
}
|
|
107
|
+
this.wboit.render();
|
|
146
108
|
}
|
|
147
|
-
this.wboit.render();
|
|
148
109
|
};
|
|
149
110
|
DrawPass.prototype._renderBlended = function (renderer, camera, scene, toDrawingBuffer, transparentBackground, postprocessingProps) {
|
|
111
|
+
var _a, _b;
|
|
150
112
|
if (toDrawingBuffer) {
|
|
151
113
|
this.drawTarget.bind();
|
|
152
114
|
}
|
|
153
115
|
else {
|
|
154
116
|
this.colorTarget.bind();
|
|
155
117
|
if (!this.packedDepth) {
|
|
156
|
-
this.
|
|
118
|
+
this.depthTextureOpaque.attachFramebuffer(this.colorTarget.framebuffer, 'depth');
|
|
157
119
|
}
|
|
158
120
|
}
|
|
159
121
|
renderer.clear(true);
|
|
@@ -161,39 +123,35 @@ var DrawPass = /** @class */ (function () {
|
|
|
161
123
|
if (!toDrawingBuffer) {
|
|
162
124
|
// do a depth pass if not rendering to drawing buffer and
|
|
163
125
|
// extensions.depthTexture is unsupported (i.e. depthTarget is set)
|
|
164
|
-
if (this.
|
|
165
|
-
this.
|
|
166
|
-
renderer.
|
|
167
|
-
|
|
168
|
-
renderer.renderDepth(scene.primitives, camera, null);
|
|
169
|
-
this.colorTarget.bind();
|
|
170
|
-
}
|
|
171
|
-
// do direct-volume rendering
|
|
172
|
-
if (!this.packedDepth) {
|
|
173
|
-
this.depthTextureVolumes.attachFramebuffer(this.colorTarget.framebuffer, 'depth');
|
|
174
|
-
renderer.clearDepth(); // from previous frame
|
|
175
|
-
}
|
|
176
|
-
renderer.renderBlendedVolumeOpaque(scene.volumes, camera, this.depthTexturePrimitives);
|
|
177
|
-
// do volume depth pass if extensions.depthTexture is unsupported (i.e. depthTarget is set)
|
|
178
|
-
if (this.depthTargetVolumes) {
|
|
179
|
-
this.depthTargetVolumes.bind();
|
|
180
|
-
renderer.clear(false);
|
|
181
|
-
renderer.renderDepth(scene.volumes, camera, this.depthTexturePrimitives);
|
|
126
|
+
if (this.depthTargetOpaque) {
|
|
127
|
+
this.depthTargetOpaque.bind();
|
|
128
|
+
renderer.clearDepth(true);
|
|
129
|
+
renderer.renderDepthOpaque(scene.primitives, camera, null);
|
|
182
130
|
this.colorTarget.bind();
|
|
183
131
|
}
|
|
184
|
-
// merge depths from primitive and volume rendering
|
|
185
|
-
this._depthMerge();
|
|
186
|
-
this.colorTarget.bind();
|
|
187
132
|
if (postprocessing_1.PostprocessingPass.isEnabled(postprocessingProps)) {
|
|
133
|
+
if (!this.packedDepth) {
|
|
134
|
+
this.depthTextureOpaque.detachFramebuffer(this.postprocessing.target.framebuffer, 'depth');
|
|
135
|
+
}
|
|
136
|
+
else {
|
|
137
|
+
(_a = this.colorTarget.depthRenderbuffer) === null || _a === void 0 ? void 0 : _a.detachFramebuffer(this.postprocessing.target.framebuffer);
|
|
138
|
+
}
|
|
139
|
+
if (postprocessing_1.PostprocessingPass.isOutlineEnabled(postprocessingProps)) {
|
|
140
|
+
this.depthTargetTransparent.bind();
|
|
141
|
+
renderer.clearDepth(true);
|
|
142
|
+
if (scene.opacityAverage < 1) {
|
|
143
|
+
renderer.renderDepthTransparent(scene.primitives, camera, this.depthTextureOpaque);
|
|
144
|
+
}
|
|
145
|
+
}
|
|
188
146
|
this.postprocessing.render(camera, false, transparentBackground, renderer.props.backgroundColor, postprocessingProps);
|
|
147
|
+
if (!this.packedDepth) {
|
|
148
|
+
this.depthTextureOpaque.attachFramebuffer(this.postprocessing.target.framebuffer, 'depth');
|
|
149
|
+
}
|
|
150
|
+
else {
|
|
151
|
+
(_b = this.colorTarget.depthRenderbuffer) === null || _b === void 0 ? void 0 : _b.attachFramebuffer(this.postprocessing.target.framebuffer);
|
|
152
|
+
}
|
|
189
153
|
}
|
|
190
|
-
renderer.
|
|
191
|
-
var target = postprocessing_1.PostprocessingPass.isEnabled(postprocessingProps)
|
|
192
|
-
? this.postprocessing.target : this.colorTarget;
|
|
193
|
-
if (!this.packedDepth) {
|
|
194
|
-
this.depthTexturePrimitives.attachFramebuffer(target.framebuffer, 'depth');
|
|
195
|
-
}
|
|
196
|
-
target.bind();
|
|
154
|
+
renderer.renderBlendedVolume(scene.volumes, camera, this.depthTextureOpaque);
|
|
197
155
|
}
|
|
198
156
|
renderer.renderBlendedTransparent(scene.primitives, camera, null);
|
|
199
157
|
};
|
|
@@ -225,10 +183,9 @@ var DrawPass = /** @class */ (function () {
|
|
|
225
183
|
this.drawTarget.bind();
|
|
226
184
|
}
|
|
227
185
|
if (markingEnabled) {
|
|
228
|
-
|
|
229
|
-
if (markerAverage > 0) {
|
|
186
|
+
if (scene.markerAverage > 0) {
|
|
230
187
|
var markingDepthTest = props.marking.ghostEdgeStrength < 1;
|
|
231
|
-
if (markingDepthTest && markerAverage !== 1) {
|
|
188
|
+
if (markingDepthTest && scene.markerAverage !== 1) {
|
|
232
189
|
this.marking.depthTarget.bind();
|
|
233
190
|
renderer.clear(false, true);
|
|
234
191
|
renderer.renderMarkingDepth(scene.primitives, camera, null);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
/**
|
|
3
|
-
* Copyright (c) 2019-
|
|
3
|
+
* Copyright (c) 2019-2022 mol* contributors, licensed under MIT, See LICENSE file for more info.
|
|
4
4
|
*
|
|
5
5
|
* @author Alexander Rose <alexander.rose@weirdbyte.de>
|
|
6
6
|
*/
|
|
@@ -47,11 +47,9 @@ var PickPass = /** @class */ (function () {
|
|
|
47
47
|
}
|
|
48
48
|
};
|
|
49
49
|
PickPass.prototype.renderVariant = function (renderer, camera, scene, helper, variant, pickType) {
|
|
50
|
-
var depth = this.drawPass.depthTexturePrimitives;
|
|
51
50
|
renderer.clear(false);
|
|
52
51
|
renderer.update(camera);
|
|
53
52
|
renderer.renderPick(scene.primitives, camera, variant, null, pickType);
|
|
54
|
-
renderer.renderPick(scene.volumes, camera, variant, depth, pickType);
|
|
55
53
|
renderer.renderPick(helper.handle.scene, camera, variant, null, pickType);
|
|
56
54
|
if (helper.camera.isEnabled) {
|
|
57
55
|
helper.camera.update(camera);
|
|
@@ -38,6 +38,7 @@ export declare class PostprocessingPass {
|
|
|
38
38
|
private webgl;
|
|
39
39
|
private drawPass;
|
|
40
40
|
static isEnabled(props: PostprocessingProps): boolean;
|
|
41
|
+
static isOutlineEnabled(props: PostprocessingProps): boolean;
|
|
41
42
|
readonly target: RenderTarget;
|
|
42
43
|
private readonly outlinesTarget;
|
|
43
44
|
private readonly outlinesRenderable;
|
|
@@ -24,9 +24,11 @@ var postprocessing_frag_1 = require("../../mol-gl/shader/postprocessing.frag");
|
|
|
24
24
|
var color_1 = require("../../mol-util/color");
|
|
25
25
|
var fxaa_1 = require("./fxaa");
|
|
26
26
|
var smaa_1 = require("./smaa");
|
|
27
|
-
var OutlinesSchema = tslib_1.__assign(tslib_1.__assign({}, util_1.QuadSchema), {
|
|
28
|
-
function getOutlinesRenderable(ctx,
|
|
29
|
-
var
|
|
27
|
+
var OutlinesSchema = tslib_1.__assign(tslib_1.__assign({}, util_1.QuadSchema), { tDepthOpaque: (0, schema_1.TextureSpec)('texture', 'rgba', 'ubyte', 'nearest'), tDepthTransparent: (0, schema_1.TextureSpec)('texture', 'rgba', 'ubyte', 'nearest'), uTexSize: (0, schema_1.UniformSpec)('v2'), dOrthographic: (0, schema_1.DefineSpec)('number'), uNear: (0, schema_1.UniformSpec)('f'), uFar: (0, schema_1.UniformSpec)('f'), uMaxPossibleViewZDiff: (0, schema_1.UniformSpec)('f') });
|
|
28
|
+
function getOutlinesRenderable(ctx, depthTextureOpaque, depthTextureTransparent) {
|
|
29
|
+
var width = depthTextureOpaque.getWidth();
|
|
30
|
+
var height = depthTextureOpaque.getHeight();
|
|
31
|
+
var values = tslib_1.__assign(tslib_1.__assign({}, util_1.QuadValues), { tDepthOpaque: mol_util_1.ValueCell.create(depthTextureOpaque), tDepthTransparent: mol_util_1.ValueCell.create(depthTextureTransparent), uTexSize: mol_util_1.ValueCell.create(linear_algebra_1.Vec2.create(width, height)), dOrthographic: mol_util_1.ValueCell.create(0), uNear: mol_util_1.ValueCell.create(1), uFar: mol_util_1.ValueCell.create(10000), uMaxPossibleViewZDiff: mol_util_1.ValueCell.create(0.5) });
|
|
30
32
|
var schema = tslib_1.__assign({}, OutlinesSchema);
|
|
31
33
|
var shaderCode = (0, shader_code_1.ShaderCode)('outlines', quad_vert_1.quad_vert, outlines_frag_1.outlines_frag);
|
|
32
34
|
var renderItem = (0, render_item_1.createComputeRenderItem)(ctx, 'triangles', shaderCode, schema, values);
|
|
@@ -68,9 +70,9 @@ function getSamples(vectorSamples, nSamples) {
|
|
|
68
70
|
}
|
|
69
71
|
return samples;
|
|
70
72
|
}
|
|
71
|
-
var PostprocessingSchema = tslib_1.__assign(tslib_1.__assign({}, util_1.QuadSchema), { tSsaoDepth: (0, schema_1.TextureSpec)('texture', 'rgba', 'ubyte', 'nearest'), tColor: (0, schema_1.TextureSpec)('texture', 'rgba', 'ubyte', 'nearest'),
|
|
72
|
-
function getPostprocessingRenderable(ctx, colorTexture,
|
|
73
|
-
var values = tslib_1.__assign(tslib_1.__assign({}, util_1.QuadValues), { tSsaoDepth: mol_util_1.ValueCell.create(ssaoDepthTexture), tColor: mol_util_1.ValueCell.create(colorTexture),
|
|
73
|
+
var PostprocessingSchema = tslib_1.__assign(tslib_1.__assign({}, util_1.QuadSchema), { tSsaoDepth: (0, schema_1.TextureSpec)('texture', 'rgba', 'ubyte', 'nearest'), tColor: (0, schema_1.TextureSpec)('texture', 'rgba', 'ubyte', 'nearest'), tDepthOpaque: (0, schema_1.TextureSpec)('texture', 'rgba', 'ubyte', 'nearest'), tDepthTransparent: (0, schema_1.TextureSpec)('texture', 'rgba', 'ubyte', 'nearest'), tOutlines: (0, schema_1.TextureSpec)('texture', 'rgba', 'ubyte', 'nearest'), uTexSize: (0, schema_1.UniformSpec)('v2'), dOrthographic: (0, schema_1.DefineSpec)('number'), uNear: (0, schema_1.UniformSpec)('f'), uFar: (0, schema_1.UniformSpec)('f'), uFogNear: (0, schema_1.UniformSpec)('f'), uFogFar: (0, schema_1.UniformSpec)('f'), uFogColor: (0, schema_1.UniformSpec)('v3'), uOutlineColor: (0, schema_1.UniformSpec)('v3'), uTransparentBackground: (0, schema_1.UniformSpec)('b'), uMaxPossibleViewZDiff: (0, schema_1.UniformSpec)('f'), dOcclusionEnable: (0, schema_1.DefineSpec)('boolean'), uOcclusionOffset: (0, schema_1.UniformSpec)('v2'), dOutlineEnable: (0, schema_1.DefineSpec)('boolean'), dOutlineScale: (0, schema_1.DefineSpec)('number'), uOutlineThreshold: (0, schema_1.UniformSpec)('f') });
|
|
74
|
+
function getPostprocessingRenderable(ctx, colorTexture, depthTextureOpaque, depthTextureTransparent, outlinesTexture, ssaoDepthTexture) {
|
|
75
|
+
var values = tslib_1.__assign(tslib_1.__assign({}, util_1.QuadValues), { tSsaoDepth: mol_util_1.ValueCell.create(ssaoDepthTexture), tColor: mol_util_1.ValueCell.create(colorTexture), tDepthOpaque: mol_util_1.ValueCell.create(depthTextureOpaque), tDepthTransparent: mol_util_1.ValueCell.create(depthTextureTransparent), tOutlines: mol_util_1.ValueCell.create(outlinesTexture), uTexSize: mol_util_1.ValueCell.create(linear_algebra_1.Vec2.create(colorTexture.getWidth(), colorTexture.getHeight())), dOrthographic: mol_util_1.ValueCell.create(0), uNear: mol_util_1.ValueCell.create(1), uFar: mol_util_1.ValueCell.create(10000), uFogNear: mol_util_1.ValueCell.create(10000), uFogFar: mol_util_1.ValueCell.create(10000), uFogColor: mol_util_1.ValueCell.create(linear_algebra_1.Vec3.create(1, 1, 1)), uOutlineColor: mol_util_1.ValueCell.create(linear_algebra_1.Vec3.create(0, 0, 0)), uTransparentBackground: mol_util_1.ValueCell.create(false), uMaxPossibleViewZDiff: mol_util_1.ValueCell.create(0.5), dOcclusionEnable: mol_util_1.ValueCell.create(true), uOcclusionOffset: mol_util_1.ValueCell.create(linear_algebra_1.Vec2.create(0, 0)), dOutlineEnable: mol_util_1.ValueCell.create(false), dOutlineScale: mol_util_1.ValueCell.create(1), uOutlineThreshold: mol_util_1.ValueCell.create(0.33) });
|
|
74
76
|
var schema = tslib_1.__assign({}, PostprocessingSchema);
|
|
75
77
|
var shaderCode = (0, shader_code_1.ShaderCode)('postprocessing', quad_vert_1.quad_vert, postprocessing_frag_1.postprocessing_frag);
|
|
76
78
|
var renderItem = (0, render_item_1.createComputeRenderItem)(ctx, 'triangles', shaderCode, schema, values);
|
|
@@ -106,7 +108,7 @@ var PostprocessingPass = /** @class */ (function () {
|
|
|
106
108
|
this.webgl = webgl;
|
|
107
109
|
this.drawPass = drawPass;
|
|
108
110
|
this.occlusionOffset = [0, 0];
|
|
109
|
-
var colorTarget = drawPass.colorTarget,
|
|
111
|
+
var colorTarget = drawPass.colorTarget, depthTextureTransparent = drawPass.depthTextureTransparent, depthTextureOpaque = drawPass.depthTextureOpaque;
|
|
110
112
|
var width = colorTarget.getWidth();
|
|
111
113
|
var height = colorTarget.getHeight();
|
|
112
114
|
this.nSamples = 1;
|
|
@@ -116,7 +118,7 @@ var PostprocessingPass = /** @class */ (function () {
|
|
|
116
118
|
// needs to be linear for anti-aliasing pass
|
|
117
119
|
this.target = webgl.createRenderTarget(width, height, false, 'uint8', 'linear');
|
|
118
120
|
this.outlinesTarget = webgl.createRenderTarget(width, height, false);
|
|
119
|
-
this.outlinesRenderable = getOutlinesRenderable(webgl,
|
|
121
|
+
this.outlinesRenderable = getOutlinesRenderable(webgl, depthTextureOpaque, depthTextureTransparent);
|
|
120
122
|
this.randomHemisphereVector = [];
|
|
121
123
|
for (var i = 0; i < 256; i++) {
|
|
122
124
|
var v = (0, linear_algebra_1.Vec3)();
|
|
@@ -133,7 +135,7 @@ var PostprocessingPass = /** @class */ (function () {
|
|
|
133
135
|
var sw = Math.floor(width * this.ssaoScale);
|
|
134
136
|
var sh = Math.floor(height * this.ssaoScale);
|
|
135
137
|
this.downsampledDepthTarget = webgl.createRenderTarget(sw, sh, false, 'uint8', 'linear');
|
|
136
|
-
this.downsampleDepthRenderable = (0, util_1.createCopyRenderable)(webgl,
|
|
138
|
+
this.downsampleDepthRenderable = (0, util_1.createCopyRenderable)(webgl, depthTextureOpaque);
|
|
137
139
|
this.ssaoDepthTexture = webgl.resources.texture('image-uint8', 'rgba', 'ubyte', 'linear');
|
|
138
140
|
this.ssaoDepthTexture.define(sw, sh);
|
|
139
141
|
this.ssaoDepthTexture.attachFramebuffer(this.ssaoFramebuffer, 'color0');
|
|
@@ -141,14 +143,17 @@ var PostprocessingPass = /** @class */ (function () {
|
|
|
141
143
|
this.ssaoDepthBlurProxyTexture.define(sw, sh);
|
|
142
144
|
this.ssaoDepthBlurProxyTexture.attachFramebuffer(this.ssaoBlurFirstPassFramebuffer, 'color0');
|
|
143
145
|
this.ssaoDepthTexture.attachFramebuffer(this.ssaoBlurSecondPassFramebuffer, 'color0');
|
|
144
|
-
this.ssaoRenderable = getSsaoRenderable(webgl, this.downsampleFactor === 1 ?
|
|
146
|
+
this.ssaoRenderable = getSsaoRenderable(webgl, this.downsampleFactor === 1 ? depthTextureOpaque : this.downsampledDepthTarget.texture);
|
|
145
147
|
this.ssaoBlurFirstPassRenderable = getSsaoBlurRenderable(webgl, this.ssaoDepthTexture, 'horizontal');
|
|
146
148
|
this.ssaoBlurSecondPassRenderable = getSsaoBlurRenderable(webgl, this.ssaoDepthBlurProxyTexture, 'vertical');
|
|
147
|
-
this.renderable = getPostprocessingRenderable(webgl, colorTarget.texture,
|
|
149
|
+
this.renderable = getPostprocessingRenderable(webgl, colorTarget.texture, depthTextureOpaque, depthTextureTransparent, this.outlinesTarget.texture, this.ssaoDepthTexture);
|
|
148
150
|
}
|
|
149
151
|
PostprocessingPass.isEnabled = function (props) {
|
|
150
152
|
return props.occlusion.name === 'on' || props.outline.name === 'on';
|
|
151
153
|
};
|
|
154
|
+
PostprocessingPass.isOutlineEnabled = function (props) {
|
|
155
|
+
return props.outline.name === 'on';
|
|
156
|
+
};
|
|
152
157
|
PostprocessingPass.prototype.calcSsaoScale = function () {
|
|
153
158
|
// downscale ssao for high pixel-ratios
|
|
154
159
|
return Math.min(1, 1 / this.webgl.pixelRatio) * this.downsampleFactor;
|
|
@@ -229,7 +234,7 @@ var PostprocessingPass = /** @class */ (function () {
|
|
|
229
234
|
this.ssaoDepthTexture.define(sw, sh);
|
|
230
235
|
this.ssaoDepthBlurProxyTexture.define(sw, sh);
|
|
231
236
|
if (this.ssaoScale === 1) {
|
|
232
|
-
mol_util_1.ValueCell.update(this.ssaoRenderable.values.tDepth, this.drawPass.
|
|
237
|
+
mol_util_1.ValueCell.update(this.ssaoRenderable.values.tDepth, this.drawPass.depthTextureTransparent);
|
|
233
238
|
}
|
|
234
239
|
else {
|
|
235
240
|
mol_util_1.ValueCell.update(this.ssaoRenderable.values.tDepth, this.downsampledDepthTarget.texture);
|
|
@@ -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;
|
|
@@ -12,7 +12,6 @@ var util_1 = require("../../mol-gl/renderable/util");
|
|
|
12
12
|
var color_1 = require("../../mol-util/color");
|
|
13
13
|
var linear_algebra_1 = require("../../mol-math/linear-algebra");
|
|
14
14
|
var location_1 = require("../../mol-model/location");
|
|
15
|
-
var geometry_1 = require("./geometry");
|
|
16
15
|
var texture_1 = require("../../mol-gl/webgl/texture");
|
|
17
16
|
function createColors(locationIt, positionIt, colorTheme, colorData) {
|
|
18
17
|
var data = _createColors(locationIt, positionIt, colorTheme, colorData);
|
|
@@ -27,27 +26,18 @@ function createColors(locationIt, positionIt, colorTheme, colorData) {
|
|
|
27
26
|
}
|
|
28
27
|
exports.createColors = createColors;
|
|
29
28
|
function _createColors(locationIt, positionIt, colorTheme, colorData) {
|
|
30
|
-
switch (
|
|
29
|
+
switch (colorTheme.granularity) {
|
|
31
30
|
case 'uniform': return createUniformColor(locationIt, colorTheme.color, colorData);
|
|
32
|
-
case 'instance':
|
|
31
|
+
case 'instance':
|
|
32
|
+
return locationIt.nonInstanceable
|
|
33
|
+
? createGroupColor(locationIt, colorTheme.color, colorData)
|
|
34
|
+
: createInstanceColor(locationIt, colorTheme.color, colorData);
|
|
33
35
|
case 'group': return createGroupColor(locationIt, colorTheme.color, colorData);
|
|
34
36
|
case 'groupInstance': return createGroupInstanceColor(locationIt, colorTheme.color, colorData);
|
|
35
37
|
case 'vertex': return createVertexColor(positionIt, colorTheme.color, colorData);
|
|
36
38
|
case 'vertexInstance': return createVertexInstanceColor(positionIt, colorTheme.color, colorData);
|
|
37
|
-
case 'volume':
|
|
38
|
-
|
|
39
|
-
return createGridColor(colorTheme.grid, 'volume', colorData);
|
|
40
|
-
}
|
|
41
|
-
else {
|
|
42
|
-
throw new Error('Grid missing for "volume" color theme');
|
|
43
|
-
}
|
|
44
|
-
case 'volumeInstance':
|
|
45
|
-
if (colorTheme.grid) {
|
|
46
|
-
return createGridColor(colorTheme.grid, 'volumeInstance', colorData);
|
|
47
|
-
}
|
|
48
|
-
else {
|
|
49
|
-
throw new Error('Grid missing for "volume" color theme');
|
|
50
|
-
}
|
|
39
|
+
case 'volume': return createGridColor(colorTheme.grid, 'volume', colorData);
|
|
40
|
+
case 'volumeInstance': return createGridColor(colorTheme.grid, 'volumeInstance', colorData);
|
|
51
41
|
case 'direct': return createDirectColor(colorData);
|
|
52
42
|
}
|
|
53
43
|
}
|
|
@@ -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<{
|
|
@@ -156,7 +156,7 @@ var Cylinders;
|
|
|
156
156
|
var padding = (0, size_data_1.getMaxSize)(size) * props.sizeFactor;
|
|
157
157
|
var invariantBoundingSphere = geometry_1.Sphere3D.clone(cylinders.boundingSphere);
|
|
158
158
|
var boundingSphere = (0, util_2.calculateTransformBoundingSphere)(invariantBoundingSphere, transform.aTransform.ref.value, instanceCount);
|
|
159
|
-
return tslib_1.__assign(tslib_1.__assign(tslib_1.__assign(tslib_1.__assign(tslib_1.__assign(tslib_1.__assign(tslib_1.__assign(tslib_1.__assign(tslib_1.__assign(tslib_1.__assign(tslib_1.__assign({ dGeometryType: mol_util_1.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: mol_util_1.ValueCell.create(boundingSphere), invariantBoundingSphere: mol_util_1.ValueCell.create(invariantBoundingSphere), uInvariantBoundingSphere: mol_util_1.ValueCell.create(linear_algebra_1.Vec4.ofSphere(invariantBoundingSphere)) }, color), size), marker), overpaint), transparency), material), clipping), transform), { padding: mol_util_1.ValueCell.create(padding) }), base_1.BaseGeometry.createValues(props, counts)), { uSizeFactor: mol_util_1.ValueCell.create(props.sizeFactor * props.sizeAspectRatio), uDoubleSided: mol_util_1.ValueCell.create(props.doubleSided), dIgnoreLight: mol_util_1.ValueCell.create(props.ignoreLight), dXrayShaded: mol_util_1.ValueCell.create(props.xrayShaded),
|
|
159
|
+
return tslib_1.__assign(tslib_1.__assign(tslib_1.__assign(tslib_1.__assign(tslib_1.__assign(tslib_1.__assign(tslib_1.__assign(tslib_1.__assign(tslib_1.__assign(tslib_1.__assign(tslib_1.__assign({ dGeometryType: mol_util_1.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: mol_util_1.ValueCell.create(boundingSphere), invariantBoundingSphere: mol_util_1.ValueCell.create(invariantBoundingSphere), uInvariantBoundingSphere: mol_util_1.ValueCell.create(linear_algebra_1.Vec4.ofSphere(invariantBoundingSphere)) }, color), size), marker), overpaint), transparency), material), clipping), transform), { padding: mol_util_1.ValueCell.create(padding) }), base_1.BaseGeometry.createValues(props, counts)), { uSizeFactor: mol_util_1.ValueCell.create(props.sizeFactor * props.sizeAspectRatio), uDoubleSided: mol_util_1.ValueCell.create(props.doubleSided), dIgnoreLight: mol_util_1.ValueCell.create(props.ignoreLight), dXrayShaded: mol_util_1.ValueCell.create(props.xrayShaded), dTransparentBackfaces: mol_util_1.ValueCell.create(props.transparentBackfaces), uBumpFrequency: mol_util_1.ValueCell.create(props.bumpFrequency), uBumpAmplitude: mol_util_1.ValueCell.create(props.bumpAmplitude) });
|
|
160
160
|
}
|
|
161
161
|
function createValuesSimple(cylinders, props, colorValue, sizeValue, transform) {
|
|
162
162
|
var s = base_1.BaseGeometry.createSimple(colorValue, sizeValue, transform);
|
|
@@ -169,7 +169,7 @@ var Cylinders;
|
|
|
169
169
|
mol_util_1.ValueCell.updateIfChanged(values.uDoubleSided, props.doubleSided);
|
|
170
170
|
mol_util_1.ValueCell.updateIfChanged(values.dIgnoreLight, props.ignoreLight);
|
|
171
171
|
mol_util_1.ValueCell.updateIfChanged(values.dXrayShaded, props.xrayShaded);
|
|
172
|
-
mol_util_1.ValueCell.updateIfChanged(values.
|
|
172
|
+
mol_util_1.ValueCell.updateIfChanged(values.dTransparentBackfaces, props.transparentBackfaces);
|
|
173
173
|
mol_util_1.ValueCell.updateIfChanged(values.uBumpFrequency, props.bumpFrequency);
|
|
174
174
|
mol_util_1.ValueCell.updateIfChanged(values.uBumpAmplitude, props.bumpAmplitude);
|
|
175
175
|
}
|
|
@@ -596,7 +596,7 @@ var Mesh;
|
|
|
596
596
|
var counts = { drawCount: mesh.triangleCount * 3, vertexCount: mesh.vertexCount, groupCount: groupCount, instanceCount: instanceCount };
|
|
597
597
|
var invariantBoundingSphere = geometry_1.Sphere3D.clone(mesh.boundingSphere);
|
|
598
598
|
var boundingSphere = (0, util_3.calculateTransformBoundingSphere)(invariantBoundingSphere, transform.aTransform.ref.value, instanceCount);
|
|
599
|
-
return tslib_1.__assign(tslib_1.__assign(tslib_1.__assign(tslib_1.__assign(tslib_1.__assign(tslib_1.__assign(tslib_1.__assign(tslib_1.__assign(tslib_1.__assign({ dGeometryType: mol_util_1.ValueCell.create('mesh'), aPosition: mesh.vertexBuffer, aNormal: mesh.normalBuffer, aGroup: mesh.groupBuffer, elements: mesh.indexBuffer, boundingSphere: mol_util_1.ValueCell.create(boundingSphere), invariantBoundingSphere: mol_util_1.ValueCell.create(invariantBoundingSphere), uInvariantBoundingSphere: mol_util_1.ValueCell.create(linear_algebra_1.Vec4.ofSphere(invariantBoundingSphere)) }, color), marker), overpaint), transparency), material), clipping), transform), base_1.BaseGeometry.createValues(props, counts)), { uDoubleSided: mol_util_1.ValueCell.create(props.doubleSided), dFlatShaded: mol_util_1.ValueCell.create(props.flatShaded), dFlipSided: mol_util_1.ValueCell.create(props.flipSided), dIgnoreLight: mol_util_1.ValueCell.create(props.ignoreLight), dXrayShaded: mol_util_1.ValueCell.create(props.xrayShaded),
|
|
599
|
+
return tslib_1.__assign(tslib_1.__assign(tslib_1.__assign(tslib_1.__assign(tslib_1.__assign(tslib_1.__assign(tslib_1.__assign(tslib_1.__assign(tslib_1.__assign({ dGeometryType: mol_util_1.ValueCell.create('mesh'), aPosition: mesh.vertexBuffer, aNormal: mesh.normalBuffer, aGroup: mesh.groupBuffer, elements: mesh.indexBuffer, boundingSphere: mol_util_1.ValueCell.create(boundingSphere), invariantBoundingSphere: mol_util_1.ValueCell.create(invariantBoundingSphere), uInvariantBoundingSphere: mol_util_1.ValueCell.create(linear_algebra_1.Vec4.ofSphere(invariantBoundingSphere)) }, color), marker), overpaint), transparency), material), clipping), transform), base_1.BaseGeometry.createValues(props, counts)), { uDoubleSided: mol_util_1.ValueCell.create(props.doubleSided), dFlatShaded: mol_util_1.ValueCell.create(props.flatShaded), dFlipSided: mol_util_1.ValueCell.create(props.flipSided), dIgnoreLight: mol_util_1.ValueCell.create(props.ignoreLight), dXrayShaded: mol_util_1.ValueCell.create(props.xrayShaded), dTransparentBackfaces: mol_util_1.ValueCell.create(props.transparentBackfaces), uBumpFrequency: mol_util_1.ValueCell.create(props.bumpFrequency), uBumpAmplitude: mol_util_1.ValueCell.create(props.bumpAmplitude), meta: mol_util_1.ValueCell.create(mesh.meta) });
|
|
600
600
|
}
|
|
601
601
|
function createValuesSimple(mesh, props, colorValue, sizeValue, transform) {
|
|
602
602
|
var s = base_1.BaseGeometry.createSimple(colorValue, sizeValue, transform);
|
|
@@ -610,7 +610,7 @@ var Mesh;
|
|
|
610
610
|
mol_util_1.ValueCell.updateIfChanged(values.dFlipSided, props.flipSided);
|
|
611
611
|
mol_util_1.ValueCell.updateIfChanged(values.dIgnoreLight, props.ignoreLight);
|
|
612
612
|
mol_util_1.ValueCell.updateIfChanged(values.dXrayShaded, props.xrayShaded);
|
|
613
|
-
mol_util_1.ValueCell.updateIfChanged(values.
|
|
613
|
+
mol_util_1.ValueCell.updateIfChanged(values.dTransparentBackfaces, props.transparentBackfaces);
|
|
614
614
|
mol_util_1.ValueCell.updateIfChanged(values.uBumpFrequency, props.bumpFrequency);
|
|
615
615
|
mol_util_1.ValueCell.updateIfChanged(values.uBumpAmplitude, props.bumpAmplitude);
|
|
616
616
|
}
|
|
@@ -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<{
|
|
@@ -135,7 +135,7 @@ var Spheres;
|
|
|
135
135
|
var padding = spheres.boundingSphere.radius ? (0, size_data_1.getMaxSize)(size) * props.sizeFactor : 0;
|
|
136
136
|
var invariantBoundingSphere = geometry_1.Sphere3D.expand((0, geometry_1.Sphere3D)(), spheres.boundingSphere, padding);
|
|
137
137
|
var boundingSphere = (0, util_1.calculateTransformBoundingSphere)(invariantBoundingSphere, transform.aTransform.ref.value, instanceCount);
|
|
138
|
-
return tslib_1.__assign(tslib_1.__assign(tslib_1.__assign(tslib_1.__assign(tslib_1.__assign(tslib_1.__assign(tslib_1.__assign(tslib_1.__assign(tslib_1.__assign(tslib_1.__assign(tslib_1.__assign({ dGeometryType: mol_util_1.ValueCell.create('spheres'), aPosition: spheres.centerBuffer, aMapping: spheres.mappingBuffer, aGroup: spheres.groupBuffer, elements: spheres.indexBuffer, boundingSphere: mol_util_1.ValueCell.create(boundingSphere), invariantBoundingSphere: mol_util_1.ValueCell.create(invariantBoundingSphere), uInvariantBoundingSphere: mol_util_1.ValueCell.create(linear_algebra_1.Vec4.ofSphere(invariantBoundingSphere)) }, color), size), marker), overpaint), transparency), material), clipping), transform), { padding: mol_util_1.ValueCell.create(padding) }), base_1.BaseGeometry.createValues(props, counts)), { uSizeFactor: mol_util_1.ValueCell.create(props.sizeFactor), uDoubleSided: mol_util_1.ValueCell.create(props.doubleSided), dIgnoreLight: mol_util_1.ValueCell.create(props.ignoreLight), dXrayShaded: mol_util_1.ValueCell.create(props.xrayShaded),
|
|
138
|
+
return tslib_1.__assign(tslib_1.__assign(tslib_1.__assign(tslib_1.__assign(tslib_1.__assign(tslib_1.__assign(tslib_1.__assign(tslib_1.__assign(tslib_1.__assign(tslib_1.__assign(tslib_1.__assign({ dGeometryType: mol_util_1.ValueCell.create('spheres'), aPosition: spheres.centerBuffer, aMapping: spheres.mappingBuffer, aGroup: spheres.groupBuffer, elements: spheres.indexBuffer, boundingSphere: mol_util_1.ValueCell.create(boundingSphere), invariantBoundingSphere: mol_util_1.ValueCell.create(invariantBoundingSphere), uInvariantBoundingSphere: mol_util_1.ValueCell.create(linear_algebra_1.Vec4.ofSphere(invariantBoundingSphere)) }, color), size), marker), overpaint), transparency), material), clipping), transform), { padding: mol_util_1.ValueCell.create(padding) }), base_1.BaseGeometry.createValues(props, counts)), { uSizeFactor: mol_util_1.ValueCell.create(props.sizeFactor), uDoubleSided: mol_util_1.ValueCell.create(props.doubleSided), dIgnoreLight: mol_util_1.ValueCell.create(props.ignoreLight), dXrayShaded: mol_util_1.ValueCell.create(props.xrayShaded), dTransparentBackfaces: mol_util_1.ValueCell.create(props.transparentBackfaces), uBumpFrequency: mol_util_1.ValueCell.create(props.bumpFrequency), uBumpAmplitude: mol_util_1.ValueCell.create(props.bumpAmplitude) });
|
|
139
139
|
}
|
|
140
140
|
function createValuesSimple(spheres, props, colorValue, sizeValue, transform) {
|
|
141
141
|
var s = base_1.BaseGeometry.createSimple(colorValue, sizeValue, transform);
|
|
@@ -148,7 +148,7 @@ var Spheres;
|
|
|
148
148
|
mol_util_1.ValueCell.updateIfChanged(values.uDoubleSided, props.doubleSided);
|
|
149
149
|
mol_util_1.ValueCell.updateIfChanged(values.dIgnoreLight, props.ignoreLight);
|
|
150
150
|
mol_util_1.ValueCell.updateIfChanged(values.dXrayShaded, props.xrayShaded);
|
|
151
|
-
mol_util_1.ValueCell.updateIfChanged(values.
|
|
151
|
+
mol_util_1.ValueCell.updateIfChanged(values.dTransparentBackfaces, props.transparentBackfaces);
|
|
152
152
|
mol_util_1.ValueCell.updateIfChanged(values.uBumpFrequency, props.bumpFrequency);
|
|
153
153
|
mol_util_1.ValueCell.updateIfChanged(values.uBumpAmplitude, props.bumpAmplitude);
|
|
154
154
|
}
|
|
@@ -113,7 +113,7 @@ var TextureMesh;
|
|
|
113
113
|
var counts = { drawCount: textureMesh.vertexCount, vertexCount: textureMesh.vertexCount, groupCount: groupCount, instanceCount: instanceCount };
|
|
114
114
|
var invariantBoundingSphere = geometry_1.Sphere3D.clone(textureMesh.boundingSphere);
|
|
115
115
|
var boundingSphere = (0, util_1.calculateTransformBoundingSphere)(invariantBoundingSphere, transform.aTransform.ref.value, instanceCount);
|
|
116
|
-
return tslib_1.__assign(tslib_1.__assign(tslib_1.__assign(tslib_1.__assign(tslib_1.__assign(tslib_1.__assign(tslib_1.__assign(tslib_1.__assign(tslib_1.__assign({ dGeometryType: mol_util_1.ValueCell.create('textureMesh'), uGeoTexDim: textureMesh.geoTextureDim, tPosition: textureMesh.vertexTexture, tGroup: textureMesh.groupTexture, tNormal: textureMesh.normalTexture, boundingSphere: mol_util_1.ValueCell.create(boundingSphere), invariantBoundingSphere: mol_util_1.ValueCell.create(invariantBoundingSphere), uInvariantBoundingSphere: mol_util_1.ValueCell.create(linear_algebra_1.Vec4.ofSphere(invariantBoundingSphere)) }, color), marker), overpaint), transparency), substance), clipping), transform), base_1.BaseGeometry.createValues(props, counts)), { uDoubleSided: mol_util_1.ValueCell.create(props.doubleSided), dFlatShaded: mol_util_1.ValueCell.create(props.flatShaded), dFlipSided: mol_util_1.ValueCell.create(props.flipSided), dIgnoreLight: mol_util_1.ValueCell.create(props.ignoreLight), dXrayShaded: mol_util_1.ValueCell.create(props.xrayShaded),
|
|
116
|
+
return tslib_1.__assign(tslib_1.__assign(tslib_1.__assign(tslib_1.__assign(tslib_1.__assign(tslib_1.__assign(tslib_1.__assign(tslib_1.__assign(tslib_1.__assign({ dGeometryType: mol_util_1.ValueCell.create('textureMesh'), uGeoTexDim: textureMesh.geoTextureDim, tPosition: textureMesh.vertexTexture, tGroup: textureMesh.groupTexture, tNormal: textureMesh.normalTexture, boundingSphere: mol_util_1.ValueCell.create(boundingSphere), invariantBoundingSphere: mol_util_1.ValueCell.create(invariantBoundingSphere), uInvariantBoundingSphere: mol_util_1.ValueCell.create(linear_algebra_1.Vec4.ofSphere(invariantBoundingSphere)) }, color), marker), overpaint), transparency), substance), clipping), transform), base_1.BaseGeometry.createValues(props, counts)), { uDoubleSided: mol_util_1.ValueCell.create(props.doubleSided), dFlatShaded: mol_util_1.ValueCell.create(props.flatShaded), dFlipSided: mol_util_1.ValueCell.create(props.flipSided), dIgnoreLight: mol_util_1.ValueCell.create(props.ignoreLight), dXrayShaded: mol_util_1.ValueCell.create(props.xrayShaded), dTransparentBackfaces: mol_util_1.ValueCell.create(props.transparentBackfaces), uBumpFrequency: mol_util_1.ValueCell.create(props.bumpFrequency), uBumpAmplitude: mol_util_1.ValueCell.create(props.bumpAmplitude), meta: mol_util_1.ValueCell.create(textureMesh.meta) });
|
|
117
117
|
}
|
|
118
118
|
function createValuesSimple(textureMesh, props, colorValue, sizeValue, transform) {
|
|
119
119
|
var s = base_1.BaseGeometry.createSimple(colorValue, sizeValue, transform);
|
|
@@ -127,7 +127,7 @@ var TextureMesh;
|
|
|
127
127
|
mol_util_1.ValueCell.updateIfChanged(values.dFlipSided, props.flipSided);
|
|
128
128
|
mol_util_1.ValueCell.updateIfChanged(values.dIgnoreLight, props.ignoreLight);
|
|
129
129
|
mol_util_1.ValueCell.updateIfChanged(values.dXrayShaded, props.xrayShaded);
|
|
130
|
-
mol_util_1.ValueCell.updateIfChanged(values.
|
|
130
|
+
mol_util_1.ValueCell.updateIfChanged(values.dTransparentBackfaces, props.transparentBackfaces);
|
|
131
131
|
mol_util_1.ValueCell.updateIfChanged(values.uBumpFrequency, props.bumpFrequency);
|
|
132
132
|
mol_util_1.ValueCell.updateIfChanged(values.uBumpAmplitude, props.bumpAmplitude);
|
|
133
133
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
/**
|
|
3
|
-
* Copyright (c) 2019-
|
|
3
|
+
* Copyright (c) 2019-2022 mol* contributors, licensed under MIT, See LICENSE file for more info.
|
|
4
4
|
*
|
|
5
5
|
* @author Alexander Rose <alexander.rose@weirdbyte.de>
|
|
6
6
|
*/
|
|
@@ -18,6 +18,8 @@ function applyTransparencyValue(array, start, end, value) {
|
|
|
18
18
|
}
|
|
19
19
|
exports.applyTransparencyValue = applyTransparencyValue;
|
|
20
20
|
function getTransparencyAverage(array, count) {
|
|
21
|
+
if (count === 0 || array.length < count)
|
|
22
|
+
return 0;
|
|
21
23
|
var sum = 0;
|
|
22
24
|
for (var i = 0; i < count; ++i) {
|
|
23
25
|
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">;
|