[vtkusers] shadows on textured surface

Aashish Chaudhary aashish.chaudhary at kitware.com
Tue Mar 8 16:12:46 EST 2011


Hi Zsolt,

I was able to reproduce the bug (not exactly what you are getting). I have
worked on shadows before but not in VTK. I will see if I can fix this
sometime soon (or if you do please submit your code in gerrit or via patch,
first would be preferred though).

I am going to submit a bug report for this.

Thanks,


On Mon, Mar 7, 2011 at 3:20 PM, Zsolt V <vtkzsolt at gmail.com> wrote:

> Thanks for the response.
> Yes, I tried *VTK_TEXTURE_BLENDING_MODE_MODULATE, and I've got the same*result.
> (I tried all other blending modes as well, without success.)
>
> Zsolt
>
> 2011/3/7 Aashish Chaudhary <aashish.chaudhary at kitware.com>
>
> 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
>>
>
>


-- 
| 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/20110308/f9df684d/attachment.htm>


More information about the vtkusers mailing list