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

Joachim Pouderoux joachim.pouderoux at kitware.com
Tue Jul 29 08:55:46 EDT 2014


Actually it seems like there is a bug in vtkOpenGLProperty.cxx that I might
have fixed. I will make a patch soon.
In the meanwhile try to change those lines:


        needDefaultMainVS = !progHasVertex
          && propProg->HasVertexShaders();
        needDefaultMainFS = !progHasFragment
          && propProg->HasFragmentShaders();

by

        needDefaultMainVS = !progHasVertex
          && !propProg->HasVertexShaders();
        needDefaultMainFS = !progHasFragment
          && !propProg->HasFragmentShaders();

With that fixed, the steps you defined should now work as no second main()
will be added to both shader code.

Joachim

*Joachim Pouderoux*

*PhD, Technical Expert*
*Kitware SAS <http://www.kitware.fr>*



2014-07-18 11:03 GMT+02:00 carlinhos <carlinhosmp87 at gmail.com>:

> Hello Xiaoming,
>
> I created a new vtkOpenGLProperty and set it to the actor, anyways i tried
> to cast the vtkProperty obtained by the a vtkActor::GetProperty(),
> because vtkProperty is an abstract class. I tried so many things to make it
> work but i didn't manage to do it. Also i tried to use vtkOpenGLActors
> instead of vtkActors but it also didn't work.
>
> Carlos.
>
>
> 2014-07-18 9:46 GMT+02:00 xiaoming [via VTK] <[hidden email]
> <http://user/SendEmail.jtp?type=node&node=5727905&i=0>>:
>
>> i'm sorry but i see that vtkActor::GetProperty() returns a pointer to the
>> vtkProperty not vtkOpenGLProperty,which has a member of SetPropProgram,i 'm
>> just confused with the 7th step,would you bother to tell me sth about that
>> ,thanks in advance.
>> Quote:
>> <  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).>
>>
>>
>>
>> ------------------------------
>>  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-tp5727788p5727903.html
>>  To unsubscribe from GLSL Shader on a vtkActor (VTK 6.1 and Qt 5.2.1), click
>> here.
>> 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: Re: GLSL Shader on a vtkActor (VTK 6.1 and
> Qt 5.2.1)
> <http://vtk.1045678.n5.nabble.com/GLSL-Shader-on-a-vtkActor-VTK-6-1-and-Qt-5-2-1-tp5727788p5727905.html>
>  Sent from the VTK - Dev mailing list archive
> <http://vtk.1045678.n5.nabble.com/VTK-Dev-f1251487.html> 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
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtk-developers/attachments/20140729/fb819bce/attachment-0002.html>


More information about the vtk-developers mailing list