"mesh" or "surf" display problem on Windows 7

2 次查看(过去 30 天)
Hi,
This is strange and I scratched my head but could't figure out why. Very simple matlab code:
[x,y] = meshgrid(1:10,1:10);
mesh(x,y,x);
or:
surf(x,y,x);
I would expect to see a regular grid displayed either only showing the edges or surface patches. Works fine on Linux or Mac (R2012a), but it shows some extra lines/edges on my Windows 7 platform, like lines connecting nodes on the left to the nodes on the right at a different row. I wish I could upload a figure to demonstrate (if possible, how?)
I have also confirmed that if I save the figure on Linux, and open on Windows, same thing happens. The following is the ver on my Windows.
It appears to me this is probably a display problem. but not sure what is the cause, and how to overcome with it.
>> ver
-------------------------------------------------------------------------------------------------------
MATLAB Version: 7.14.0.739 (R2012a)
MATLAB License Number: (manually deleted)
Operating System: Microsoft Windows 7 Version 6.1 (Build 7601: Service Pack 1)
Java Version: Java 1.6.0_17-b04 with Sun Microsystems Inc. Java HotSpot(TM) 64-Bit Server VM mixed mode
-------------------------------------------------------------------------------------------------------

回答(10 个)

Pinpress
Pinpress 2012-11-6
编辑:Pinpress 2012-11-6
OK -- some more discovery here. I think the problem is with the "opengl" renderer. If I change to "zbuffer", the problem is gone.
Any suggestion how to make opengl work? Sometimes the figure has a lot of data, opengl seems faster (based on past experience).
thanks.
>> opengl info
Version = 3.3.0 Vendor = NVIDIA Corporation Renderer = Quadro FX 1700/PCIe/SSE2 MaxTextureSize = 8192 Visual = 07 (RGB 32 bits(08 08 08 00) zdepth 24, Hardware Accelerated, Opengl, Double Buffered, Window) Software = false # of Extensions = 243
Driver Bug Workarounds: OpenGLBitmapZbufferBug = 0 OpenGLWobbleTesselatorBug = 0 OpenGLLineSmoothingBug = 0 OpenGLDockingBug = 0 OpenGLClippedImageBug = 1 OpenGLEraseModeBug = 1

Sean de Wolski
Sean de Wolski 2012-11-6
First: update your graphics drivers.
Second: you could try the software implementation of OpenGL:
opengl software
and
doc opengl
for more information on OpenGL and what to do about OpenGL issues.

Pinpress
Pinpress 2012-11-6
Thanks. The graphics card driver is up-to-date. Tried both software and hardware opengl, same effect and no cure. Also tried all "work around", still no help.
K>> opengl info
Version = 3.3.0 Vendor = NVIDIA Corporation Renderer = Quadro FX 1700/PCIe/SSE2 MaxTextureSize = 8192 Visual = 07 (RGB 32 bits(08 08 08 00) zdepth 24, Hardware Accelerated, Opengl, Double Buffered, Window) Software = false # of Extensions = 243
Driver Bug Workarounds: OpenGLBitmapZbufferBug = 0 OpenGLWobbleTesselatorBug = 0 OpenGLLineSmoothingBug = 0 OpenGLDockingBug = 0 OpenGLClippedImageBug = 1 OpenGLEraseModeBug = 1
K>> opengl software K>> set(gcf,'renderer','opengl'); K>> opengl software K>> opengl info
Version = 1.1.0 Vendor = Microsoft Corporation Renderer = GDI Generic MaxTextureSize = 1024 Visual = 309 (RGB 32 bits(08 08 08 00) zdepth 32, Generic, Opengl, Double Buffered, Window) Software = true # of Extensions = 3
Driver Bug Workarounds: OpenGLBitmapZbufferBug = 1 OpenGLWobbleTesselatorBug = 0 OpenGLLineSmoothingBug = 0 OpenGLDockingBug = 0 OpenGLClippedImageBug = 0 OpenGLEraseModeBug = 0

Fredrik
Fredrik 2013-3-8
Hi,
I have exactly the same problem. Are there any solutions?
best regards, Fredrik

Fredrik
Fredrik 2013-3-11
Hi Sean,
thanks, it works now. What I did to get it work:
- I updated graphic drivers - problem is still there.
- I tried
opengl software
and
opengl hardware
problem is still there.
- I set the renderer manually to opengl:
set(gcf, 'Renderer', 'OpenGL');
It works! Independent from 'opengl software' or 'opengl hardware'.

Francis
Francis 2013-3-15
编辑:Francis 2013-3-15
Hello, I am experiencing the same issue, see this image for example: (left is with the default opengl renderer, right is with zbuffer)
- Software OpenGL produces the same incorrect output
- Manullay setting the renderer (as above) produces the same incorrect output
- I am using the latest drivers from nvidia for my Quadro FX580.
- Windows 7 SP1 x64
- Matlab R2012b
EDIT: Software opengl does fix the problem, i just have to set the renderer to zbuffer then back to opengl for the figure to redraw.
Is this a bug with matlab or opengl/drivers? I see no reason why hardware opengl should produce incorrect output

Roger Moss
Roger Moss 2013-9-18
I've got the same problem - R2013b, Windows 7, Quadro K600 graphics card. New PC with the latest drivers.
The 'painters' and 'zbuffer' renderers work but OpenGL (either hardware or software) gives me spurious edge lines that wrap back from the end of each mesh line to the start of the next.
e.g. surf(peaks(10)); set(gcf, 'renderer', 'opengl') % looks horrible
I had this in R2012b and I thought installing 2013b might fix it, but it hasn't.
Roger

Erik S.
Erik S. 2013-10-7
I've got the same problem on Win 7 Matlab R-2012B. I am running a Quadro 2000D. Is this an issue only with Quadro cards? When I am running the same machine with a Geforce there are no errors.
Erik

Gabriel
Gabriel 2014-1-2
I am using Quadro K3000M/PCIe/SSE2, and also have this problem. It occurs on larger meshes, but not on smaller meshes. For example, the following code gives no display errors:
n = 10;
x = linspace(-10,10, n);
y = linspace(-10,10, n);
z = repmat((y.^2)', [1,n]) - repmat(x.^2, [n,1]);
mesh(x,y,z)
However, if n is set to 50, then the display error occurs.
Is Mathworks working on a solution to this?
Gabe

Gabriel
Gabriel 2014-3-17
A simple fix I found is to set the 'EdgeAlpha' value to something other than 1. I set the 'EdgeAlpha' to 0.99 and the extra lines go away.
Gabe
  2 个评论
Sean de Wolski
Sean de Wolski 2014-7-31
This is the same effect of explicitly setting the renderer to OpenGL (which is required for transparency)
set(gcf,'Renderer','OpenGL')

请先登录,再进行评论。

类别

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