Does opengl have a limit to the number of transparent layers?

조회 수: 2 (최근 30일)
David Pate
David Pate 2016년 5월 7일
답변: David Pate 2016년 11월 29일
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);
% vertex naming:
% 4 -- 3
% | |
% 1 -- 2
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 = 'painters';
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

채택된 답변

David Pate
David Pate 2016년 11월 29일
I was able to fix the problem by switching to the Windows software opengl renderer:
>> opengl software

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Graphics Performance에 대해 자세히 알아보기

제품

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by