# Shadow flickering with first-person near clipping plane

After adding a first-personal controller asset, world shadows flicker like crazy. I don't understand the cause, and everything I've tried based on googling has failed to help.

https://i.imgur.com/Mx5MCKB.gifv

I've tried:

• Increasing the near clipping plane of the camera. The first-person asset I have defaults to 0.01. Changing it to 0.1 or higher seems to solve the issue, except that breaks the first-person view.
• Toying with bias value on the directional light
• Changing Render Mode from Auto to Important on the directional light
• Changing the Shadow Projection quality to Stable Fit

The authors of the asset have not been able to help, though it doesn't seem to be specifically related to their product, just the clipping planes required.

I'm using Unity 2019.1.2f1 Personal.

• How far are you from the origin here? And in what specific way does the first-person view "break" when adjusting the near plane? – DMGregory May 13 '19 at 16:38
• Around 1000 meters. The FPC asset uses two cameras. Camera -> First Person Camera. When I first changed the near clipping plane, it was on the First Person camera. That fixed the issue, but the "arms" of my character were no longer visible (or weren't all visible). However, by changing the near clip plane of only the parent camera, the flicker goes away and the first person view seems unaffected. I could have sworn I tried that, but it seems to work. I need to better understand why they have two cameras though. The first seems to be for terrain/UI and the second for world objects. – BotskoNet May 13 '19 at 16:45
• Sounds like you can post that solution as an answer. The reason for the two cameras is that you generally want precision meters to kilometers away when rendering the world around you, and precision centimeters away when rendering your character's arms/tools. You can use layers to filter the content seen by each camera to ensure the "body cam" doesn't impact the rendering of objects other than your character's own body. The other benefit of using two cameras is you can clear the depth buffer after the first so you never see arms/tools clip into nearby obstacles. – DMGregory May 13 '19 at 16:50
• Also, beware that past 1000 m, you have about 8x the rounding error that you have within 200 m of the origin, which might be enough to start causing noticeable rounding errors or jitter in certain chains of lossy operations. The more you can keep your gameplay close to the origin, the more consistent your results will tend to be. – DMGregory May 13 '19 at 16:59

The first person asset uses two Camera objects, a Camera and a First Person Camera. Both had the Near Clipping Plane set to 0.01. Changing that value on the root Camera object solved the flicker, and did not interfere with the First Person Camera's view of the character arms.