Display question about transparent intersected surfaces

Why when I set the intersected surfaces' transparent with 'FaceAlpha', the intersected regions display invalid.
Code:
x=[0:0.01:3];
y=[0:0.01:5];
[X,Y]=meshgrid(x,y);
Z1=X*1.1+Y*1;
Z2=X+Y*1.1;
mesh(X,Y,Z1,'FaceColor','b','EdgeAlpha',0,'FaceAlpha',0.5)
hold on
mesh(X,Y,Z2,'FaceColor','r','EdgeAlpha',0,'FaceAlpha',0.5)
The figure

댓글 수: 3

If the FaceAlpha is set as 1, the figure
How can I make the transparent figures correct?
Which Matlab version are you using? Is OpenGL set to hardware or software?
I can reproduce this effect with Matlab online.
Thanks for your answer. The version is matlab R2018a, the OpenGL was set to hardware. If I set OpenGL to software, the front and back relationship is wrong, the figure :

댓글을 달려면 로그인하십시오.

 채택된 답변

Wentao Du
Wentao Du 2018년 7월 13일
This issue is due to the Order Independent Transparency method used by MATLAB called "Depth Peeling." Unfortunately, there are no existing workarounds.
Changing to "opengl" setting to "hardwarebasic" gives a slightly better result, as this triggers the transparency to use an "object sort" method (Typically this is worse than any Order Independent Transparency method). Or you may use the "painters" renderer for the figures created by executing the following:
>> set(gcf,'Renderer','painters');
Our development team is looking into addressing this issue and it will be considered for a future release of MATLAB.

추가 답변 (1개)

Hao Li
Hao Li 2018년 7월 13일

0 개 추천

Thanks a lot for your answer. Yes, when I set the 'renderer' as 'painter' the figure is better.

카테고리

도움말 센터File Exchange에서 Graphics Performance에 대해 자세히 알아보기

질문:

2018년 7월 10일

답변:

2018년 7월 13일

Community Treasure Hunt

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

Start Hunting!

Translated by