Make embergen sparse

Houdini now has a sparse pyro solver. Simulation would be a lot more efficient by only simulateing areas around the volume.

We’re aware of this and it’s in our plans, though it’s not simple due to doing all of this on the GPU.

Hi. I’m not their developer but I have some experience with the topic so I thought I’ll thow in some thoughts that may help understanding why this isn’t there already. Depending on the implementation, this is not practical or even not possible due to how gpu simulation works.It may even slow down the simulation instead of speeding up, because of the processing needed.This is why you can’t operate on vdb straight. It operates on textures (all pixels) and not individual values one by one. This is what makes it possible to run in real-time, and this is what the gpu prefers in general. However, it is possible to skip pixels that are not needed to be processed. This would not make the data sparse, but it could speed up the simulation somewhat. But I’m pretty sure this is already added where it can be.

VDB and Houdini is optimized to work and operate well on the cpu. Since cpu can’t operate on all values at once, having sparse data is a cool idea, because yes, you can skip large areas that doesn’t need to be processes shortening the overall time needed. Gpus work differently. They have much more threads than cpus, so the workload can be split down to them and making it able to process all values at once. When a process can be made to work in a highly or fully parallel way, is called SIMD (single instruction multiple data). Cpus can’t really do SIMD or on a minimal level if you have many cores/thread, while gpus work the best when SIMD can be applied. One way to make operations SIMD on the gpu is to use textures. This makes it possible to execute an operation on all values at once. In practice, say multiplying 2 textures (even if they are very large and has millions of pixels) is only 1 instruction. Since textures can’t be sparse, the data can’t be sparse either. Using different data structure (not textures) would break SIMD and make the whole thing much slower.