how Nvidia does the balls collision detection in Flex without using a 3D grid?

Started by
9 comments, last by Syntac_ 8 years, 4 months ago

at 7:15 in this video

He says it's grid free, you can download the demo to play with the balls and in some worlds you can move the balls anywhere you want, no walls

Advertisement
Spatial hashing?
Instead of storing a full grid of cells (whether or not they are empty), they store a flat representation of just the active cells.

Because fluid simulations need to constantly update neighbouring cells, the grid representation is a lot easier/faster to update, but you are constrained by the maximum size of grid (i.e. 3D texture) that you can store on your GPU, and if the majority of cells are empty, then you are just plain wasting memory.

The secret sauce is how they update potentially millions of neighbour interactions efficiently on a GPU with a sparse representation - that's traditionally been a prohibitively difficult thing to accomplish.

Tristam MacDonald. Ex-BigTech Software Engineer. Future farmer. [https://trist.am]

Or it could be a FLIP solver.

Volume Tiled Resources. Same as in this demo:

Here's a slideshow: http://developer.download.nvidia.com/assets/events/GDC15/Dunn_Alex_SparseFluidSimulation.pdf

Volume Tiled Resources. Same as in this demo

Well that's a whole lot less exciting than I was imagining.

Looks like it boils down to in-driver support for sparse virtual textures?

Tristam MacDonald. Ex-BigTech Software Engineer. Future farmer. [https://trist.am]

Looks like it boils down to in-driver support for sparse virtual textures?

Or the memory controller hardware: 64bit address space, several different choices in page size, ability to gracefully handle page-not-mapped HW exceptions, ability for texture samplers to return a page-miss boolean, etc, which allows drivers to implement "tiled resources", which allows games to implement HW-accelerated SVT :)

Allocating/deallocating virtual pages is a CPU side operation though. So if your GPU particleshaders created a list of voxels that must be resident, you've got to wait a frame for the CPU to read back that list and actualy map the appropriate tiles... This is still a complex system to construct!


This is still a complex system to construct!

Yeah. Looks like the only piece of it that is truly new is the ability to sample out of bounds and get a zero value?

Everything else it seems you could emulate (albeit probably not with sufficient performance) with SVT and mixing texture dimensions.

Tristam MacDonald. Ex-BigTech Software Engineer. Future farmer. [https://trist.am]

Isn't SVT still logically a grid? It's just that empty parts aren't resident. I'd still consider that a grid though.
Yeah, it's not a grid, it's a sparse grid tongue.png

This topic is closed to new replies.

Advertisement