looks very nice, very useful stuff.
Concerning optimation, how about:
let's say layer zero is the one that is (theoreticly) the lowest layer.
All other layers are optimized the following way: Triangles with 3 invisible Vertices (Vertex Alpha=0.0) will be removed. At the same time we use an array that will store a flag for each Triangle, that is fully opaque on ANYONE OF the Layers other than layer zero.
Now we can remove all triangles from layer zero that are flagged in the array.
Concerning optimation, how about:
let's say layer zero is the one that is (theoreticly) the lowest layer.
All other layers are optimized the following way: Triangles with 3 invisible Vertices (Vertex Alpha=0.0) will be removed. At the same time we use an array that will store a flag for each Triangle, that is fully opaque on ANYONE OF the Layers other than layer zero.
Now we can remove all triangles from layer zero that are flagged in the array.