[vtkusers] shadows on textured surface

Zsolt V vtkzsolt at gmail.com
Mon Mar 7 07:35:09 EST 2011


Hi,

I am trying to cast shadows on textured surfaces. I use VTK 5.6 and the test
code found in the package: TestShadowMapPass.cxx.
The original program works well, the shadows of the objects appear on the
surface. However, when I add texture to the rectangle, shadows disappear.
I added the following lines to the original code:

vtkSmartPointer<vtkImageReader2> floorReader =
vtkSmartPointer<vtkPNGReader>::New();
vtkSmartPointer<vtkTexture> floorTexture;
floorReader->SetFileName(TEXTUREFILE);
floorTexture = vtkSmartPointer<vtkTexture>::New();
floorTexture->InterpolateOn();
floorTexture->RepeatOn();
floorTexture->SetInput(floorReader->GetOutput());
rectangleActor->SetTexture(floorTexture);
rectangleActor->GetProperty()->SetDiffuseColor(0.75, 0.75, 0.75);

What is the correct way to visualize both textures and shadows in VTK?
Thanks for your help in advance.

Best regards,
Zsolt
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20110307/ec7e6ff0/attachment.htm>


More information about the vtkusers mailing list