RenderKit / ospray

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

API deficiency: future is lacking completion callback #457

Open target-san opened 4 years ago

target-san commented 4 years ago

Rendering future can be waited, its state can be checked. Although there's no way to report when it completes. As a result, event-driven applications are forced to either move rendering to separate thread (nullifying any usefulness of out-of-the-box async rendering) or repeatedly checking future state in loop. Would it be possible to add ospRenderFrame variant which accepts completion callback? Or some API which adds such completion callback to already created future?

johguenther commented 3 years ago

Before the OSPFuture we indeed had a "progress-and-cancel" callback. There are some upcoming chances to the futures in the mid-term, we'll consider your input.

stukowski commented 3 years ago

I can confirm that, as a developer of a desktop application integrating OSPRay, I was facing the some problem. I unfortunately had to work around this limitation by repeatedly polling the future every 20 milliseconds or so to detect the completion of the rendering process. I agree that a callback mechanism would be very useful to have.