RenderKit / ospray

An Open, Scalable, Portable, Ray Tracing Based Rendering Engine for High-Fidelity Visualization
http://ospray.org
Apache License 2.0
1k stars 182 forks source link

Question on ospWait and canceling #366

Closed paulmelis closed 4 years ago

paulmelis commented 4 years ago

To start an render task, use

OSPFuture ospRenderFrame(OSPFrameBuffer, OSPRenderer, OSPCamera, OSPWorld);

This returns an OSPFuture handle, which can be used to synchronize with the application, cancel, or query for progress of the running task

I don't currently see a dedicated cancel call, but does an ospWait() on say OSP_WORLD_RENDERED stop the frame rendering at that point? Or does the render continue? In my case I'm mostly interested in stopping the rendering at the earliest possible moment without needing the results. I assume the event order is OSP_WORLD_RENDERED, OSP_FRAME_FINISHED, OSP_TASK_FINISHED.

jeffamstutz commented 4 years ago

That appears to be a gap in our documentation. There’s an ospCancel(OSPFuture) used to cancel frames directly.

We will update the docs accordingly, thanks!

jeffamstutz commented 4 years ago

Also, FYI: ospWait(OSPFuture, OSPSyncEvent) is for the calling application to block until the passed in event type has completed (such as waiting for the frame to be done, either before/after denoising), it does not change execution of the running task.