- Home /
Transparency / depth problem
I have some weird problems going on with the transparency and depth sorting of my meshes.
Basically, I generate pyramid-shaped meshes from code and texture them procedurally with transparent textures with varying transparency. Now, the problem is, if we imagine a vertical line splitting the game view into two parts, the meshes on the right part of the view are shown correctly, but the meshes on the left part appear "inside-out", which is quite weird since I have a two-sided shader. I think this is a depth-sorting problem, since I've managed to fiddle around with the shader code and show the meshes correctly to go around this particular problem by turning on the zwrite on one of the shader passes, but that will cause even worse problems (the fully transparent parts become totally black etc.).
I've already spent three days going through the existing answers, Unity forums and all the results Google can tell me. Seems like I should've been more clear about that. All the solutions posted in the earlier questions haven't been helpful in this.
The only way I can get the result I want is to not combine any meshes, but that will cause 1000-2000 draw calls, which isn't really what I want.
No, you can dynamically reorder the mesh data arrays. That's probably not pleasant, and may result in its own performance problems, along with added complexity to manage, but it can work.