Serious problem with object texture display.

Hi!

I’m having a serious issue with the way Unity is displaying certain textured meshes - Unity is not only showing the faces that should be visible, but also the faces at the rear of the object that should not be in the camera’s line of sight. Visually it looks bizarre, like all the faces wthin the camera’s field of vision are overlapping, or like the mesh has been turned inside out.

That’s the best way I can describe it! I think I’ve narrowed it down to a fault with the texture, rather than the mesh or Unity itself. The strange thing is, I have older versions of these textures that appear to work fine, and the only thing that has changed in the meantime is that I halved the dimensions of the image.

The textures are all Targas. They have all been saved out of Photoshop as 32-bit. Some have an alpha channel and some don’t.

Has anyone heard of anything like this before?! I desperately need a solution.

Thanks!

Are you using a transparent shader on a non-convex mesh? If so, the ordering issue you see is due to triangles in a mesh being rendered in order, which almost never corresponds to distance from the camera.

Consider switching to Cutout shaders (which write to the Z buffer) or using a shader like this one.

Thanks, it looks like that shader should solve the problem, although I’d still like to know what’s causing the problem in the first place

Especially since I have many similar meshes/textures with identical properties, yet the problem is only occuring in some of them.