\chapter{Introduction}\label{ch1}
Currently around the world helicopter pilots are finding it very difficult to land in desert environments.
Such environments contain vast amounts of loose sand due to the lack of vegetation.
This loose sand is easily affected by winds, generated by a helicopter.
Just as the desert environment is affected by a helicopter, so too is the helicopter affected by the desert terrain.
These effects that helicopters experience include engine clog, very low visibility, and unstable flying conditions.
Many helicopter crashes and deaths have been attributed to these effects that are caused by helicopters producing large amounts of wind and in turn creating dangerous dust levels.
This thesis presents Sandstorm, a particle system that was designed to create such atmospheric phenomena as mentioned above.
Sandstorm will be used in both scientific simulations and military training applications that will give both scientists and pilots a better understanding of what happens in such cases.

In the realm of virtual reality it is quite common for an application to implement a particle system to heighten the quality of immersion or to display scientific data.
This is the case in fluid dynamic applications, dust simulations, military training simulations, and fire simulation applications.
Nonetheless, whatever application the particle system is used in, it needs to look realistic or at least behave realistically.
Vector fields can be used to `guide' particles according to real scientific data, while also adding to realism.
The idea of using vector fields to guide the motion of particles and other objects is not new, and has been discussed in~\cite{vectorfields}.
In ~\cite{vectorfields}, the authors propose that vector fields be used to manipulate particle systems and a class of soft objects.

Virtual reality applications and simulations require a multiple contextual environment in which to run ~\cite{kreylos07:vrui}, ~\cite{sherman:freevr}. 
A main context, which is in charge of updating simulations and communication, controls several rendering contexts.
Each of these rendering contexts are responsible for rendering to one of the screens of a virtual reality environment.
The rendering contexts will run independent of each other, and communication between them is usually only done when they are ready to draw.
This design requirement can cause problems when using context sensitive data and algorithms, such as particle systems.
Therefore, special consideration has to be taken into account when dealing with particle systems in a multi-contextual environment.
One such consideration is that most particle systems use random numbers to seed a particular particle's initial speed and direction.
Since a copy of the particle system will be run per-context, we need to make sure that each context gets the same random number every time one is needed.
Also, the particles need to be updated consistently across all particle systems.
Both of these considerations will be discussed later in this thesis.

Virtual reality applications and simulations utilize a multiple context/thread environment to handle both complex data manipulation and intensive rendering.
This complex data manipulation leaves little to no room for a particle system to run on a large scale, large enough to allow for rich data sets.
GPU offloading techniques have been proven to allow applications and simulations to offload work, such as particle systems calculations, on to the graphics hardware freeing up more resources on the CPU. 
Textures and vertex buffer objects can be used to encode complex functions or to relay large data sets to the 
shaders. One has to be careful however; a GPU offloading algorithm has to be designed such that data does not need to be constantly passed back and forth between the GPU and the CPU.
This can cause the bus to be overloaded and slow the rendering process down.
Transform Feedback and Geometry Shaders, both of which are part of Shader Model 4, can help alleviate this data passing problem ~\cite{spec:shader4, spec:transform}.

It is also often the case that particle systems are written such that once they are set into motion there is very little or no changing of the variables that are part of the particle simulation.
Keeping this in mind, this thesis describes Sandstorm, a particle system that has the ability to be dynamically changed while being multi-contextual and utilizing GPU offloading and vector fields for particle propagation.

In the following chapters you will find a description of Sandstorm and all the issues surrounding its development.
In Chapter 2, you will find a background on the project, which includes all the information you will need to understand the issues surrounding the development of such this project.
Chapter 3 will introduce what Sandstorm hopes to become.
An overview of how Sandstorm was designed is presented in Chapter 4.
In Chapter 5 you will find a description of how Sandstorm was engineered.
Results can be found in Chapter 6.
Conclusions and Future Work can be found in Chapter 7.
