Commit f8f2b56
fix(core): Fix the depth occlusion when developer explicitly set material.transparent=true.
Summary:
Softserve developer found that their app’s occlusion system failed for partially occluded materials because they set `transparent: false, opacity: 1`, overriding IWSDK’s `transparent: true` setup.
**Root Cause:**
- Depth occlusion relies on alpha modulation (`diffuseColor.a *= occlusion_value`), which only works if `material.transparent` is true.
- External code setting `transparent = false` (e.g., after placement animations) breaks occlusion, making occluded geometry fully opaque.
**Fix:**
- Discard fragments with `occlusion_value < 0.01` to always remove fully occluded geometry, regardless of the transparent flag.
- Soft edges remain when alpha blending is active; otherwise, edges degrade gracefully to hard.
Reviewed By: felixtrz
Differential Revision: D94739128
fbshipit-source-id: deb3221423b2f63130261eba30c727ad31007ecc1 parent e26c7a1 commit f8f2b56
File tree
2 files changed
+9
-4
lines changed- examples/depth-occlusion/src
- packages/core/src/depth
2 files changed
+9
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
218 | 218 | | |
219 | 219 | | |
220 | 220 | | |
221 | | - | |
222 | | - | |
223 | | - | |
224 | | - | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
225 | 227 | | |
226 | 228 | | |
227 | 229 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
254 | 254 | | |
255 | 255 | | |
256 | 256 | | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
257 | 260 | | |
258 | 261 | | |
259 | 262 | | |
| |||
0 commit comments