← All ideas
  • Published 3 Feb 2024

Taichi for Physics Simulation

I am aware of blender.community/c/rightclickselect/c1gbbc/ which pitches Taichi for the purposes of custom simulation scripts

What I propose here is a more central usage of Taichi in Blender.

Taichi is a developer friendly way to GPU accelerate physics simulations by decoupling the logic of the physics simulation from the specific data structure and memory layout so that one can play around with different data structures or layouts without having to rewrite the simulation loop. For grid based simulations, one can make use of sparse grids, while only having to program the simulation loop as if the grid was dense due to the compiler doing the heavy lifting of optimizing the memory accesses. MeshTaichi offers similar memory access compiler optimizations for simulation loops over meshes.

While Taichi kernels are in Python, the host code does not need to be Python. The following are resources on using C++ as the host language, which would mean less intrusive integration into the existing Blender code base.

docs.taichi-lang.org/docs/tutorial

docs.taichi-lang.org/docs/taichi_core

Using C++ host code is also useful to get better control over memory allocation for the simulation data structures.

Resource on Vulkan integration docs.taichi-lang.org/docs/taichi_vulkan

91.7%

Development Status: Open

Upvote 11 Downvote 1
paleos
3 Feb 2024

1 Comment

softyoda

I think GPU solution should be made possible for physic solver, but not only. I really think the geometry node module should be starting on porting most field / nodes in GPU !