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
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, inspectnode_modules, or read generated declarations unless a concrete build/runtime error remains.Keep
world.xr.modeas"ar". Underworld.xr.features, request:"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.
Import and register
DepthSensingSystemexactly once afterWorld.create:world.registerSystem(DepthSensingSystem, { configData: { enableDepthTexture: true, enableOcclusion: true, useFloat32: true, blurRadius: 20, }, });DepthOccludableis built in. Do not callregisterComponentfor it.Add
DepthOccludableonly 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, importOcclusionShadersMode, or inspect its declaration to reconfirm it.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:
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.