- Home /
camera near clipping results in z fighting
Hi, I'm creating a fps game. My current problem is Unity's camera system. On the one hand I need a low near clipping plane for my guns(less or 0.1), but on the other hand I need the near clipping plane to be at least 1, otherwise I will get flickering shadows...
I tried to add a second camera, to render the things near the player, and the other camera to render the distance objects. The result was really bad(Performance, Shadow bugs)! I tried to reduce the far clipping plane, but that changed nothing... My idea was to set the near clipping plane per layer, but it isn't possible.
How can I set up my camera to use it for guns and remove the shadow flickering?
Other fps-games in Unity don't have this problems...So there have to be a solution.
Gradeful for any help!
Answer by hexagonius · Feb 01, 2016 at 09:53 PM
Create two cameras. let one render only one layer, the other all the others except that one layer. put only the gun on that single layer. Set the single layer camera to render second and clear flags depth only.
Your answer
Follow this Question
Related Questions
Near Clipping Plane Affecting Rendering Massive Objects 1 Answer
Minimum Near Clip Plane for the camera 2 Answers
Editor's Camera Clipping Plane 12 Answers
How to use 2 tk2dCameras, the 2nd one with "viewport clipping"? 0 Answers
Procedurally generated mesh disappears from certain camera angles 1 Answer