Selaa lähdekoodia

fix issues with wboit/dpoit in large scenes

- remove unneeded depth check (depth texture support required for wboit/dpoit)
Alexander Rose 1 vuosi sitten
vanhempi
commit
f428e9f39e

+ 2 - 0
CHANGELOG.md

@@ -6,6 +6,8 @@ Note that since we don't clearly distinguish between a public and private interf
 
 ## [Unreleased]
 
+- Fix issues with wboit/dpoit in large scenes
+
 ## [v3.37.0] - 2023-06-17
 
 - Add `inverted` option to `xrayShaded` parameter

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

@@ -1,5 +1,5 @@
 /**
- * Copyright (c) 2022 mol* contributors, licensed under MIT, See LICENSE file for more info.
+ * Copyright (c) 2022-2023 mol* contributors, licensed under MIT, See LICENSE file for more info.
  *
  * @author Gianluca Tomasello <giagitom@gmail.com>
  */
@@ -11,9 +11,8 @@ export const dpoit_write = `
             discard;
         }
     } else if (uRenderMask == MaskTransparent) {
-        // the 'fragmentDepth > 0.99' check is to handle precision issues with packed depth
         vec2 coords = gl_FragCoord.xy / uDrawingBufferSize;
-        if (preFogAlpha != 1.0 && (fragmentDepth < getDepth(coords) || fragmentDepth > 0.99)) {
+        if (preFogAlpha != 1.0 && fragmentDepth < getDepth(coords)) {
             #ifdef dTransparentBackfaces_off
                 if (interior) discard;
             #endif

+ 2 - 3
src/mol-gl/shader/chunks/wboit-write.glsl.ts

@@ -1,5 +1,5 @@
 /**
- * Copyright (c) 2019-2022 mol* contributors, licensed under MIT, See LICENSE file for more info.
+ * Copyright (c) 2019-2023 mol* contributors, licensed under MIT, See LICENSE file for more info.
  *
  * @author Alexander Rose <alexander.rose@weirdbyte.de>
  * @author Áron Samuel Kovács <aron.kovacs@mail.muni.cz>
@@ -12,8 +12,7 @@ export const wboit_write = `
             discard;
         }
     } else if (uRenderMask == MaskTransparent) {
-        // the 'fragmentDepth > 0.99' check is to handle precision issues with packed depth
-        if (preFogAlpha != 1.0 && (fragmentDepth < getDepth(gl_FragCoord.xy / uDrawingBufferSize) || fragmentDepth > 0.99)) {
+        if (preFogAlpha != 1.0 && fragmentDepth < getDepth(gl_FragCoord.xy / uDrawingBufferSize)) {
             #ifdef dTransparentBackfaces_off
                 if (interior) discard;
             #endif