Cache time offset based on selection

Rayfire has this great feature where you can play back a cache based on a gizmo (rayfirestudios.com/feature/animation-caching). I’ve found myself wanting to do this with PRTs several times. Any chance for this feature to make it into Krakatoa?

I am not sure how this would work. Do you mean that each particle would get its own time offset based on proximity? This would be awfully slow as you would have to potentially read from all PRT frames in the sequence. If Magma allowed time-offset operations, it might be a possibility, but doing it with 10 or 100 million points would be madness.

But I agree it is a cool idea.

Good point, but what about the ability to break things into clusters automatically? You’d only need 100-1000 clusters to get convincing offsets.

Basically what this could do is this: The retiming of PRT Loader is performed based on the closest frame, or the closest two frames if Interpolation is enabled. So if you have an animation of 1000 frames, there are only 1000 frames you can reference when retiming, all intermediate results would be interpolated anyway.

So in theory such an option would run through all particles on the current frame, measure their distance to the gizmo and figure out the exact time to interpolate. From that, the closest frame (or two frames) could be calculated and the particle can be flagged via a special channel that it belongs to one of the clusters. Then each frame that was requested via that channel has to be loaded once and all particles that have that number in their channel would have to interpolate their data, then the next frame would be loaded and so on. So in the worst case, you could end up with 1000 clusters out of a 1000 frames sequence, and up to 2000 file loads if using Interpolation. If the timing is clamped somehow, the number of actual clusters could be less.

But if each of these PRT files contains 100 million particles and takes a minute to load, then you are looking at 2000 minutes per frame… :open_mouth: So it might work well with 1K or 10K or even 100K particles and 100 frames, but Krakatoa wasn’t designed to care for these cases. I suspect that it could be done as part of Magma where the retiming channels are calculated on the stack per particle, and then the PRT Loader uses these channels to read the respective PRT frames for each particle.
But I have not promised we would do this, I am just speculating.

Yeah of course I understand no promises, but I’m glad you are speculating about how it could be done.

From time to time I’ve wondered if Magma could have some time functions for other purposes as well.

Thanks again for the reply and the thought put into it.