[vtk-developers] GLSL Shader on a vtkActor (VTK 6.1 and Qt 5.2.1)

carlinhos carlinhosmp87 at gmail.com
Wed Jul 9 04:06:18 EDT 2014


Thanks for your answer, i thought to use them to give my actors metallic
visualization.

Maybe i could use textures to show actors with that kind of visualization.

Carlos.


2014-07-08 21:41 GMT+02:00 Marcus D. Hanwell-2 [via VTK] <
ml-node+s1045678n5727800h40 at n5.nabble.com>:

> I don't think that would be useful at this time - whilst the new
> rendering code is shader based we have not yet started to add
> functionality to add your own or modify our shader code.
>
> On Tue, Jul 8, 2014 at 3:07 PM, Aashish Chaudhary
> <[hidden email] <http://user/SendEmail.jtp?type=node&node=5727800&i=0>>
> wrote:
>
> > I can reply in detail layer but on this note, you may want to use the
> new
> > VTK rendering code for it. Marcus or Ken hopefully reply to you on that.
> >
> > - Aashish
> >
> >
> > On Tue, Jul 8, 2014 at 2:14 PM, Carlos Martinez <[hidden email]
> <http://user/SendEmail.jtp?type=node&node=5727800&i=1>>
> > wrote:
> >>
> >> Thanks for your answer, i thought it wasn't the right way!
> >>
> >> What do you mean when you say i have to load the shaders manually? The
> >> steps i'm doing are:
> >>
> >> 1- Create a vtkShaderProgram2
> >> 2- Create the vtkShader2 (VertexShader) and load it from the file with
> >> SetSourceCode.
> >> 3- Add my VertexShader to the vtkShaderProgram2 with
> >> "GetShaders()->AddItem()".
> >> 4- Repeat 2 and 3 with the FragmentShader.
> >> 5- Build the vtkShaderProgram and check the Build Status (to check if
> >> everything is ok).
> >> 6- Create a vtkActor and obtain his property(with GetProperty()).
> >> 7- Put ShadingOn to the property and SetPropProgram with the
> >> vtkShaderProgram2 build before (The vtkShaderProgram on debug has only
> the 2
> >> shaders I put in).
> >>
> >> When the actors are going to display into the screen, the warning
> window
> >> shows up and tells me that the main is defined twice (and shows me the
> >> Default shaders and mine).
> >>
> >> Thanks again!!
> >>
> >>
> >> 2014-07-08 18:25 GMT+02:00 Aashish Chaudhary
> >> <[hidden email] <http://user/SendEmail.jtp?type=node&node=5727800&i=2>>:
>
> >>
> >>> vtkOpenGLProperty::SetPropProgram is the right function but you have
> load
> >>> your shaders manually now. I believe the error you are getting is
> because it
> >>> is still trying to use the last shader code.
> >>>
> >>> - Aashish
> >>>
> >>>
> >>>
> >>> On Tue, Jul 8, 2014 at 3:15 AM, carlinhos <[hidden email]
> <http://user/SendEmail.jtp?type=node&node=5727800&i=3>>
> >>> wrote:
> >>>>
> >>>> Hi all,
> >>>>
> >>>> I'm using Vtk 6.1.0 and Qt 5.2.1 (C++) to develop my app.
> >>>>
> >>>> I have an assembly with different actors into a vtkRenderWindow.
> >>>>
> >>>> I load a shader with the class vtkShader2, and create the program
> with
> >>>> vtkShaderProgram2, all ok with this. After that, i wanted to attach
> the
> >>>> shader to the actors (i'm going to use different shaders, depending
> on
> >>>> the
> >>>> actors). The problem is i didn't find examples or documentation to do
> >>>> this
> >>>> and i'm not capable to use the classes for the shaders correctly.
> >>>>
> >>>> I searched into the class vtkOpenGLProperty to set the
> vtkShaderProgram2
> >>>> with the method "SetPropProgram" and i set the property of the actors
> >>>> with
> >>>> that one, but vtk shows me a warning window with a conflict between
> the
> >>>> default shaders and mine (total 4 shaders, 2 vertex and 2 fragment).
> >>>>
> >>>> Can someone help me? Thanks in advance!!
> >>>>
> >>>>
> >>>>
> >>>> --
> >>>> View this message in context:
> >>>>
> http://vtk.1045678.n5.nabble.com/GLSL-Shader-on-a-vtkActor-VTK-6-1-and-Qt-5-2-1-tp5727788.html
> >>>> Sent from the VTK - Dev mailing list archive at Nabble.com.
> >>>> _______________________________________________
> >>>> Powered by www.kitware.com
> >>>>
> >>>> Visit other Kitware open-source projects at
> >>>> http://www.kitware.com/opensource/opensource.html
> >>>>
> >>>> Follow this link to subscribe/unsubscribe:
> >>>> http://public.kitware.com/mailman/listinfo/vtk-developers
> >>>>
> >>>
> >>>
> >>>
> >>> --
> >>> | Aashish Chaudhary
> >>> | Technical Leader
> >>> | Kitware Inc.
> >>> | http://www.kitware.com/company/team/chaudhary.html
> >>
> >>
> >
> >
> >
> > --
> > | Aashish Chaudhary
> > | Technical Leader
> > | Kitware Inc.
> > | http://www.kitware.com/company/team/chaudhary.html
> >
> > _______________________________________________
> > Powered by www.kitware.com
> >
> > Visit other Kitware open-source projects at
> > http://www.kitware.com/opensource/opensource.html
> >
> > Follow this link to subscribe/unsubscribe:
> > http://public.kitware.com/mailman/listinfo/vtk-developers
> >
> >
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Follow this link to subscribe/unsubscribe:
> http://public.kitware.com/mailman/listinfo/vtk-developers
>
>
>
> ------------------------------
>  If you reply to this email, your message will be added to the discussion
> below:
>
> http://vtk.1045678.n5.nabble.com/GLSL-Shader-on-a-vtkActor-VTK-6-1-and-Qt-5-2-1-tp5727788p5727800.html
>  To unsubscribe from GLSL Shader on a vtkActor (VTK 6.1 and Qt 5.2.1), click
> here
> <http://vtk.1045678.n5.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=5727788&code=Y2FybGluaG9zbXA4N0BnbWFpbC5jb218NTcyNzc4OHwtMTY5NTc0MDIy>
> .
> NAML
> <http://vtk.1045678.n5.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>
>




--
View this message in context: http://vtk.1045678.n5.nabble.com/GLSL-Shader-on-a-vtkActor-VTK-6-1-and-Qt-5-2-1-tp5727788p5727802.html
Sent from the VTK - Dev mailing list archive at Nabble.com.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtk-developers/attachments/20140709/98e7580d/attachment-0002.html>


More information about the vtk-developers mailing list