Download as pdf or txt
Download as pdf or txt
You are on page 1of 5

Essay - Fluids in Computer Graphics

Samuel Asp
October 2015

Introduction

Computers are truly amazing. The impact theyve had on our daily life since
their creation is astonishing and marks a great spot in our scientific advances.
However, they are still lacking in many areas, one of which is producing realistic
fluids such as water without a loss in performance. What needs to be done here,
at least until computers are able to handle these realistic fluids better, is an
adaptation.

Problem

One way of maintaining performance is to use the so-called Eulerian method,


which is based on a grid. The performance-level is high but its lacking in
quality, partially since its difficult to conserve the mass of the fluid components. Therefore this method is suitable for when realism and quality isnt as
important. This isnt good enough.
The preferred method instead would be that of SPH, or Smoothed Particle
Hydrodynamics. This creates fluids out of small particles, usually balls, which
interact with one another. The overall quality is much higher than that of
Eulerian, and since the particles remain the same, maintaining the mass is no
problem. It is, however, a lot more power-demanding and therefore expensive.
This method is the preferred way to go when it comes to quality, but what can
be done with it to maintain performance? This is what the researches attempted
to solve in this research, or at least improve upon.
The problem with SPH, as addressed earlier, is its performance. How can we
adapt this high-quality method of making digital fluids to run smooth and not
cause frame-rate issues? This improvement that is sought after is referred to as
accelerating the process.
The way that the researchers attempted to accelerate the process, is by
dividing them into three smaller problems and solve them one by one, these
three being:
GPU porting
Level-of-detail (LOD) technique
Time-step adjustment

Relevance

Then why is this relevant, what benefits can we obtain from improving digital
fluids? One may think that these researches only affect movies and video games.
And while it is true that it does affect them, it has other uses as well. SPH was
initially created as a tool for astrophysical researches.[1] Matthew R. Bate, a
professor at the University of Exter, used it to model condensed object such as
stars and brown dwarfs.[2]
2

Research Question

As stated before, the problems of which this research is based upon are the
performance issues. The question of which the researcher asks themselves is
Can we create a realistic, well-performing technique which allows us to improve
upon the already existing SPH-method?

Strategy and Methodology

As mentioned earlier, the researchers divided the one big problem into the three
small ones in order to accelerate the process of SPH. What this allowed them
was to work on each problem separately. The next few sections explain their
research methods.

5.1

GPU-porting

Previous attempts of SPH has assigned the CPU to do the neighborhood search,
and the GPU to do all the heavy physic calculations. What the researchers did,
was to use a method in which the entire SPH computation was made on the
GPU using CUDA. This allowed it to accelerate the SPH computations, and
optimize the neighborhood search by using a method referred to as Z-indexing
which labels each particle based on where they are located in the simulation.[3]

5.2

Level-of-Detail

Placing the algorithms on the GPU may achieve an increase to performance,


but the amount of particles can still be limited by it. Using only very small
particles is simple and will result in a realistic fluid, but the amount of unaffected
particles at the bottom or non-active areas causes it to drain unnecessary power.
The researchers attempted to vary the particle-count, using an LOD-technique.
What this means is that the particles change size and amount based on their
activity level.
To explain further: If you have a cube of water in motion, maybe because
of it being dropped from a height, then all of the particles wont make a huge
contribution to the visual presentation of said cube. The particles at the bottom
of the cube will have hardly any effect on the ones at the surface, and vice versa.
The particles at the bottom are in a so-called low-activity-area, where their levelof-detail can be lowered without to much of a difference. They are, however, not
inactive forever. A change in motion can cause the bottom particles to move
around a bit.
Should the fluid be run down a track where there are obstacles, that area
causes them to have a higher LOD, since they are interacting with said obstacles
and not just flowing freely.[4]

5.3

Time Step

In all simulations there are a number of updates that occur every second. Between each of these updates is a timer, referred to as a time step in this research,
that decides how long it takes until the following update. The easy way of dealing with these is to simply have the same time step in the entire simulation.
This can cause the program to run slow, since the less active areas of the fluid
still update as much as the highly active ones. Thus RTS, or Regional Time
Stepping, is introduced.
What RTS does is that it determines the areas of the fluid in which the
activity is high, low etc. The less-active areas receive a higher time step, and
the active ones a lower.[5]

Results

The GPU-porting results were very positive. Their solution resulted in high
frame rates and high quality-images. They were able to reach a steady frame
rate and excellent quality, while using a quarter of a million particles.[3]
The LOD-technique yielded positive results as well. Their technique doesnt
suffer from the adaptive particles, which could have caused problems with density, splitting, stability and boundary, and also is rather simple to implement
due to non-complex functionality.[4]
Finally, the time step results were also positive. The researchers simulations
were twice as fast as the compared method, even in situations where globally
adaptive time-stepping cannot achieve benefit.[5]

Conclusion

The conclusion to be drawn here is that the researchers succeeded with their
goal. Each of their improvements over the usual solutions yielded a better
result and made the simulation not only smoother, but also faster and less
power-consuming.

References
[1] Wikipedia. Smoothed particle hydrodynamics. (2015, July 17). Retrieved
from
https://en.wikipedia.org/wiki/Smoothed-particle hydrodynamics
[2] Bate, Matthew R. Star Formation with Radiative Transfer. Retrieved from
http://www.astro.ex.ac.uk/people/mbate/Cluster/clusterRT.html
[3] Goswani, Prashant. Schlegel, Philipp. Solenthaler, Barbara.
Pajarola, Renato. Interactive SPH Simulation and Rendering on the GPU.
(2010). Retrieved from
http://www.bth.se/people/prg.nsf/pages/publications
[4] Goswani, Prashant. Pajarola, Renato. Time Adaptive Approximate SPH.
(2011). Retrieved from
http://www.bth.se/people/prg.nsf/pages/publications
[5] Goswanie, Prashant. Batty, Christopher. Regional Time Stepping for SPH.
(2014). Retrieved from
http://www.bth.se/people/prg.nsf/pages/publications

You might also like