NpOptiX - base, headless raytracer

class plotoptix.NpOptiX(src: Union[str, dict, None] = None, on_initialization=None, on_scene_compute=None, on_rt_completed=None, on_launch_finished=None, on_rt_accum_done=None, width: int = -1, height: int = -1, start_now: bool = False, log_level: Union[int, str] = 30)[source]

No-UI raytracer, output to numpy array only.

Base, headless interface to the RnD.SharpOptiX raytracing engine. Provides infrastructure for running the raytracing and compute threads and exposes their callbacks to the user. Outputs raytraced image to numpy array.

In derived UI classes, implement in overriden methods:

Parameters
  • src (string or dict, optional) – Scene description, file name or dictionary. Empty scene is prepared if the default None value is used.

  • on_initialization (callable or list, optional) – Callable or list of callables to execute upon starting the raytracing thread. These callbacks are executed on the main thread.

  • on_scene_compute (callable or list, optional) – Callable or list of callables to execute upon starting the new frame. Callbacks are executed in a thread parallel to the raytracing.

  • on_rt_completed (callable or list, optional) – Callable or list of callables to execute when the frame raytracing is completed (execution may be paused with pause_compute() method). Callbacks are executed in a thread parallel to the raytracing.

  • on_launch_finished (callable or list, optional) – Callable or list of callables to execute when the frame raytracing is completed. These callbacks are executed on the raytracing thread.

  • on_rt_accum_done (callable or list, optional) – Callable or list of callables to execute when the last accumulation frame is finished. These callbacks are executed on the raytracing thread.

  • width (int, optional) – Pixel width of the raytracing output. Default value is 16.

  • height (int, optional) – Pixel height of the raytracing output. Default value is 16.

  • start_now (bool, optional) – Start raytracing thread immediately. If set to False, then user should call start() method. Default is False.

  • log_level (int or string, optional) – Log output level. Default is WARN.