
2. Interactive Sparse Eulerian Fluid 285
Inject
Advect
Pressure
Vorticity
Evolve*
Clear tiles Fill list
Figure 2.6. A chronological flow diagram showing the various stages of sparse simula-
tion. Note the addition of new stages in blue—compare to Figure 2.1.
Texture3D<uint> g_BrickMapRO : register ( t0 );
AppendStructredBuffer<uint4> g_ListRW : register ( u0 );
[ numthreads (8 , 4 , 4) ]
void main ( uint3 idx : SV_DispatchThreadID )
{
if( g_BrickMapRO [ idx ]!=0)
{
g_ListRW . Append( idx );
}
}
Listing 2.6. A compute shader to create a linear list of bricks to be included in the
sparse simulation domain.
simulation steps, inject, advect, pressure, and vorticity—whic ...