Adding Light to the volume I am rendering

I was able to get my volume rendered and it looks very nice but I would like to add a light from like an angle so the shadows will give the user a better view of the volume. I saw that I can use vtkLight, is there any example on how to use it. Or is there a different way to create what I want. My issue is that this is a vti object so I want to make sure that after irrelevant values (opacity set to 0) are taken out, what is still visible can still have shadows.

Try starting here:

You might also want to try VTK’s OSPRay interface.

As far as I know GL rendered volumes in VTK can not cast or receive volumes. However OSPRay rendered volumes in VTK can cast them and in master with OSPRay 2 at least they can also receive them with either path tracing or ray casting and vtkVolumeProperty::ShadeOn().

Apologies, I see now that this is in the Web area. OSPRay is not applicable in the vtk-js space.

I will check it out

Well in volume property there is a way to set shade to 1. However, I couldn’t see a change in my volume after I changed it but thank you!