필터 지우기
필터 지우기

Bug in patch rendering?

조회 수: 4 (최근 30일)
Luc Masset
Luc Masset 2020년 11월 16일
댓글: Star Strider 2020년 11월 17일
Hello,
I came across a problem when rendering small patch objects drawn against huge ones within the same axes. In my app I use a patch object to draw the terrain (imported from a DEM file) as a mesh. The terrain is usually 50 kms wide with square/triangle elements of 25 meters. I also use a patch to display buildings as rectangular blocks that lie on the terrain. The buildings actual size are in meters or tens of meters at max.
When the user zooms on a particular buillding, the are some rendering bugs, especially hidden edges that are actually displayed (edges that lie under the terrain, edges from the opposite sides of the buildings).
This bug seems to come from the fact that we have a very large patch and very small ones on the same axes. I have written a small function to illustrate the problem (see attachment).
The function draws on the same axes a surf (the peaks function) and a simple box on top of it with a ratio given as argument of the function. If the ratio is small, the rendering is ok.
>> test_hidden_edges(100)
When we set a much higher ratio, the rendering fails.
>> test_hidden_edges(2000)
You may turn the view with the mouse (orbit) to see the other side of the box. It is even worse.
Under Matlab R2009b, these rendering problems were not present. Now I use Matlab R2017b. I guess the rendering engine (HG2), started with Matlab R2014, causes these issues.
Is there a solution to this?
Thank you in advance.
Luc

답변 (2개)

Star Strider
Star Strider 2020년 11월 16일
If you do not need the edge lines to be displayed, 'EdgeColor','none' will eliminate all of them in the specific patch call that includes it.
  댓글 수: 2
Luc Masset
Luc Masset 2020년 11월 17일
I need the edges. It renders the graphics much more clearer than without edges. Especially when buildings are complex such as STL models, for which you can see the doors, the windows etc
Star Strider
Star Strider 2020년 11월 17일
It may be that you want more precision than th patch function provides. It would be best for you to Contact Support and tell them abouit this. Include the URL to this thread in your message so that you do not have to repeat everything.

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


Bruno Luong
Bruno Luong 2020년 11월 16일
I wouldn't call it a bug, it is just a poorer precision of rendering, wharever causes it (possibly quantification of calculation at some stage of the rendering).
It seems unrelated to opengl hardware/woftware. Using rendering painters method is horrible.
  댓글 수: 2
Luc Masset
Luc Masset 2020년 11월 17일
That's true. Painters renderer is even worse in this case from a rendering quality point of view, but also it is so slow! And I need to be able to zoom/rotate/pan the view as fast as possible.
I must disagree with you. Not displaying the hidden parts of a model correctly is a bug to me. And it is very annoying. I thought than OpenGL was a mature rendering engine so that such a bug was not possible.
Does Mathworks team is aware of these graphic errors? And are these errors reproductible on other versions of Matlab? On my side, I have tested on 3 different computers with different graphic adapters and the error is exactly the same. I have also tried many settings such as opengl software, lighting none/flat/gouraud, etc etc With no luck.
Bruno Luong
Bruno Luong 2020년 11월 17일
I run 2020b and yes it's there.
I guess if you want to make sure they are aware you must fire a bug report.

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

카테고리

Help CenterFile Exchange에서 Lighting, Transparency, and Shading에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by