You are on the right track. And indeed use vtkShaderProgram2 (similar to LIC) and not the XMLShaders.
Utkarsh On Thu, Oct 27, 2011 at 4:44 PM, Sohail Shafii <[email protected]> wrote: > Thanks. That seems to do the trick. The only other issue is the rendering > context. I've used the line integral convolution/lic filters as an example, > and it seems like I need a "SetContext" function, which is passed a pointer > to an (new) allocated vtkRenderWindow object. For reference, I am looking > at vtkImageDataLIC2D.cxx. > > I will then need to downcast this object to a vtkOpenGLRenderWindow and pass > it to vtkShaderProgram2, which requires a proper context...well I've done > all of that, and so far I've noticed that a new (small, blacked out) window > with the title "Visualization Toolkit" pops up when I start my filter. Now > I have to do something with this fragment shader (which currently does > nothing). > > Am I on the right track here? Or I am issuing an improper context? > > Sohail > > ________________________________ > From: Utkarsh Ayachit <[email protected]> > To: Sohail Shafii <[email protected]> > Cc: "[email protected]" <[email protected]> > Sent: Wednesday, October 26, 2011 8:43 AM > Subject: Re: [Paraview] Linking error when trying to use > vtkGLSL/vtkXMLShader > > Classes in graphics cannot depend on classes in rendering. You can move your > filter to hybrid. > Utkarsh > > > > On Oct 26, 2011, at 12:11 AM, Sohail Shafii <[email protected]> wrote: > > Hi, > I am currently trying to do some shader operations in a standard C++ filter. > This filter (inherits from vtkMultiBlockDataSetAlgorithm, resides in > VTK/Graphics) will be used to voxelize a polygonal object (basically the > result of the contour filter) and write the results to a 3D texture. > I tried to do the following: > vtkXMLShader *xmlShader = vtkXMLShader::New(); > vtkGLSLShader *glslShader = vtkGLSLShader::New(); > Which results in: > Undefined symbols for architecture x86_64: > "vtkXMLShader::New()", referenced from: > vtkRepulsiveForceFieldGenerator::RequestData(vtkInformation*, > vtkInformationVector**, vtkInformationVector*)in > vtkRepulsiveForceFieldGenerator.cxx.o > "vtkGLSLShader::New()", referenced from: > vtkRepulsiveForceFieldGenerator::RequestData(vtkInformation*, > vtkInformationVector**, vtkInformationVector*)in > vtkRepulsiveForceFieldGenerator.cxx.o > ld: symbol(s) not found for architecture x86_64 > collect2: ld returned 1 exit status > I'm going to guess that standard filters can't use code like this, and that > my filter should reside inside of the VTK/Rendering folder and follow the > examples in that folder. > Thanks, > Sohail > > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Please keep messages on-topic and check the ParaView Wiki at: > http://paraview.org/Wiki/ParaView > > Follow this link to subscribe/unsubscribe: > http://www.paraview.org/mailman/listinfo/paraview > > > _______________________________________________ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the ParaView Wiki at: http://paraview.org/Wiki/ParaView Follow this link to subscribe/unsubscribe: http://www.paraview.org/mailman/listinfo/paraview
