Hello to the ZED team!
I’m new to the ZED ecosystem (using a ZED2) and I’m encountering a specific problem in the Body Tracking scene supplied with the Unity SDK.
Context
In the BodyTracking scene, I’ve placed GameObjects (GOs) in front of and behind the player to test the 3D overlay. However, rendering on the ZED texture (ZED_Texture) seems to reverse the depth, contrary to what the Camera_Left preview shows.
Here’s what I see:
-
Camera_Left (Preview): [Frame]->[GO in front of player] ->[Player]->[GO behind player]
-
ZED_Texture (Final render): [GO behind player] → [Player] → [GO in front of player] ->[Frame]
Visual example :
Objective
I’m developing a small 3D game for children, in which respecting the depth of objects is essential for :
Clarify the visual hierarchy (near vs. far GOs)
Create realistic interactions with the player in space.
I’d like the rendering to follow the order:
- ZED_Texture (Final render): [GO in front of player] → [Player] → [GO behind player] → [Frame]
What I’ve already tried:
Analysis of the ZED Forward Lighting shader (modifications in ZTest, ZWrite)
Reading ZEDRenderingPlane, ZEDManager, ZEDUtils (modifications in DepthMax definition and computeDepthXYZ).
I understand that the elements were assembled in reverse so that the Frame would remain in the backgound, but I can’t correct the hierarchy in the final render.
Do you have a solution to reverse this logic, resolve this error or a recommended best practice for correctly handling layers/z-indexes in ZED rendering?
Thank you very much for your help and your great work on this SDK impressive !