Mesh rendering flickering problem

Hi guys,

We are trying our first Unity app. We are targeting a 2.5D game, we do have a tree in the game that we modeled in 3DSMax. The tree is made up of 2D mesh models that are placed in different Zs to add the depth feeling. The tree has several parts including trunk branch and leaves.

We are using a PNG image with transparency as a texture for the tree. We then import the texture and FBX into unity and place it on the screen. When we move the camera on either axis however the part of the tree start to flicker, for some reason the parts of the tree that are placed behind like dark leaves start to appear as the closest to the camera, and if we move the camera a bit more it goes back.

We tried pretty much everything including changing the format of the texture, changing the placement of the tree parts (in all axis) tried all the shaders and changed camera settings.

No matter what we do we can’t prevent this flickering. Is there anybody how would know how we can fix this or at least what causes it?

Change to a transparent/cutout shader.

Thanks Jaimi,

But I actually tried “All” of the shaders with no luck, but I was able to solve the problem by changing the queue ordering in the shader. I created different shades with each of them different transparency queue ordering i.e. “Queue”=“Transparent+2”, “Queue”=“Transparent+3” etc. then I assigned each new shader to a material that uses my original texture, and used the materials on mashes that are in different Z orders.

If the cutout didn’t help, then it sounds like Z-fighting (as the cutout would check the z-buffer). Changing the queues would work, but seems like a lot of manual work, but if you’ve already done it, then I suppose it doesn’t matter. If it is z-fighting, and you want to try a different solution at some point, you might want to give the zbuffer more precision by pushing the near plane out as far as it can go before it starts clipping your scene, and/or moving the objects farther apart.

I’m having a similar issue, but with a 3D mesh… no different than any meshes I’ve made in the past. Sometimes it disappears entirely when I turn the camera.