# Iwsdk Depth Occlusion

> Add or repair IWSDK WebXR depth sensing and real-world occlusion in AR. Use for DepthSensingSystem, DepthOccludable, occlusion modes, or passthrough depth troubleshooting.

- Skill: `facebook/iwsdk-depth-occlusion` (Agent Skill)
- Install (CLI): `npx skillmds@latest add facebook/iwsdk-depth-occlusion`
- Raw SKILL.md: https://api.skillmd.com/api/skills/facebook/iwsdk-depth-occlusion/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Coding & Dev Tools
- Author: facebook (https://skillmd.com/u/facebook)
- Updated: 2026-09-17
- Page: https://skillmd.com/skills/facebook/iwsdk-depth-occlusion

---


# IWSDK Depth Occlusion

Depth occlusion has three independent requirements: the AR session requests
depth, one depth system is registered, and only intended virtual entities carry
`DepthOccludable`.

## Implement

1. Inspect `iwsdk.config.json`, `src/index.ts`, and the active scene in one
   bounded pass, then make the complete config/system/scene edit before starting
   the dev server. The contracts below are sufficient for the normal path: do
   not call scene capabilities, CLI `--help`, inspect `node_modules`, or read
   generated declarations unless a concrete build/runtime error remains.
2. Keep `world.xr.mode` as `"ar"`. Under `world.xr.features`, request:

   ```json
   "depthSensing": {
     "required": true,
     "usage": "gpu-optimized",
     "format": "float32"
   }
   ```

   Preserve other required AR features. Use the living-room emulator (or the
   environment requested by the task) so runtime depth exists.
3. Import and register `DepthSensingSystem` exactly once after `World.create`:

   ```ts
   world.registerSystem(DepthSensingSystem, {
     configData: {
       enableDepthTexture: true,
       enableOcclusion: true,
       useFloat32: true,
       blurRadius: 20,
     },
   });
   ```

   `DepthOccludable` is built in. Do not call `registerComponent` for it.
4. Add `DepthOccludable` only to the requested scene nodes. These scene payloads
   are exact: `{}` means soft occlusion and `{ "mode": "HardOcclusion" }` means
   sharp low-cost occlusion. Use `"MinMaxSoftOcclusion"` only when the task needs
   the higher-quality path. Write the literal scene value directly; do not load
   the scene-composer format reference, import `OcclusionShadersMode`, or inspect
   its declaration to reconfirm it.
5. Leave a deliberate non-occludable reference object when comparison is part
   of the request. Do not mark UI or guidance surfaces occludable by default.

## Verify

Run the production build once, start the AR app once, enter XR, and query the
named entities and registered systems. Check the console for missing
depth-sensing warnings. Capture one runtime screenshot in the configured room;
source inspection or an authored scene render alone cannot prove passthrough
occlusion. Make one focused correction if the measured runtime disagrees, then
stop. Do not repeatedly restart the emulator or tune blur from screenshots when
the session never exposed depth data.

Use one XR entry, one bounded entity/system query set, and one console check.
Save the final live screenshot but do not read it back when those runtime checks
already prove that depth was requested, the system is live, and the intended
entities carry the correct occlusion modes.

Use the CLI action names below; do not substitute MCP method names or probe
`--help` first:

```bash
npx iwsdk xr enter
npx iwsdk xr status
npx iwsdk ecs find --input-json '{"namePattern":"<requested node regex>"}'
npx iwsdk ecs query --input-json '{"entityIndex":<index from find>}'
npx iwsdk ecs systems
npx iwsdk browser logs --count 80
npx iwsdk browser screenshot --output-file artifacts/<name>.png
```

Use `npx iwsdk browser screenshot --output-file <path>` for file evidence. Do
not alter the project camera or render extra authored angles to manufacture an
occlusion view; stage the requested nodes once, then judge the live AR capture.
Do not inspect framework source when the build, registered-system query, entity
components, and console warnings already establish the failing layer.

