Custom shaders

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

Custom shaders

graphicsmonkey
Hi VTK experts,

Trying to get my head around converting some old OpenGL shaders to work with
VTK and i'm confused as to where certain values come from in some of the
examples ( E.g. Rendering/OpenGL2/Testing/Cxx/TestUserShader.cxx )

The test shader makes use of variables like normalMC, normatMatrix Etc. but
i cannot see where they are defined? If there a list of these variables
somewhere.

For example;

        attribute vec3 normalMC
        uniform mat3 normalMatrix
        varying vec3 normalVCVSOutput

Many thanks!




--
Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html
_______________________________________________
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

Search the list archives at: http://markmail.org/search/?q=vtkusers

Follow this link to subscribe/unsubscribe:
https://vtk.org/mailman/listinfo/vtkusers
Reply | Threaded
Open this post in threaded view
|

Re: Custom shaders

graphicsmonkey
Okay so looking through the Vtk code a bit i see that that shaders are
generated via the vtkShaderProgram::Substitute command. Is there some
documentation for this or do we have to go through the source code to work
out what's going on?




--
Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html
_______________________________________________
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

Search the list archives at: http://markmail.org/search/?q=vtkusers

Follow this link to subscribe/unsubscribe:
https://vtk.org/mailman/listinfo/vtkusers
Reply | Threaded
Open this post in threaded view
|

Re: Custom shaders

Bill Lorensen
Would you mind posting your question to https://discourse.vtk.org?
Community support for VTK has transitioned to that forum, and you are
more likely to get an answer there.

That said, the variables defined depend on which shader you are starting with.

For example, if you are overriding btkOpelGLPolyDataMapper then search
the source for SetUniform.

Also, the VTKExampleProject has a number of custom shaders...

https://lorensen.github.io/VTKExamples/site/Cxx/Shaders/BozoShader/
https://lorensen.github.io/VTKExamples/site/Cxx/Shaders/ColorByNormal
https://lorensen.github.io/VTKExamples/site/Cxx/Shaders/CubeMap
https://lorensen.github.io/VTKExamples/site/Cxx/Shaders/MarbleShader/
https://lorensen.github.io/VTKExamples/site/Cxx/Shaders/SpatterShader
https://lorensen.github.io/VTKExamples/site/Cxx/Shaders/SphereMap

On Mon, Apr 15, 2019 at 6:38 PM graphicsmonkey <[hidden email]> wrote:

>
> Okay so looking through the Vtk code a bit i see that that shaders are
> generated via the vtkShaderProgram::Substitute command. Is there some
> documentation for this or do we have to go through the source code to work
> out what's going on?
>
>
>
>
> --
> Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html
> _______________________________________________
> 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
>
> Search the list archives at: http://markmail.org/search/?q=vtkusers
>
> Follow this link to subscribe/unsubscribe:
> https://vtk.org/mailman/listinfo/vtkusers



--
Unpaid intern in BillsParadise at noware dot 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

Search the list archives at: http://markmail.org/search/?q=vtkusers

Follow this link to subscribe/unsubscribe:
https://vtk.org/mailman/listinfo/vtkusers
Reply | Threaded
Open this post in threaded view
|

Re: Custom shaders

graphicsmonkey
Okay thank you Bill



--
Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html
_______________________________________________
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

Search the list archives at: http://markmail.org/search/?q=vtkusers

Follow this link to subscribe/unsubscribe:
https://vtk.org/mailman/listinfo/vtkusers