Displaying Interpolated Depth
In the previous tutorial, we learned how to display the raw environment depth texture from NSDK using Unity’s AROcclusionManager. That setup visualized the latest depth frame exactly as it was produced, aligned to the viewport through a simple display matrix.
In this tutorial, we extend that concept by enabling depth warping (also referred to as interpolation). This feature allows NSDK to project and re-align previously inferred depth images to the current camera pose, producing smoother and more temporally consistent results — even when new depth frames aren’t yet available.
1. Overview of Warping (Interpolation)
When depth is inferred via NSDK’s neural network, each depth image is tied to the camera pose from the frame it was generated for. As the camera moves, NSDK can reproject that depth image forward in time to better match the current view.
In the previous tutorial, the transformation was purely affine (used CameraMath.CalculateDisplayMatrix).
In this tutorial, it becomes projective — meaning the transformation includes distance-based warping caused by changes in camera position and orientation.