[vtk-developers] Render Overlay change

Lisa Avila lisa.avila at kitware.com
Fri Apr 12 11:12:31 EDT 2002


Randy,

If no one understands why it is not working in the first place then I 
suppose it is always possible that this change will fix your problem. :-)

I don't think this will make any difference though - OpenGL text rendering 
is being processed during the RenderOpaqueGeometry portion of the rendering 
process, and I have not yet changed this. (Unless the text is 3D it really 
should be done during the overlay pass but I have not yet looked into this).

Lisa

At 10:56 AM 4/12/2002, Randy Heiland wrote:
>Lisa,
>
>Any idea if this will fix the problem I reported earlier this week re 
>text/Mesa
>offscreen (see below)?
>
>--Randy
>
>
>On Apr 11,  4:23pm, Lisa Avila wrote:
> > Subject: RE: [vtk-developers] Render Overlay change
> >
> > No API change. I've already made this change and checked it in. All tests
> > pass (well, three fail on my system but they failed before I made the
> > change) - but we have pathetically few tests that render 2D geometry.
> >
> > There are some behavior differences but the new behavior should be more
> > desirable.
> >
> > Lisa
> >
> > At 03:10 PM 4/11/2002, Lorensen, William E (Research) wrote:
> > >Will the API change?
> > >
> > >-----Original Message-----
> > >From: Lisa Avila [mailto:lisa.avila at kitware.com]
> > >Sent: Thursday, April 11, 2002 2:10 PM
> > >To: vtk-developers
> > >Subject: [vtk-developers] Render Overlay change
> > >
> > >
> > >Hi,
> > >
> > >I am planning to make a change to the render process. Currently we have
> > >three passes - RenderOpaqueGeometry, RenderTranslucentGeometry, and
> > >RenderOverlay. The first two happen before the buffers are swapped in
> > >double buffering, and the third happens afterwards.
> > >
> > >My proposal is to move the RenderOverlay pass before the buffers are
>swapped.
> > >
> > >The reason it is after is historical - VTK used to support X and Win32
> > >native rendering for text / 2D geometry, which was single buffered. This
> > >support is now gone, so the need for render overlay to be after the
> > >swapbuffers is also gone.
> > >
> > >The reason I want to make this change is I would like to change 2D
> > >rendering over to using the RenderOverlay pass. This will make 2D geometry
> > >render AFTER all opaque and translucent geometry. This means we will be
> > >able to have, for example, translucent overlays while still seeing volume
> > >rendering intermixed with opaque geometry behind it.
>
>--------------------------
>--- Forwarded mail from Berk Geveci <berk.geveci at kitware.com>
>
>Subject: Re: [vtkusers] vtkScaledTextActor & offscreen
>From: Berk Geveci <berk.geveci at kitware.com>
>To: Randy Heiland <heiland at ncsa.uiuc.edu>
>Cc: vtkusers <vtkusers at public.kitware.com>
>Date: 09 Apr 2002 16:38:39 -0400
>
>I can confirm (with a similar linux machine). I can't
>explain why though. All the necessary offscreen code
>is in Rendering/vtkXOpenGLRenderWindow.{h|cxx}. Maybe
>someone who knows Mesa better can take a look at it ?
>
>-Berk
>
>On Tue, 2002-04-09 at 13:49, Randy Heiland wrote:
> > Can someone tell me why a vtkScaledTextActor doesn't appear in a (Mesa)
> > offscreen rendering (but does for onscreen)?  (VTK4.0, Mesa 4.0, RH7.2)
> >
> > Else, can someone confirm/deny?
> >
> > thanks,
> > --Randy
> >
> > Here are simple Python & Tcl scripts:
> >
> > -------------------------------------
> > from vtk import *
> >
> > ren1 = vtkRenderer()
> >
> > renWin = vtkRenderWindow()
> > renWin.AddRenderer(ren1)
> >
> >
> > offscreen = 1
> > offscreen = 0
> > if offscreen > 0:
> >   renWin.SetOffScreenRendering(1)
> > else:
> >   iren= vtkRenderWindowInteractor()
> >   iren.SetRenderWindow(renWin)
> >
> > text1Actor = vtkScaledTextActor()
> > text1Mapper = vtkTextMapper()
> > text1Actor.SetMapper(text1Mapper)
> > text1Mapper.SetInput('frame=')
> > #text1Mapper.SetFontSize(14)
> > text1Actor.GetProperty().SetColor(1.0,1.0,1.0)
> > ren1.AddActor2D(text1Actor)
> >
> > renWin.Render()
> >
> > w2if = vtkWindowToImageFilter()
> > w2if.SetInput( renWin )
> > pnmWriter = vtkPNMWriter()
> > pnmWriter.SetInput(w2if.GetOutput())
> > pnmWriter.SetFileName("img1.pnm")
> > pnmWriter.Write()
> >
> > if offscreen == 0:
> >   iren.Start()
> >
> > ----------------------------------------
> > package require vtk
> > package require vtkinteraction
> >
> > vtkRenderer ren1
> > vtkRenderWindow renWin
> >  renWin AddRenderer ren1
> >
> > vtkRenderWindowInteractor iren
> > #iren SetRenderWindow renWin
> >
> > renWin SetOffScreenRendering 1
> > #renWin SetOffScreenRendering 0
> >
> > vtkScaledTextActor text1Actor
> > vtkTextMapper text1Mapper
> > text1Actor SetMapper text1Mapper
> > text1Mapper SetInput "this is a silly test"
> > #text1Mapper SetFontSize(14)
> > #[text1Actor GetProperty] SetColor(1.0,1.0,1.0)
> > ren1 AddActor2D text1Actor
> >
> > renWin Render
> >
> > vtkWindowToImageFilter w2if
> > w2if SetInput  renWin
> > vtkPNMWriter pnmWriter
> > pnmWriter SetInput [w2if GetOutput]
> > pnmWriter SetFileName "img1.pnm"
> > pnmWriter Write
> >
> >
> > #iren Initialize
> > #iren AddObserver UserEvent {wm deiconify .vtkInteract}
> >
> > # prevent the tk window from showing up then start the event loop
> > #wm withdraw .
> > _______________________________________________
> > 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 forwarded mail from Berk Geveci <berk.geveci at kitware.com>




More information about the vtk-developers mailing list