Browse Source

dpoit fixes

- when post-processing is off
- when rendering direct-volumes
Alexander Rose 2 years ago
parent
commit
7dabdf3085
3 changed files with 5 additions and 1 deletions
  1. 2 0
      CHANGELOG.md
  2. 2 0
      src/mol-canvas3d/passes/draw.ts
  3. 1 1
      src/mol-gl/shader/chunks/dpoit-write.glsl.ts

+ 2 - 0
CHANGELOG.md

@@ -6,6 +6,8 @@ Note that since we don't clearly distinguish between a public and private interf
 
 ## [Unreleased]
 
+- Fix Dual depth peeling when post-processing is off or when rendering direct-volumes
+
 ## [v3.18.0] - 2022-09-17
 
 - Integration of Dual depth peeling - OIT method

+ 2 - 0
src/mol-canvas3d/passes/draw.ts

@@ -153,6 +153,8 @@ export class DrawPass {
             this.postprocessing.render(camera, false, transparentBackground, renderer.props.backgroundColor, postprocessingProps);
         }
 
+        this.depthTextureOpaque.detachFramebuffer(this.colorTarget.framebuffer, 'depth');
+
         // render transparent primitives
         if (scene.opacityAverage < 1) {
             const target = PostprocessingPass.isEnabled(postprocessingProps)

+ 1 - 1
src/mol-gl/shader/chunks/dpoit-write.glsl.ts

@@ -37,7 +37,7 @@ export const dpoit_write = `
             // back color is separately blend afterwards each pass
             gl_FragData[1] = vec4(0.0);
 
-            float nearestDepth = - lastDepth.x;
+            float nearestDepth = -lastDepth.x;
             float furthestDepth = lastDepth.y;
             float alphaMultiplier = 1.0 - lastFrontColor.a;