フィルターのクリア

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

3 ビュー (過去 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 Center および File ExchangeGraphics Performance についてさらに検索

製品

Community Treasure Hunt

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

Start Hunting!

Translated by