I’m getting extreme Z Fighting on objects that are not very close together at all, in the main scene view. Screenshot is attached.
Is anyone else getting this behaviour? Is there a fix?
I’m getting extreme Z Fighting on objects that are not very close together at all, in the main scene view. Screenshot is attached.
Is anyone else getting this behaviour? Is there a fix?
I have the same unsightly problem, presumably to do with the near and far clip planes and how the z-buffer weights objects further from the camera?
What are you compiling for? If I compile for Android, I get this due to Unity using a smaller 16-bit Z buffer (Don’t think there’s a reason for this, but I find it handy as you WILL get the same problem on the device itself.)
If you’re not compiling for a mobile device, you might simply be using a 16 bit buffer, for some other reason (usually drivers.)
Check your camera settings first ( near far ) and do a F ( focus ) on the big object that is flickering.
Sounds like it’s to do with emulation - I’m building ATM, so it may be I can just turn of OpenGL ES 2.0 emulation - will take a look shortly…
I have to say that I don’t see this z-fighting in game, even in the game window in the editor and I don’t see it on the device, only in the editor window and it only appeared since 3.4…
I’ve done some to the metal coding of OpenGL ES on my iPhone 3G and 3G S (before I had my shiny new 4S), but I don’t recall being limited to a 16bit z-buffer, but maybe that is an option - certainly it was for the colour buffer…
UPDATE: turning off emulation makes it go away, but I don’t get why it would be there in the first place. Fine if it’s emulating the z-depth precision on the device, but IMHO it doesn’t appear to be showing an accurate representation of it. Near and far clip planes affect the extent to which one will get z-fighting. My near clip plane is 0.3 - if I changed this to 0.01 say, then I’d see much of the nasty z-fighting as in the editor I suspect, so as the z-fighting it a function of these different parameters, there really should be some place I can set the near and far clip-planes
This is in the editor, not on the device: so to my knowledge there is no camera to edit :o/
Try it. Select the flickering object, press F with the mouse over it. It will fix it. The editor has it’s own camera with it’s own z buffer problems, solved with this workflow.
As pointed earlier it is due to gles emulation. On Android - there are some devices with 16bit only depth buffer, and they can show your scene like this. On the other hand, it will be “fixed” in 3.5:
on ios - all devices support 24bit depth and we use it, so no need to emulate it like this
on android - there will be checkbox to try and force 24bit depth on device; if you set this - you will see no artefacts [as 24bit depth will be created in editor too]
I get this same issue in 4x android in 2013…any ideas?
Any solutions to this ? I’m having the same problem in my project
Describe your problem precisely because we can’t help otherwise
Have you tried to increase znear and decrease zfar as much as you can accept this? ZBuffor will have less problems with resolving zfighting things:)