diff --git a/CHANGELOG.md b/CHANGELOG.md index 1a296add55f12edac7f888dce26f4c76013a796c..ebf21873d5f05699e1aa0aa82db69d8f1bd76b7f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,6 +13,7 @@ Note that since we don't clearly distinguish between a public and private interf - Improve boundary calculation performance - Add option to create & include images in state snapshots - Fix SSAO artefacts with high bias values +- Fix SSAO resolution scale parameter handling - Improve outlines, visually more stable at different view distances ## [v3.29.0] - 2023-01-15 diff --git a/src/mol-canvas3d/passes/postprocessing.ts b/src/mol-canvas3d/passes/postprocessing.ts index 1955b7378b985f1211858d05d4f7dbf89c9c531f..ef87bb3d2eda9c6ac3f596def58c36f354171b21 100644 --- a/src/mol-canvas3d/passes/postprocessing.ts +++ b/src/mol-canvas3d/passes/postprocessing.ts @@ -452,7 +452,7 @@ export class PostprocessingPass { const sw = Math.floor(width * this.ssaoScale); const sh = Math.floor(height * this.ssaoScale); - this.downsampledDepthTarget = webgl.createRenderTarget(sw, sh, false, 'uint8', 'linear'); + this.downsampledDepthTarget = webgl.createRenderTarget(sw, sh, false, drawPass.packedDepth ? 'uint8' : 'float32', 'linear'); this.downsampleDepthRenderable = createCopyRenderable(webgl, depthTextureOpaque); this.ssaoDepthTexture = webgl.resources.texture('image-uint8', 'rgba', 'ubyte', 'linear'); @@ -465,7 +465,7 @@ export class PostprocessingPass { this.ssaoDepthTexture.attachFramebuffer(this.ssaoBlurSecondPassFramebuffer, 'color0'); - this.ssaoRenderable = getSsaoRenderable(webgl, this.downsampleFactor === 1 ? depthTextureOpaque : this.downsampledDepthTarget.texture); + this.ssaoRenderable = getSsaoRenderable(webgl, this.ssaoScale === 1 ? depthTextureOpaque : this.downsampledDepthTarget.texture); this.ssaoBlurFirstPassRenderable = getSsaoBlurRenderable(webgl, this.ssaoDepthTexture, 'horizontal'); this.ssaoBlurSecondPassRenderable = getSsaoBlurRenderable(webgl, this.ssaoDepthBlurProxyTexture, 'vertical'); this.renderable = getPostprocessingRenderable(webgl, colorTarget.texture, depthTextureOpaque, depthTextureTransparent, this.shadowsTarget.texture, this.outlinesTarget.texture, this.ssaoDepthTexture, true); @@ -583,7 +583,7 @@ export class PostprocessingPass { this.ssaoDepthBlurProxyTexture.define(sw, sh); if (this.ssaoScale === 1) { - ValueCell.update(this.ssaoRenderable.values.tDepth, this.drawPass.depthTextureTransparent); + ValueCell.update(this.ssaoRenderable.values.tDepth, this.drawPass.depthTextureOpaque); } else { ValueCell.update(this.ssaoRenderable.values.tDepth, this.downsampledDepthTarget.texture); }