From 26264b15f718b724f290897cae3b416b637b1bf0 Mon Sep 17 00:00:00 2001 From: Alexander Rose <alexander.rose@weirdbyte.de> Date: Mon, 12 Dec 2022 21:56:34 -0800 Subject: [PATCH] tweaks --- CHANGELOG.md | 2 +- src/mol-canvas3d/passes/postprocessing.ts | 9 +++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 157d61aa3..d3c016a58 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,8 +5,8 @@ Note that since we don't clearly distinguish between a public and private interf ## [Unreleased] -- Add an `includeTransparent` parameter to hide/show outlines of components that are transparent +- Add an `includeTransparent` parameter to hide/show outlines of components that are transparent - Better guard against issue (black fringes) with bumpiness in impostors ## [v3.26.0] - 2022-12-04 diff --git a/src/mol-canvas3d/passes/postprocessing.ts b/src/mol-canvas3d/passes/postprocessing.ts index d3b70b80b..1a1401642 100644 --- a/src/mol-canvas3d/passes/postprocessing.ts +++ b/src/mol-canvas3d/passes/postprocessing.ts @@ -364,7 +364,7 @@ export const PostprocessingParams = { scale: PD.Numeric(1, { min: 1, max: 5, step: 1 }), threshold: PD.Numeric(0.33, { min: 0.01, max: 1, step: 0.01 }), color: PD.Color(Color(0x000000)), - includeTransparent: PD.Boolean(true, { description: 'Whether to show outline for objects with an opacity value less than 1' }), + includeTransparent: PD.Boolean(true, { description: 'Whether to show outline for transparent objects' }), }), off: PD.Group({}) }, { cycle: true, description: 'Draw outline around 3D objects' }), @@ -504,7 +504,7 @@ export class PostprocessingPass { let needsUpdateMain = false; let needsUpdateSsao = false; let needsUpdateSsaoBlur = false; - let needsUpdateOutline = false; + let needsUpdateOutlines = false; const orthographic = camera.state.mode === 'orthographic' ? 1 : 0; const outlinesEnabled = props.outline.name === 'on'; @@ -634,10 +634,11 @@ export class PostprocessingPass { // use radiusMax for stable outlines when zooming const maxPossibleViewZDiff = factor * camera.state.radiusMax; const outlineScale = props.outline.params.scale - 1; + ValueCell.updateIfChanged(this.outlinesRenderable.values.uNear, camera.near); ValueCell.updateIfChanged(this.outlinesRenderable.values.uFar, camera.far); ValueCell.updateIfChanged(this.outlinesRenderable.values.uMaxPossibleViewZDiff, maxPossibleViewZDiff); - if (this.renderable.values.dTransparentOutline.ref.value !== transparentOutline) { needsUpdateOutline = true; } + if (this.renderable.values.dTransparentOutline.ref.value !== transparentOutline) { needsUpdateOutlines = true; } ValueCell.updateIfChanged(this.outlinesRenderable.values.dTransparentOutline, transparentOutline); ValueCell.update(this.renderable.values.uOutlineColor, Color.toVec3Normalized(this.renderable.values.uOutlineColor.ref.value, props.outline.params.color)); @@ -665,7 +666,7 @@ export class PostprocessingPass { if (this.renderable.values.dOcclusionEnable.ref.value !== occlusionEnabled) { needsUpdateMain = true; } ValueCell.updateIfChanged(this.renderable.values.dOcclusionEnable, occlusionEnabled); - if (needsUpdateOutline) { + if (needsUpdateOutlines) { this.outlinesRenderable.update(); } -- GitLab