[RESOLVED] Near plane clipping in unity

I am experiencing some issues with clipping in Unity (URP) where the character disappears when the camera is placed too close. I have set the camera to 0.01, but it still cuts out when positioned farther away. This is as close as I can get the camera to the character:

@Yonatan It sounds like you’re having the same issue as described in this thread about Unity’s camera looking past the default bounding box (centered on the sensor origin) of the Depthkit asset. Try the solution provided there, and let us know if it doesn’t fix it.

1 Like

Thanks! @CoryAllen it works when editing the meradata file. no clipping.

gif

looks cool, but I’m trying to get smoother edges, particularly on the characters’ heads. Is there a way to achieve this? Any tips or suggestions would be appreciated
I also noticed that when I use a lower aperture setting while shooting, the image appears less shaky. Does this make sense?

@Yonatan Glad to see your main issue is resolved.

I am not clear on how the aperture is affecting the result. Do you have a side-by-side comparison which demonstrates the difference you are seeing?

The instability of the edges is somewhat inherent to data captured with depth sensors, and the more off-axis the virtual camera is from the origin of the real sensor, the more you will see that artifact. That said, there are a couple of things you can try to reduce it:

  • In the Depthkit Editor’s Refinement tools, try increasing the Color Contribution value.
  • This is more experimental, but after exporting your Combined-per-Pixel video, import it into DaVinci Resolve (or other compositing software) and apply Spatial and Temporal Noise Reduction (as in this tutorial). Be sure to mask the effect to only the depth map. Once you export a new version with these effects applied (keeping the same resolution and framerate), compare it to the original to see if it the edges are more stable. You may need to try versions with different noise reduction values. Also, subtle manipulation of the hue-encoded depth map may result in small changes to scale, position, or other distortions, so keep an eye out for those as well.
  • For any captures going forward, make sure there’s no stray infrared light in your scene. This includes turning off or blocking out any hot lights (tungsten/halogen) or sunlight, and try to get your sensor as close to the subject as possible.
1 Like

@Yonatan Another idea from our team is to use some of the edge blending tools available in our Unity Expansion package - specifically the Dither Edge option in the Depthkit Core Mesh Source component.
image

1 Like