gs.renderers.RayTracer#

A path-tracing renderer backed by LuisaRender, for photorealistic stills with global illumination, reflections, and refractions. Enable it with gs.Scene(renderer=gs.renderers.RayTracer(...)). Per-camera ray-tracing settings such as spp (samples per pixel), denoise, model ("pinhole" or "thinlens"), aperture, and focus_dist are passed to scene.add_camera(), not to the renderer.

Photorealistic output depends on entity surfaces (metal, glass, plastic, emission) and on scene lighting. For setup and a worked example, see Rendering.

Warning

This backend is deprecated in favor of Nyx and must be built from source (the LuisaRender extra). Prefer Nyx for new work.

Options#

class genesis.options.renderers.RayTracer(*, device_index: int | None = None, logging_level: typing.Literal['debug', 'info', 'warning'] = 'warning', state_limit: int = 33554432, tracing_depth: int = 32, rr_depth: int = 0, rr_threshold: float = 0.95, env_surface: genesis.options.surfaces.Surface | None = None, env_radius: float = 1000.0, env_pos: tuple[float, float, float] = (0.0, 0.0, 0.0), env_euler: tuple[float, float, float] | None = None, env_quat: tuple[float, float, float, float] | None = None, lights: genesis.datatypes.List[genesis.options.renderers.SphereLight] = ─────── <gs.List> of <gs.renderers.SphereLight> ──────── <gs.List>(len=1, [     <gs.renderers.SphereLight>, ]), normal_diff_clamp: float = 180.0) None[source]#

RayTracer renderer.

Note

We use a environmental sphere wrapped around the scene to render the environment map (i.e. skybox).

Parameters:
  • device_index (int, optional) – Device ID used for the raytracer. None for Genesis’ device. Defaults to None.

  • logging_level (str, optional) – Logging level. Should be one of “debug”, “info”, “warning”. Defaults to “warning”.

  • state_limit (int, optional) – State limit for raytracer integrator. Defaults to 2 ** 25.

  • tracing_depth (int, optional) – Tracing depth. Defaults to 32.

  • rr_depth (int, optional) – Russian Roulette depth. Defaults to 0.

  • rr_threshold (float, optional) – Russian Roulette threshold. Defaults to 0.95.

  • env_surface (Surface | None, optional) – Environment surface. Defaults to None.

  • env_radius (float, optional) – Environment radius. Defaults to 1000.0.

  • env_pos (tuple of float, optional) – Environment position. Defaults to (0.0, 0.0, 0.0).

  • env_euler (tuple of float, optional) – Environment Euler angles in degrees. Shortcut for env_quat. Defaults to (0.0, 0.0, 0.0).

  • env_quat (tuple of float | None, optional) – Environment quaternion. Defaults to None.

  • lights (list of SphereLight, optional) – List of sphere lights.

  • normal_diff_clamp (float, optional) – Lower bound for direct face normal vs vertex normal for face normal interpolation. Range is [0, 180]. Defaults to 180.

The underlying genesis.vis.raytracer.Raytracer implementation is importable only when the optional ray-tracing extra is installed, so it is not auto-documented here.

See also#