-
Notifications
You must be signed in to change notification settings - Fork 92
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cancel build +progress monitor #67
Comments
It should be possible to implement it, and by the way feel free to submit a PR for review. The issue though is that this requires some sort of knowledge of the build algorithm, in the sense that the notion of "progress" is really not going to be super accurate (it's -- for the most part -- a recursive process and you may not know the cost of building the subtree until you actually do it). That said, a reasonable assumption that the cost of a subtree of size N is somewhat proportional to So all in all it's a pretty complicated implementation for a small feature that, although nice to have, is not strictly necessary. I'll keep that in mind when doing further development work on the library though, if I can find the time for it. |
Thanks for the response! Personally I'd be more interested in the ability to cancel anyway, the progress callback would just be nice-to-have. I haven't looked too closely at the source code for bvh, but I'll try and see if I can whip up a PR for that in the near future. |
For this specific use case, I don't think you need the ability to cancel the build per se. I would imagine that through OS services you can send a kill signal to the process that builds the BVH, without having to wait for the threads to join. If you want to kill your own process on Linux, use |
If you don't want to kill the current process but want to continue executing the program, you could use a subprocess to build the BVH as a work around. This would allow you to kill it before it terminates. The downside is that you'll have to communicate via files or pipes. The serialization API allows you to do that, by sending a stream of bytes over, instead of writing to a file on disk. |
Embree has a progress monitor for build operations, that also allows you to cancel the build operation:
https://github.com/embree/embree/blob/master/README.md#description-description-21
It would be great to have something like this for this library as well. The ability to cancel in particular can be very handy for large scenes where building the bvh can take a very long time.
The text was updated successfully, but these errors were encountered: