Visualizer#

The orchestrator behind scene.visualizer, created automatically with every scene. It owns the interactive viewer, the camera sensors, and the renderer backend, and it refreshes them when you call scene.visualizer.update(). You rarely construct or call it directly: add cameras with scene.add_camera(...), open the viewer with show_viewer=True, and drive both by stepping the scene and calling update() each step.

scene = gs.Scene(show_viewer=True)
scene.add_entity(gs.morphs.Plane())
scene.build()

for _ in range(1000):
    scene.step()
    scene.visualizer.update()  # refresh viewer and camera sensors

API reference#

class genesis.vis.Visualizer(scene, show_viewer, vis_options, viewer_options, renderer_options)[source]#

Bases: RBC

This abstraction layer manages viewer and renderers.

destroy()[source]#
add_camera(res, pos, lookat, up, model, fov, aperture, focus_dist, GUI, spp, denoise, near, far, env_idx, debug)[source]#
add_mesh_light(mesh, color, intensity, pos, quat, revert_dir, double_sided, cutoff)[source]#
add_light(pos, dir, color, intensity, directional, castshadow, cutoff, attenuation)[source]#
reset()[source]#
build()[source]#
update(force=True, auto=None)[source]#
update_visual_states(force_render: bool = False)[source]#

Update all visualization-only variables here.

colorize_seg_idxc_arr(seg_idxc_arr)[source]#
property is_built: bool#
property viewer#
property rasterizer#
property is_software#
property batch_renderer#
property context#
property raytracer#
property renderer#
property scene#
property has_display#
property cameras#
property segmentation_idx_dict#

See also#

  • Viewer: the interactive window

  • Camera: camera sensors for off-screen rendering

  • Renderers: renderer backends