director
director copied to clipboard
Differences between camera and lighting parameters in libbot drake_viewer
This issue documents differences in camera and lighting parameters from the libbot drake_viewer.
The libbot viewer defaults to a wide view angle. The code says 60 degrees. The view angle in Director is adjustable from the GUI. It defaults to 35. In the following screenshot I have applied a wide angle to match the libbot viewer:
In my opinion the wide angle is distorted, but perhaps I'm just used to the 35 degree view angle.
Lighting: the director uses VTK's lighting kit composed of key, head, and back lights. The director also uses VTK's default material properties for all objects in the scene. The light kit follows the camera. The libbot viewer has a single fixed position light, with parameters that make it relatively bright compared to the director. I think the object colors in Drake have been selected for viewing in the libbot viewer, so they look darker in the director. I think the VTK lighting kit does a fairly good job preserving colors, and the colors in libbot viewer are distored in comparison. However, many Drake scenes are composed of boxes, and the large flat faces of the boxes do look a little strange, in terms of shading, with a moving light kit. This is especially apparent on the large ground plane. The light kit is definitely designed to perform best for mesh models with more curvature. For more information about VTK's lighting kit, see the paper:
http://www.spl.harvard.edu/archive/spl-pre2007/pages/ppl/halazar/pubs/lightkit_vis03_preprint.pdf
The director GUI provides a single intensity parameter that can be used to brighten the scene, but many more lighting and materials are adjustable from the Python console.
The libbot viewer uses a fixed position light. The lighting kit in the director follows the camera. To change the behavior whether lights follow the camera in the Drake Visualizer (director) open the Python consle (F8) and enter:
view.renderer().SetLightFollowCamera(False) # defaults True
The default light position and direction in Drake Visualizer do not match the libbot drake_viewer. We should probably set the default camera to match drake_viewer so that scenes default views match a little better.
The GL clipping range behavior is different in drake visualizer. Because the world model is a giant flat box, it interferes with the clipping resolution and causes objects to clip close up. Hiding the ground object (right click --> hide) will improve the situation, but currently this behavior is not so great.