[vtkusers] shadows on textured surface

Aashish Chaudhary aashish.chaudhary at kitware.com
Mon Mar 7 08:54:49 EST 2011


Sounds like a bug to me. Can you try setting the blending mode of the
texture to

*VTK_TEXTURE_BLENDING_MODE_MODULATE*
*
*
***Thanks, *
*
*
On Mon, Mar 7, 2011 at 7:35 AM, Zsolt V <vtkzsolt at gmail.com> wrote:

> 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
>
>
> _______________________________________________
> 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://www.vtk.org/mailman/listinfo/vtkusers
>
>


-- 
| Aashish Chaudhary
| R&D Engineer
| Kitware Inc.
| www.kitware.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20110307/b676d015/attachment.htm>


More information about the vtkusers mailing list