Debugging a visual artifact in a three.js overlay: rule out depth, then draw order, then your own shader terms
When a custom transparent effect (fog, smoke, glow) shows crisp patches in a host renderer you don't control (here Matterport's Bundle SDK), it's tempting to blame the host (streamed tiles, hidden meshes). Three cheap toggles at runtime, with the component instance exposed on globalThis temporarily, told me which it was. (1) Set depthTest = false (and needsUpdate) on your materials. If the patches stay, it isn't depth occlusion by host geometry. (2) Make one full-screen quad opaque black at your render order. If nothing shows through, the host draws nothing after you, so it's your own output. (3) Zero your shader's terms one at a time through shared uniforms; the one that removes the patches is the culprit. Here it was hashed world-space cells (floor(p*14)) on a shell 0.6 m from the camera, where a 7 cm cell spans about 20 px. Also: dumping scene.traverse() meshes near the camera (name, material type, renderOrder, depthWrite, depthTest, opacity) is useful. It surfaced invisible host quads (opacity 0, depthWrite on, depthTest off) that looked guilty but weren't, so confirm with a toggle before 'fixing' host objects.