MATLAB Function Reference Previous page   Next Page
opengl

Control OpenGL rendering

Syntax

Description

The OpenGL autoselection mode applies when the RendererMode of the figure is auto. Possible values for selection_mode are

opengl, by itself, returns the current autoselection state.

Note that the autoselection state only specifies whether OpenGL should or should not be considered for rendering; it does not explicitly set the rendering to OpenGL. You can do this by setting the Renderer property of the figure to OpenGL. For example,

opengl info prints information with the version and vendor of the OpenGL on your system. Also indicates wether your system is currently using hardware of software OpenGL and the state of various driver bug workarounds. Note that calling opengl info loads the OpenGL Library.

For example, the following output is generated on a Windows XP computer that uses ATI Technologies graphics hardware:

Note that different computer systems may not list all OpenGL bugs.

s = opengl('data') returns a structure containing the same data that is displayed when you call opengl info, with the exception of the driver bug workaround state.

opengl software forces MATLAB to use software OpenGL rendering instead of hardware OpenGL.

opengl hardware reverses the opengl software command and enables MATLAB to use hardware OpenGL rendering if it is available. If your computer does not have OpenGL hardware acceleration, MATLAB automatically switches to software OpenGL rendering.

Note that on UNIX systems, the software or hardware options with the opengl command works only if MATLAB has not yet used the OpenGL renderer or you have not issued the opengl info command (which attempts to load the OpenGL Library).

opengl verbose displays verbose messages about OpenGL initialization (if OpenGL is not already loaded) and other runtime messages.

opengl quiet disables verbose message setting.

opengl DriverBugWorkaround queries the state of the specified driver bug workaround. Use the command opengl info to see a list of all driver bug workarounds. See Driver Bug Workarounds for more information.

opengl('DriverBugWorkaround',WorkaroundState) sets the state of the specified driver bug workaround. You can set WorkaroundState to one of three values:

Driver Bug Workarounds

MATLAB enables various OpenGL driver bug workarounds when it detects certain known problems with installed hardware. However, because there are many versions of graphics drivers, you might encounter situations when MATLAB does not enable a workaround that would solve a problem you are having with OpenGL rendering.

This section describes the symptoms that each workaround is designed to correct so you can decide if you want to try using one to fix an OpenGL rendering problem.

Use the opengl info command to see what driver bug workarounds are available on your computer.

OpenGLBitmapZbufferBug

Symptom: text with background color (including data tips) and text displayed on image, patch, or surface objects is not visible when using OpenGL renderer.

Possible side effect: text is always on top of other objects.

Command to enable:

OpenGLWobbleTesselatorBug

Symptom: Rendering complex patch object causes segmentation violation and returns a tesselator error message in the stack trace.

Command to enable:

OpenGLLineSmoothingBug

Symptom: Lines with a LineWidth greater than 3 look bad.

Command to enable:

OpenGLDockingBug

Symptom: MATLAB crashes when you dock a figure that has its Renderer property set to opengl.

Command to enable:

OpenGLClippedImageBug
Symptom: Images (as well as colorbar displays) do not display when the Renderer property set to opengl.

Command to enable:

See Also

Figure Renderer property for information on autoselection.


Previous page  openfig openvar Next page

© 1994-2005 The MathWorks, Inc.