Is there a way to use the glslPOP to grab slices of the cache? E.g. like a cache select, but via the shader so I could sample multiple slices in a single frame (similar to sampling a texture 3d in TOP world) with a syntax along the lines of cache_slice_sample = iP[cache slice][id]
Hi Lake, not at the moment, I would suggest using a replicator with cache select and pattern matching to avoid a lot of wires, not the most elegant but hopefully works for you, repurposed an older example, see attached.
CacheSelectGLSLPOP.toe (6.1 KB)
Otherwise nothing guarantees multiple cached frames have the same attributes or that the attributes have the same type, so might not be so straightforward to add in the generic case, we’ll discuss internally.
okay thank you for the color. Makes sense that multiple cached frames might be able to have different attributes or different types - fwiw, given the choice I would rather be able to try and get an error if there is an attr or type mismatch, putting the responsibility on me to ensure consistent data
will give the replicator setup a go, I do think that will work, was just trying to find something more aesthetic haha
thanks vincent
Thanks for the feedback, yeah not long after posting the reply I was also thinking we could error in case of mismatch, (also just realized it’s the same issue with the cache blend POP, will double check what we did there), will keep that in mind!
Hi Lake,
So we added cache access in GLSL in latest alpha 6 2023.32374
We also tweaked things so input is an argument instead of hardcoded which makes it easier to loop over inputs. With the added requirement that attribute types must match between inputs.
Updated toe with updated version of old method with cache select for reference, no more scripting needed to loop, and new method not needing all the cache selects
CacheSelectGLSLPOP.1.toe (5.9 KB)
I haven’t heavily tested, and just noticing a small discrepancy between the two versions which I will investigate, also thinking we could add a constant available in the shader with the number of cached frames available, but let us know if this mostly works out as expected and makes sense.
So taking a closer look the indexing is currently a little unintuitive, index -n on cache select is numCachedFrame - n in GLSL, see attached toe.
(also just noticed I uploaded the wrong toe above with the TDInCache_P() sample above in any case)
GLSLPOPCacheAccess.toe (6.0 KB)