Light source questions

I would like to set a light source on a location on a terrain (PolyData). a) If I wanted the light to be like a lightbulb, which type of light would I use (and what settings?)? I do not want any other source of light. b) Is it possible for the shadows just to be single value (say 1.0 if shadow 0 if not)? If this makes sense?

Try vtkLight::SetTypeToPositional which will attach a light to a point in space rather than being relative to the camera. vtkLight::SetPosition will put the light where you want it. vtkLIghtSetFocalPoint will tell the light what to point at, but vtkLight::SetConeAngle set to anything >= 90 will make it ignore FocalPoint and act like a light bulb rather than a flashlight.

I believe that VTK only supports “hard shadows” with the exception to that rule being through OSPRay and OptiX where you can ask or “soft shadows” (and the penumbra effect that you do not want) by giving lights area to change them from point to area light sources.

ParaView’s Light Inspector panel more or less just provides a GUI for vtkLight(s), so it might be worth your while trying things out quickly there to see what you can get out of VTK.

Thanks that was helpful!

1 Like