• OctoMY API
  • OctoMY API Reference
  • C++ Classes
  • OctoMY
  • SceneWorkerWidget
  • construct::rendering::SceneWorkerWidget Class

    The scene viewport that renders on a worker thread and only presents the frames. More...

    Header: #include <SceneWorkerWidget>
    Inherits: rhi::RhiPresentWidget and IViewportSurface

    Detailed Description

    SceneWorkerWidget hosts a ConstructViewportProducer on a rhi::WorkerHost, which is a dedicated worker QRhi and thread. The SDF megashader compile and the render run there, and this widget presents the finished frames. A frozen worker does not freeze the user interface.

    The widget draws from data, never from the live model. setSceneSnapshot() gives it a whole ConstructSnapshot after a structural edit, and applySceneDelta() gives it a construct::rendering::WorkerSceneDelta after a parameter edit. A construct::rendering::ViewportFeed decides which of the two to send.

    ConstructShell creates one as the scene viewport, and SDFPreviewWidget creates one for the definition preview. Each is a child of the widget that creates it. It is the default viewport; SceneWidget stays as the fallback for a device that cannot render on a worker.

    See also construct::rendering::ViewportFeed and SceneWidget.