Difference between revisions of "VTK/OpenGL"

From KitwarePublic
< VTK
Jump to navigationJump to search
m (Reverted edits by FnjH5w (Talk); changed back to last version by Matt)
Line 1: Line 1:
=ATI Open GL Driver on Linux=
+
= Linux =
 +
==ATI Open GL Driver==
  
==ATI Driver on Debian GNU/Linux==
+
===ATI Driver on Debian GNU/Linux===
  
 
http://wiki.cchtml.com/index.php/Debian_Installation_Guide#Compile_the_kernel_driver
 
http://wiki.cchtml.com/index.php/Debian_Installation_Guide#Compile_the_kernel_driver
Line 10: Line 11:
  
  
==ATI Driver on Fedora 2==
+
===ATI Driver on Fedora 2===
 
Other (untested) How To:
 
Other (untested) How To:
 
* Fedora 2:
 
* Fedora 2:
 
http://www.redhat.com/archives/fedora-list/2004-May/msg06859.html
 
http://www.redhat.com/archives/fedora-list/2004-May/msg06859.html
  
==Debugging the ATI libGL==
+
===Debugging the ATI libGL===
  
 
Some env var you should remember:
 
Some env var you should remember:
Line 25: Line 26:
 
   LIBGL_DEBUG=verbose
 
   LIBGL_DEBUG=verbose
  
==Documentation for fglrx options==
+
===Documentation for fglrx options===
 
Daniel Leidert wrote a man page at:
 
Daniel Leidert wrote a man page at:
  
Line 33: Line 34:
 
* [http://gentoo-wiki.com/HOWTO_ATI_Drivers HOWTO ATI Drivers]
 
* [http://gentoo-wiki.com/HOWTO_ATI_Drivers HOWTO ATI Drivers]
  
=nVidia Open GL Driver on Linux=
+
==nVidia Open GL Driver on Linux==
  
==nVidia Driver on Debian GNU/Linux==
+
===nVidia Driver on Debian GNU/Linux===
  
 
How to get OpenGL nVidia driver working on a linux debian system.
 
How to get OpenGL nVidia driver working on a linux debian system.
Line 60: Line 61:
  
  
==nVidia Driver on Ubuntu ==
+
===nVidia Driver on Ubuntu ===
  
 
The Wiki page is fairly simple just linking to [http://ubuntulinux.org/wiki/BinaryDriverHowto it]
 
The Wiki page is fairly simple just linking to [http://ubuntulinux.org/wiki/BinaryDriverHowto it]
  
 
Since the debian way seems to be broken http://packages.ubuntu.com/hoary/misc/java-package, here is how to install Java on [http://www.ubuntulinux.org/wiki/Java ubuntu].
 
Since the debian way seems to be broken http://packages.ubuntu.com/hoary/misc/java-package, here is how to install Java on [http://www.ubuntulinux.org/wiki/Java ubuntu].
 +
 +
= Mac OS X =
 +
== Corrupted display ==
 +
If it happens with an ATI card from the r600 series (2600 XT) or the r500 series (older series) or with an nVidia GeForce 7 series, you probably had called SetStereoWindowCapable(true) on the RenderWindow. This a driver bug. The only workaround is to call SetStereoWindowCapable(false).
 +
 +
ref: [http://www.vtk.org/Bug/view.php?id=9191 VTK bug report], [http://lists.apple.com/archives/x11-users/2009/Jun/msg00135.html thread on the Apple mailing list]
  
 
= Mesa, Off Screen Mesa, Mangled Mesa =
 
= Mesa, Off Screen Mesa, Mangled Mesa =

Revision as of 15:25, 10 July 2009

Linux

ATI Open GL Driver

ATI Driver on Debian GNU/Linux

http://wiki.cchtml.com/index.php/Debian_Installation_Guide#Compile_the_kernel_driver

I tested Method1 only --Mathieu 22:53, 17 October 2006 (EDT)


ATI Driver on Fedora 2

Other (untested) How To:

  • Fedora 2:

http://www.redhat.com/archives/fedora-list/2004-May/msg06859.html

Debugging the ATI libGL

Some env var you should remember:

 LIBGL_ALWAYS_INDIRECT=1
 LIBGL_VERBOSE=1
 LIBGL_DEBUG=verbose

Documentation for fglrx options

Daniel Leidert wrote a man page at:

nVidia Open GL Driver on Linux

nVidia Driver on Debian GNU/Linux

How to get OpenGL nVidia driver working on a linux debian system.

This wiki page is based on:

http://home.comcast.net/~andrex/Debian-nVidia/index.html

First thing you need to do is allow unstable from your sources.list file otherwise even the assistant will fail to load the nvidia-kernel-source package

 # Be carefull only for nvidia-kernel-source
 deb http://ftp.us.debian.org/debian/ unstable main non-free contrib

Another extremely important note is the matching gcc version. Be carefull that on debian most of the binary are build with gcc 3.3 , do not use gcc 3.4 or gcc 2.95 (make sure that CC is not set to anything particular).


The installation process of the nvidia library seems to be broken and noone has been working on it since two years:

See Debian bug #208198

See also http://home.comcast.net/~andrex/Debian-nVidia/troubleshooting.html Section: Hardware acceleration, aka direct rendering, doesn't work.

IMPORTANT: Seems like you need to install: xlibmesa-gl-dev AND then nvidia-glx-dev !


nVidia Driver on Ubuntu

The Wiki page is fairly simple just linking to it

Since the debian way seems to be broken http://packages.ubuntu.com/hoary/misc/java-package, here is how to install Java on ubuntu.

Mac OS X

Corrupted display

If it happens with an ATI card from the r600 series (2600 XT) or the r500 series (older series) or with an nVidia GeForce 7 series, you probably had called SetStereoWindowCapable(true) on the RenderWindow. This a driver bug. The only workaround is to call SetStereoWindowCapable(false).

ref: VTK bug report, thread on the Apple mailing list

Mesa, Off Screen Mesa, Mangled Mesa

Various setups:

  • Pure OpenGL
  • Pure Mesa (no hardware and it has off screen natively)
  • OpenGL + Mangled Mesa (hardware on-screen and software off-screen)

Pure Mesa

  • Enable VTK_OPENGL_HAS_OSMESA
  • Set the following values to apropriate locations:
OSMESA_INCLUDE_DIR /.../include
OSMESA_LIBRARY     /.../lib/libOSMesa.a

OpenGL + Off screen

To do hardware rendering (on screen) and software rendering (off screen) within the same application, you will have to use mangled mesa. Mangled mesa is build using all symbols mangled.

You may want to first look at article How I Mangled Mesa.

Build Mangled Mesa

The following refers to Mesa 6.2.*

Edit apropriate system configuration file. On Linux, for example, if you are building static, edit the file:

/path/to/source/config/linux-static

Edit the CFLAGS line and add the following at the end of CFLAGS and CXXFLAGS:

-DUSE_MGL_NAMESPACE

Then edit file:

/path/to/source/config/default

And rename the standard names for the libraries, for example:

# Library names (base name)
GL_LIB = MesaGL
GLU_LIB = MesaGLU
GLUT_LIB = MesaGlut
GLW_LIB = MesaGLw
OSMESA_LIB = MesaOSMesa

Setup VTK

  • Disable VTK_OPENGL_HAS_OSMESA
  • Make sure OpenGL settings are set to the hardware OpenGL library:
OPENGL_INCLUDE_DIR               /usr/include                                                                                                                           
OPENGL_gl_LIBRARY                /usr/lib/libGL.so                                                                                                                      
OPENGL_glu_LIBRARY               /usr/lib/libGLU.so                                                                                                                     
  • Enable VTK_USE_MANGLED_MESA
  • Set mangled mesa options:
MANGLED_MESA_INCLUDE_DIR        /.../include
MANGLED_MESA_LIBRARY            /.../lib/libMesaGL.a
MANGLED_OSMESA_INCLUDE_DIR      /.../include
MANGLED_OSMESA_LIBRARY          /.../lib/libMesaOSMesa.a

Use of Mangled Mesa

  • For all mangled mesa calls, the vtk*Mesa* classes need to be used. For example, instead of vtkRenderWindow, vtkXMesaRenderWindow must be used. The full list of classes is:
vtkXMesaRenderWindow
vtkMesaActor
vtkMesaCamera
vtkMesaImageActor
vtkMesaLight
vtkMesaProperty
vtkMesaPolyDataMapper
vtkMesaRenderer
vtkMesaTexture
vtkMesaVolumeTextureMapper2D
vtkMesaVolumeRayCastMapper
vtkMesaRayCastImageDisplayHelper
vtkMesaFreeTypeTextMapper
vtkMesaImageMapper
vtkMesaPolyDataMapper2D
  • To make Mangled mesa to be default, do the following at beginning of the program:
vtkGraphicsFactory::SetUseMesaClasses(1);
vtkImagingFactory::SetUseMesaClasses(1);



VTK: [Welcome | Site Map]