The design evolved this way because in many situations the image constantly changing (animation is a function of time) and the ray tracer is the performance bottleneck. In these cases the ray tracing loop determines the application's refresh rate--and the GUI operates asynchronously. GUI event loops vary in frequency between about 5-40hz framed rendering attached to those loops tends to be very non-uniform in time. Another reason, which only applies to very large machines, is that there is overhead associated with starting up a large number of threads--or switching from one memory intensive program to another. If your application is offline (like rendering movies), the data set isn't time varying, or the ray tracer isn't the performance bottleneck, it might make sense to start and stop the entire renderer. It's also possible to cause the ray tracing threads to block on a semaphore and synchronize ray tracing with a control loop operating at a different frequency. I'd recommend the second approach in this case- it doesn't require modifying the image traverser, or any of the manta internals-- just create a serial animation callback that synchronizes with the outside thread each frame. (There are primitives for doing so in Core/Thread/.) State updates sent to Manta while it is idle will be committed before the next frame is rendered- but all of the threads will be completely idle. Manta rendering could either proceed in lock step (using barriers) or semaphores could be used to signal that the renderer should pause or resume. The third approach would be to embed the VTK update procedure inside the Manta control loop using parallel animation callbacks. I haven't worked with VTK in about five years so I don't know how great a task this would be. If the VTK update is serial, or if there is a simple interface to embed it in multiple threads, it would be easy. Abe On Jun 10, 2008, at 2:04 PM, Solomon Boulos wrote:
|
Archive powered by MHonArc 2.6.16.