The NDC range for the z component is 0…1 in WebGPU, not -1…1.
So you should directly use the value from the depth map and not do (d - 0.5) * 2.0
. You have a IS_NDC_HALF_ZRANGE
define that let you know the range is 0…1:
- arc rotate camera: https://playground.babylonjs.com/#PZ4PJR#9
- free camera: https://playground.babylonjs.com/#PZ4PJR#10 (note that your PG did not work in WebGPU either, the squares were too big)