Graphics Reference
In-Depth Information
the surface of the object, which can also be viewed as a density field. We can
use analytical functions for primitives like spheres to approximate the shape of
the objects. This avoids rasterizing volumes or voxelizing meshes on the GPU.
Alternatively, one could approximate shapes using Metaballs [Blinn 82] and im-
plicit surfaces that naturally provide a distance field. No matter which approach
we choose, the gradient of these distance fields ρ Obstacle can be computed ana-
lytically or numerically and plugged into the velocity update formula covered in
Section 4.5.
When looking at the Shallow Water Equations (SWE), we find similarities
with the equations outlined in this chapter. In fact, by looking at the density field
as the height field of a liquid surface, we can imagine using our method directly
for height field simulations shown in Figure 4.4. On the other hand, there is
usually a ground height term in the SWE. This in turn can be interpreted in 3D
as a distance field for rigid objects as we mentioned above.
4.8 Examples
We show a few simulation examples implemented with HLSL, compiled as level
4 shaders. They include a 3D liquid with rigid objects in the domain, a 2D
shallow water height field simulation, and a 2D simulation comparing with the
optimized Direct Compute implementation of SPH available in the DirectX 11
SDK. Measures include both simulation and rendering. We splat particles with
a radius of 3 cells on 16-bit floating point textures without any significant loss in
visual quality. In general we used a grid size close to d N P texels per axis, where
d is the domain dimension (2 or 3) and N P is the total number of particles.
In Figure 4.3, we rendered the fluid surface by raycasting the density directly.
We perform a fixed number of steps and finish with an FXAA antialiasing pass
(framebuffer size 1024
×
768). We used 125k particles on a 96 3 texture and the
Figure 4.3. A 3D liquid simulation with obstacles in the domain implemented using the rasterization
pipeline. The simulation runs at 35 FPS using 125k particles on a Quadro 2000M graphics card.
Search WWH ::




Custom Search