[vtkusers] vtkOpenGLOffscreenRenderWindow + vtkTexture = bus error

Randy Heiland heiland at ncsa.uiuc.edu
Mon Oct 23 12:13:36 EDT 2000


Mykola,

No promise that it'll work for you, but some time ago I had to write a
vtkOpenGLOffscreenTexture class to accompany the OffscreenRender class.

Get it from the bottom of:
  http://www.ncsa.uiuc.edu/~heiland/vtk/

--Randy

On Oct 23,  5:53pm, Mykola Khotyaintsev wrote:
> Subject: [vtkusers] vtkOpenGLOffscreenRenderWindow + vtkTexture = bus erro
> Dear John/VTK users,
>
> vtkOpenGLOffscreenRenderWindow works good if I don't use any texture. If
> I set the texture - the programm crashes with the BUS ERROR while
> executing renWin.Render() :(
>
> 	Please help.
>
>
> Here is the example code:
>
> import vtk.*;
> import java.awt.*;
> import java.awt.event.*;
>
> public class offscreen {
>
> public static void main (String[] args)
> {
>
>   System.loadLibrary("vtkJava");
>
>   vtkOpenGLOffscreenRenderWindow renWin = new
> vtkOpenGLOffscreenRenderWindow();
>
>   vtkRenderer ren = new vtkRenderer();
>
>   renWin.SetSize(400, 400);
>
>   renWin.AddRenderer(ren);
>
>   vtkSphereSource sphere = new vtkSphereSource();
>   	sphere.SetRadius(1.0);
>   	sphere.SetThetaResolution(18);
>   	sphere.SetPhiResolution(18);
>
>   vtkPolyDataMapper map = new vtkPolyDataMapper();
>   	map.SetInput(sphere.GetOutput());
>   	map.ImmediateModeRenderingOn();
>
>   vtkTexture atext = new vtkTexture();
>   vtkPNMReader pnmReader = new vtkPNMReader();
> 	pnmReader.SetFileName("/home/ko/ovt2g/images/earth_grid.pnm");
> 	atext.SetInput(pnmReader.GetOutput());
> 	atext.InterpolateOn();
>
>   vtkActor aSphere = new vtkActor();
>   	aSphere.SetMapper(map);
> 	aSphere.SetTexture(atext);
>
>
>   ren.AddActor(aSphere);
>   ren.SetBackground(1,1,1); // Background color white
>
>   System.out.print("Rendering ... ");
>   renWin.Render();
>   System.out.println("done.");
>
>
>   vtkWindowToImageFilter windowToImageFilter = new
> vtkWindowToImageFilter();
>   	windowToImageFilter.SetInput(renWin);
>
>   vtkPNMWriter writer = new vtkPNMWriter();
> 	writer.SetInput(windowToImageFilter.GetOutput());
>   	writer.SetFileName("earth.ppm");
> 	writer.Write();
> }
>
> }
>
> Here is the error message:
>
> [ko at anna][~/java]# java offscreen
> NOT using PBuffers...
> Rendering ... SIGBUS    10*  bus error
>     si_signo [10]: SIGBUS    10*  bus error
>     si_errno [0]: Error 0
>     si_code [1]: BUS_ADRALN [addr: 0xa800019]
>
>         stackpointer=FFBED5D8
> "Finalizer" (TID:0x14f164, sys_thread_t:0x14f0a8, state:CW, thread_t: t at 6,
> threadID:0xfecc1d78, stack_bottom:0xfecc2000, stack_size:0x20000) prio=8
>
> [1] java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:106)
> [2] java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:128)
> [3] java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:175)
> -------------------
> "Reference Handler" (TID:0x14a964, sys_thread_t:0x14a8a8, state:CW,
> thread_t: t at 5, threadID:0xfecf1d78, stack_bottom:0xfecf2000,
> stack_size:0x20000) prio=10
>
> [1] java.lang.Object.wait(Object.java:424)
> [2] java.lang.ref.Reference$ReferenceHandler.run(Reference.java:107)
> -------------------
> "Signal dispatcher" (TID:0x138214, sys_thread_t:0x138158, state:MW,
> thread_t: t at 4, threadID:0xfed51d78, stack_bottom:0xfed52000,
> stack_size:0x20000) prio=10
>
> -------------------
> "main" (TID:0x3859c, sys_thread_t:0x384e0, state:R, thread_t: t at 1,
> threadID:0x25118, stack_bottom:0xffbf0000, stack_size:0x20000) prio=5
> *current thread*
>
> [1] vtk.vtkRenderWindow.Render_5(Native Method)
> [2] vtk.vtkRenderWindow.Render(vtkRenderWindow.java:32)
> [3] offscreen.main(offscreen.java:44)
> -------------------
> Abort (core dumped)
>
>
> Thanx in advance,
>
> Mykola
>
>
> _______________________________________________
> This is the private VTK discussion list.
> Please keep messages on-topic. Check the FAQ at:
<http://public.kitware.com/cgi-bin/vtkfaq>
> Follow this link to subscribe/unsubscribe:
> http://public.kitware.com/mailman/listinfo/vtkusers
>-- End of excerpt from Mykola Khotyaintsev






More information about the vtkusers mailing list