How to add custom shaders in OpenGL2 backend

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

How to add custom shaders in OpenGL2 backend

eternallite2
Are there any examples yet of how to add custom vertex and fragment shaders to existing actors in the renderer? (Using the OpenGL2 backend)

Thank you again
Reply | Threaded
Open this post in threaded view
|

Re: How to add custom shaders in OpenGL2 backend

carlinhos
Hi David,


We solved it with the help of Kitware people!

I hope it will help you.

Carlos.


2014-08-13 6:58 GMT+02:00 eternallite2 <[hidden email]>:
Are there any examples yet of how to add custom vertex and fragment shaders
to existing actors in the renderer? (Using the OpenGL2 backend)

Thank you again



--
View this message in context: http://vtk.1045678.n5.nabble.com/How-to-add-custom-shaders-in-OpenGL2-backend-tp5728201.html
Sent from the VTK - Users 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

Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/vtkusers


_______________________________________________
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 VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/vtkusers
Reply | Threaded
Open this post in threaded view
|

Re: How to add custom shaders in OpenGL2 backend

eternallite2
Hello thanks for the reply :) but I'm using VTK 6.2.0 with the OpenGL2 backend.

OpenGL2 seems to be mutually exclusive of VTK 6.1.0's OpenGL 1.1 backend (like

the vtkOpenGLProperty in OpenGL2 doesn't seem to have a "setPropProgram" function

and the vtkShaderProgram2 and vtkShader2 classes don't exist either, and

seem to be replaced with vtkglShaderProgram and vtkglShader.

Hmm...also the rendering seems to be performed in vtkOpenGLPolyDataMapper itself where

they are dynamically replacing commented lines in vertex/fragment shader programs to implementations.

I'm wondering how to plug in custom shader code in this new backend.

Thanks again for any replies (as it's still very new and experimental)
Reply | Threaded
Open this post in threaded view
|

Re: How to add custom shaders in OpenGL2 backend

Marcus D. Hanwell-2
In reply to this post by eternallite2
On Wed, Aug 13, 2014 at 12:58 AM, eternallite2 <[hidden email]> wrote:
> Are there any examples yet of how to add custom vertex and fragment shaders
> to existing actors in the renderer? (Using the OpenGL2 backend)
>
Not yet, we wanted to get this out there as soon as possible but there
is very little in the way of custom shaders/extension of the rendering
modes available at this stage. It is on our list, but as you may have
seen the way rendering happens has changed quite extensively.

Thanks for taking a look, we will publish an update when there is more
API in this area.

Marcus
_______________________________________________
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 VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/vtkusers
Reply | Threaded
Open this post in threaded view
|

Re: How to add custom shaders in OpenGL2 backend

gpwright
FYI I encountered the issue described on this thread.  I addressed it by subclassing vtkOpenGLPolyDataMapper and overriding the BuildShader function to substitute in my own shader code.  Works fine...

Geoff
Reply | Threaded
Open this post in threaded view
|

Re: How to add custom shaders in OpenGL2 backend

eternallite2
This post was updated on .
Thank you, that sounds like a good idea for adding custom shaders.

Another question: I also want to do some sort of multi-pass rendering as well (if possible),
like rendering to a framebuffer object's textures and reuse them in a following shader...

do you have any hints for getting that working :) (I'm a beginner with FBOs so
some sample code would be great!)

- In the older versions of VTK they had render passes, which I could plug in code for every pass.
Is it easy to plug in our own passes in VTK 6.2 with the OpenGL2 backend? :)

Any sample code would be awesome, thanks!