Implement depth sensing occlusion in IWSDK and troubleshoot rendering issues.
This skill appears to be a prompt-only/open-source implementation guide from a GitHub repository, with no required secrets, no declared remote endpoints, and no indicated local execution or data exfiltration. Overall risk is low based on the provided material, though basic supply-chain verification is still advisable due to limited maintenance and adoption signals.
The material explicitly states that no keys or environment variables are required. The README only covers WebXR depth configuration and component registration, with no token, API key, or account credential handling, so credential leakage/abuse risk is low.
No remote endpoints are declared. The documentation focuses on device-local WebXR depth textures and occlusion rendering, with no indication of sending user data to third-party services.
The system flags this as prompt-only, and the provided material is usage documentation with example snippets rather than executable install scripts or local process control instructions. No extra system execution privileges are requested.
The documentation describes use of XR-device-provided depth sensing data for local occlusion effects. There is no indication of reading/writing local files, accessing account data, or requesting excessive permissions unrelated to the stated function.
Positive factors include being open source on GitHub and auditable, and it belongs to the facebook/immersive-web-sdk repository, which lowers overall risk. However, the license is unspecified, stars are 0, and maintenance status is unknown, so repository activity and specific commits should still be verified before adoption.
Copy the install command and let the AI configure it · recommended for beginners
Please install the "iwsdk-depth-occlusion" skill from askskill: 1. Download https://raw.githubusercontent.com/facebook/immersive-web-sdk/main/packages/starter-assets/claude-injections/skills/iwsdk-depth-occlusion/SKILL.md 2. Save it as ~/.claude/skills/iwsdk-depth-occlusion/SKILL.md 3. Reload skills and tell me it's ready
Explain how to enable depth-based occlusion in an IWSDK project, including the required DepthSensingSystem setup, recommended occlusion modes, and basic initialization steps.
A step-by-step setup guide for correctly enabling depth occlusion in the project.
I am building an AR scene and need virtual objects to be hidden behind real walls. Compare different occlusion modes, their use cases, performance impact, and recommended choice.
A comparison of occlusion modes with recommendations based on scene needs and performance.
After enabling depth occlusion, my virtual objects either disappear completely or fail to occlude correctly. Provide a systematic troubleshooting checklist with common causes and fixes.
An actionable troubleshooting checklist to identify configuration, rendering, or depth-data issues.
Hide virtual objects behind real-world surfaces using WebXR depth sensing. The system samples a per-pixel depth texture from the XR device and compares it against each virtual fragment's depth — if the real surface is closer, the fragment is faded out.
Three things are required: XR session depth config, the system, and the component.
World.create(container, {
xr: {
sessionMode: SessionMode.ImmersiveAR,
referenceSpace: ReferenceSpaceType.Unbounded,
features: {
depthSensing: {
required: true,
usage: 'gpu-optimized', // or 'cpu-optimized'
format: 'float32',
},
hitTest: { required: true },
anchors: { required: true },
unbounded: { required: true },
},
},
});
DepthSensingSystem and DepthOccludableimport { DepthSensingSystem, DepthOccludable } from '@iwsdk/core';
world
.registerSystem(DepthSensingSystem, {
configData: {
enableDepthTexture: true,
enableOcclusion: true,
useFloat32: true,
blurRadius: 20.0,
},
})
.registerComponent(DepthOccludable);
DepthOccludable to entitiesimport { DepthOccludable, OcclusionShadersMode } from '@iwsdk/core';
// Soft occlusion (default) — smooth edges via 13-tap blur
entity.addComponent(DepthOccludable);
// Hard occlusion — sharp edges, single depth sample
entity.addComponent(DepthOccludable, {
mode: OcclusionShadersMode.HardOcclusion,
});
// MinMax occlusion — best quality, extra preprocessing pass
entity.addComponent(DepthOccludable, {
mode: OcclusionShadersMode.MinMaxSoftOcclusion,
});
The material must have transparent: true. The system sets this automatically, but verify it on custom materials.
| Mode | Quality | Cost | Best For |
|---|---|---|---|
SoftOcclusion | Good | Low | Most objects — smooth edges, hides depth aliasing |
HardOcclusion | Basic | Lowest | Small objects or when sharp edges are acceptable |
MinMaxSoftOcclusion | Best | Medium | Large objects with complex silhouettes against varied backgrounds |
| Property | Type | Default | Description |
|---|---|---|---|
enableOcclusion | Boolean | true | Master switch for all occlusion |
enableDepthTexture | Boolean | true | Create GPU textures from depth data |
useFloat32 | Boolean | true | Float32 depth textures (higher precision) |
blurRadius | Float32 | 20.0 | Blur radius for soft occlusion (pixels) |
| Mode | When to use |
|---|---|
cpu-optimized | Simpler, works everywhere. Depth as linear meters in a DataArrayTexture. |
gpu-optimized | Recommended. Matches Quest hardware format. Depth as reverse-Z inverse depth in an ExternalTexture. Required for production parity with on-device behavior. Note that Quest devices only support this mode. |
Depth occlusion only works in AR mode. The scene background must be null for passthrough:
scene.background = null;
Objects never occlude (always visible on top)
DepthOccludable componentDepthSensingSystem is registered with enableOcclusion: truedepthSensing is in the XR features configObjects always invisible in IWER
Flickering or noisy occlusion edges
blurRadius (try 30-40)HardOcclusion to SoftOcclusionMinMaxSoftOcclusion for best edge qualitySessionMode.ImmersiveAR with depthSensing in features.…
Test XR session lifecycle and mode transitions to verify behavior and debug state issues.
Build, debug, and refine IWSDK PanelUI panels more efficiently.
Test multiple grab interaction modes with the iwsdk CLI.
Test XR interactions, panels, and audio behavior with the iwsdk CLI.
Debug WebXR real-time behavior frame by frame with pause, snapshots, and diffs.
Plan IWSDK features, architecture, and code patterns with best-practice guidance.
Implement physics simulation, interactions, and collision debugging in IWSDK projects.
Test level hierarchy, tags, and lighting setup with the iwsdk CLI.
Create, modify, debug, and preview PanelUI components in IWSDK apps.
Test slide, snap turn, teleport, and jump locomotion with iwsdk CLI.
Test environment settings and component schemas with iwsdk CLI against poke.
Test Havok physics behaviors with the iwsdk CLI against example scenes.