My greeting to the community,
(feel free to skip over)
I’ve been reading this forum for months. I’ve learned heaps from everyone, thank you. Special appreciation goes out to Norman, who is tirelessly helping people on seemingly every post I read, and they go back years. I don’t know how you do it mate, but thank you for being so patient with all of us.
Transparency Issues:
Image#1:
This is a field of translucent cubes, as might be drawn by a cube-game engine with a chunk size of 10x10. What we see in this image is that the transparent meshes are cumulative with other meshes but we don’t see the meshes being cumulative with themselves. But this is only the case when we look in the positive-x, positive-z direction.
Image #2:
Same meshes viewed from the the other side, that is upstream into the negative-x, negative-z direction. From this direction they appear as expected. But as I will show, it’s not just about viewing direction.
Image #3:
Here we see a blob of blocks rendered as 1 or more custom meshes, (I wish I knew how many) with self accumulation working on one side and not on the other.
Image #4:
Same blob, same side, all I did was translate the camera to the left just a tad and the missing shading popped into view. If you look at the white crosshair in the red pickbox, you can see by how much the camera moved. The shading will reliably appear and disappear depending on the exact camera position. But that’s not the worst of it.
Image#5:
Data structure wise, we’re looking at some “land” blocks where they form a flat plain in the foreground and rise up a hill in the back. Then there is a layer of “water” blocks, exactly one block thick, laying over the land. So the water blocks form a stair-step pattern that mimics the land blocks The mesh renderer comes through intending to represent the water blocks as fully formed perfect cubes. Only the faces of the water cubes that are adjacent to air are drawn. Both the land and the water are on the same texture atlas and are drawn as the same mesh, with each individual mesh covering a 10x10 block area. So the water should as a whole form a closed skin with nothing inside. Each individual mesh however, is like a pair of floating blankets. One for the land skin and one for water skin.
Now this is the serious problem. At the edges of the individual meshes the transparent parts of the mesh will intermittently fail to render properly.
Image #6:
If I move the camera around a bit to get the error to flicker off, you can the see meshes are actually aligned and contiguous.
Things I’ve tried:
[java]setQueueBucket(Bucket.Transparent)[/java]
All 6 images are using Transparent QueueBucket.
If I don’t use Transparent QueueBucket, the problem is on every edge, everywhere, all the time. Using Transparent QueueBucket reduces the problem to about 10%, with flickering holes in some but not all meshes.
I’ve been through the settings on this page: Material Definitions Properties
[java]setDepthWrite[/java] The DepthWrite toggle did help with image #5, in that the cracks in the blue transparent water mesh
showed the brown mesh behind it instead of just showing sky. But it’s still horrible.
[java]setAlphaFallOff[/java] The setAlphaFallOff setting had no useful results. Tried values from 0.01 to 1.0. Values above 0.3 tended to make things disappear, if I recall correctly.
I tried putting the actual transparency into the texture, as well as getting there by setting the alpha of the verticies. No difference.
My research turned up this thread:
Transparency in Android
Even though I’m using a PC and not Android.
Thinking maybe my video card was the problem, I ran this program on another computer with different hardware. Same results. Both computers use Windows 7 ultimate 64bit.
I tried the “ShowNormals” material. The normals all appear to be correct.
I don’t know if these issues all stem from the same problem or if they’re 3 separate problems. They seem to all be related to the Z-buffer.
Thank you to anyone who bothers to try and help.