[vtkusers] CG Shading in VTK

Darshan Pai darshanpai at gmail.com
Tue Mar 16 19:57:25 EDT 2010


I have been playing around with CG shading in VTK . Basically I tried to
shade a vtkCubeSource and provide an xml file with the Material Information.
So I grab the vtkProperty of the actor and Load the material using the
LoadMaterial() function.

I tried the fragment.cg program which will add diffuse ambient and specular
color to the cubesource .
My problem is with the VTk interactor style being used .

When I have the setting to TrackballCamera, the CG shading works as
expected, with the camera and light moving in unison.
But if i switch to TrackballActor, it seems that the light source and the
actor both are moving which seems odd .

Is that how the CG shader is supposed to work ?

Regards
DArshan
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20100316/bc423ae6/attachment.htm>


More information about the vtkusers mailing list