[vtkusers] Black image with offscreen rendering(using osmesa)

Hassan Amin hassan.amin at nu.edu.pk
Mon Feb 8 05:25:39 EST 2010


Thanks, I configured Mesa 7.6.1 with vtk 5.0.3 according to your
instructions and offscreen rendering works. I would also like to share
your instructions over internet if you permit.

Regards,

Dr. Hassan Amin

On Sun, Feb 7, 2010 at 12:42 PM, Kevin H. Hobbs <hobbsk at ohiou.edu> wrote:
> On 02/07/2010 09:24 AM, Hassan Amin wrote:
>> I have tried compiling Mesa 5.0.2 and vtk 5.0.3 using the instructions on :
>>
>> http://www.vtk.org/Wiki/VTK:How_I_mangled_Mesa
>>
>
> First things first : Please include vtkusers at vtk.org in the list of
> recipients of your e-mails.
>
> Mangled Mesa is no longer supported by either Mesa or VTK.
>
> The first step is to get the latest version of mesa:
>
>    wget ftp://ftp.freedesktop.org/pub/mesa/7.6.1/MesaLib-7.6.1.tar.bz2
>
> Un-tar it :
>
>    tar -xjvf MesaLib-7.6.1.tar.bz2
>
> Build it :
>
>    cd Mesa-7.6.1/
>    make linux-x86-64
>
> Note: the mesa build depends on the depreciated X build tool imake which
> is often not installed by default.
>
> Get the latest version of VTK :
>
>    wget http://www.vtk.org/files/release/5.4/vtk-5.4.2.tar.gz
>
> Un-tar it :
>
>    tar -xzvf vtk-5.4.2.tar.gz
>
> Make a build directory for VTK :
>
>    mkdir VTK_Build
>
> Configure VTK in the build directory :
>
>    cd VTK_Build/
>    cmake \
>        -D
> OPENGL_INCLUDE_DIR:PATH=/home/kevin/OSMesaDemo/Mesa-7.6.1/include/ \
>        -D
> OPENGL_gl_LIBRARY:FILEPATH=/home/kevin/OSMesaDemo/Mesa-7.6.1/lib64/libGL.so
> \
>        -D
> OPENGL_glu_LIBRARY:FILEPATH=/home/kevin/OSMesaDemo/Mesa-7.6.1/lib64/libGLU.so
> \
>        -D VTK_OPENGL_HAS_OSMESA:BOOL=ON \
>        -D
> OSMESA_INCLUDE_DIR:PATH=/home/kevin/OSMesaDemo/Mesa-7.6.1/include/ \
>        -D
> OSMESA_LIBRARY:FILEPATH=/home/kevin/OSMesaDemo/Mesa-7.6.1/lib64/libOSMesa.so
> \
>        ../VTK
>
> Build VTK ( you can do this in parallel if you have a multi-core CPU )
>
>    make -j8
>
> Copy the text of the example program and CMakeLists.txt file from :
>
>    http://www.vtk.org/Wiki/VTK/Examples/OffScreenRendering
>
>    cd ..
>    gvim OffScreenRendering.cxx
>    gvim CMakeLists.txt
>    cmake -D VTK_DIR:PATH=/home/kevin/OSMesaDemo/VTK_Build ./
>    make
>    unset DISPLAY
>    ./OffScreenRendering
>
> You should now have a picture of a sphere in screenshot.png.
>
> You will of course have to replace "/home/kevin/OSMesaDemo/" with
> whatever you like everywhere it appears above.
>
>
>
>
>
>
>



-- 
Dr. Hassan Amin
Assistant Professor
Head of Computer Science Department
National University(NUCES)
Peshawar Campus
Pakistan
Phone:0092-(0)91-111-128-128
Email: hassan.amin at nu.edu.pk



More information about the vtkusers mailing list