Bug in patch rendering?
7 views (last 30 days)
Show older comments
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
0 Comments
Answers (2)
Star Strider
on 16 Nov 2020
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 Comments
Star Strider
on 17 Nov 2020
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
on 16 Nov 2020
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 Comments
Bruno Luong
on 17 Nov 2020
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.
See Also
Categories
Find more on Lighting, Transparency, and Shading in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!