I know it’s a old problem,the Z-fighting. The mesh junctions flickering when the camera near clip plane is too small and far clip plane too big.
I find this:
My camera has far clip 10240 and I need to add near clip to 10 then the flickering will disappear. But if I do so, my player that near the camera will be cut off.
I got an idea that using two camera,one for terrain and another for player. The player camera is Depth only and has a small far clip,the terrain camera’s near clip is equal player camera’s far clip .
The flickering problem is resolved, but I find I can’t add image-effect to the player,because it’s Depth only and it ruins in mobile device.
I find this:
Is any way to solve this?
Anybody helps!
Thank you very much!
First off try to create a 24/32 bit depth buffer. If you are using a 16 bit buffer that’ll definitely hurt with a range of 10k units.
Also, your player camera is only clearing depth only but I assume it’s writing depth and color. Ultimately you should be able to put image FX on whatever camera is rendered last, but note that not all post FX are supported on mobile and even when supported they may not all be fast.
I do set the depth buffer to 32 bit in build setting, but the flickering is still exist when there is only one camera.
The image effect works well in mobile devices with terrain camera(Solid), and it can reach 30 fps, but down to 3 fps when I moved the script to player camera(Depth only).