I've been working with patches with many transparent faces, and I have found that opengl seems to limit the number of transparent layers than can be seen behind each other.
Here is an example in which I plot a patch with 10 faces but only 5 can be seen (you can rotate the plot to see the hidden faces):
fig = figure;
n = 10;
x = linspace(0,1,n+1);
x1 = x(1:n);
x2 = 1+0*x1;
x3 = x2;
x4 = x1;
y1 = 0*x1;
y2 = y1;
y3 = y1+1;
y4 = y3;
z = x;
verts = zeros(4*n,3);
faces = zeros(n,4);
for i = 1:n
verts(4*(i-1)+(1:4),1:3) = [
x1(i),y1(i),z(i)
x2(i),y2(i),z(i)
x3(i),y3(i),z(i)
x4(i),y4(i),z(i)];
faces(i,1:4) = 4*(i-1)+(1:4);
end
h = patch('Faces',faces,'Vertices',verts);
h.FaceAlpha = 0.1;
h.EdgeColor = 'none';
fig.Renderer = 'opengl';
Painters does not exhibit this problem, but it is much slower (I'm using patches with ~100,000 triangles). My goal is to export to high resolution png's. I'm using MATLAB R2016a. Any suggestions?
Thanks, David