
Tuesday, 10 March 2009
Progress Report
The honours project which I am currently carrying out involves a research into existing techniques for fluid simulations. These techniques are to be evaluated to determine if they can be used in a real-time environment with out tying up the CPU and also produce realistic visual results. A demo application of a technique will be produced to show a technique at work with the ability of user interaction included with it.
Work Done
Most of the work that has been done since the project began is research into the Jos Stam’s work especially into his techniques for stable fluids which is techniques required if the fluid is to be included in a game environment. Also research in to Navier-Stokes equations has been done to get a understanding how they are used and what each of the terms included in the equations mean. Once an understanding was developed then it was decided between me and my supervisor that it would be best to start building my application earlier because it will help me understand the functions of the Navier-Stokes equations more and also allow for more time if any problems occur. The class which contains all the functions of the Navier-Stokes equations has been created with some problems cropping up along the way. The main problem that occurred was the pointers used was not being evaluated correctly which took a couple of weeks to solve which is longer than I hoped but with me starting the application earlier and spending more time working on the application I believe I still have enough time to complete it.
Work in progress
Currently I’m working on creating the visual aspects of the fluid. I am trying to get a 2D grid which will show the changes of density within a fluid when a force is implied. This force will be applied by the use of a mouse click onto the grid which is something else that I am working on. The visual aspects are currently going to represent in DirectX.
Work still to be done
There is still work to be built into the application which will deal with stationary objects which I want to be included into the application. Another thing that needs to be achieved as well is the boundary calculations for the fluid. Currently at the moment it is set to a basic box but I plan on expanding it to have ‘free surfaces’ which is discussed by Nick Foster and Dimitri Metaxas. The application also has to be tested by looking at the performance of the application and the look of the fluid. Then once this application has been built the final report and presentation will be prepared and written up before the project completion date 22nd May.
Work Done
Most of the work that has been done since the project began is research into the Jos Stam’s work especially into his techniques for stable fluids which is techniques required if the fluid is to be included in a game environment. Also research in to Navier-Stokes equations has been done to get a understanding how they are used and what each of the terms included in the equations mean. Once an understanding was developed then it was decided between me and my supervisor that it would be best to start building my application earlier because it will help me understand the functions of the Navier-Stokes equations more and also allow for more time if any problems occur. The class which contains all the functions of the Navier-Stokes equations has been created with some problems cropping up along the way. The main problem that occurred was the pointers used was not being evaluated correctly which took a couple of weeks to solve which is longer than I hoped but with me starting the application earlier and spending more time working on the application I believe I still have enough time to complete it.
Work in progress
Currently I’m working on creating the visual aspects of the fluid. I am trying to get a 2D grid which will show the changes of density within a fluid when a force is implied. This force will be applied by the use of a mouse click onto the grid which is something else that I am working on. The visual aspects are currently going to represent in DirectX.
Work still to be done
There is still work to be built into the application which will deal with stationary objects which I want to be included into the application. Another thing that needs to be achieved as well is the boundary calculations for the fluid. Currently at the moment it is set to a basic box but I plan on expanding it to have ‘free surfaces’ which is discussed by Nick Foster and Dimitri Metaxas. The application also has to be tested by looking at the performance of the application and the look of the fluid. Then once this application has been built the final report and presentation will be prepared and written up before the project completion date 22nd May.
Thursday, 5 March 2009
05/03 Update
Well in this last two weeks I have been having a few problems with the application. The class that contains the Navier-Stokes equations was having errors about not being able to evaluate certain pointers when the application was being run. After a week on trying to fix it I have switched the pointers to arrays to represent the grid. Another problem came up with this but was due to putting the class as a pointer which was changed. Now the program runs without crashing but there is another problem and it is not representing the grid on screen. This I believe is to do with how im outputting the vertices on the screen.
So the goals to be achieved are:
Sort the problem with the output.
Get the mouse input included into the application.
So the goals to be achieved are:
Sort the problem with the output.
Get the mouse input included into the application.
Wednesday, 11 February 2009
Update 11/02
Well there has been a lot achieved programming side this week. I have managed to implement some of the functions for the Navier-Stokes equation into my program. What is up is the Advection and Diffuse equations have been included along with the density calculation step for the entire grid. The velocity step still needs to be done but it similar to the density as it used Advection equation as well.
I have also came across the game called Hydrophobia (Blade Interactive) which has a game engine (HydroEngine) which provides realistic fluid dynamics technology for flowing water, allowing it to interact with the surroundings. The game is set to be released in March sometime so I do plan on having a look at the game to see how their fluid dynamics are represented.
Hydrophobia teaser trailer
This week's goals are:
- Get the velocity step for the application built in.
- Get a visual representation of the fluid done.
Tuesday, 3 February 2009
Update 03/02
Well I have managed to achieve the goals which I set myself over the last two weeks. My application has been started which is a basic window which runs with DirectX. I have read up on GPU Gems 3 which was good but I have also read GPU Gems which was really good. It has help me come to terms with the ideas and terms behind Navier-Stoke equations. Also the steps you have to follow to produce the desirable fluid has been achieved. However the one problem with this book is that it uses the GPU to create the fluid rather than the CPU which is a type of code which I have not used before and is difficult to understand. However if I plan on building the fluid to run on the CPU first then convert it to the GPU. As it can run 6 times faster than the CPU.
I have also managed to get a demo application of Jos Stams work along with code which I plan on looking at to see how the equations are applied in his applications.
Goals for this week:
Build up on my application to include the functions of Navier-Stokes equations
Look it to the techniques used to represent fluids (Grids and Particles).
I have also managed to get a demo application of Jos Stams work along with code which I plan on looking at to see how the equations are applied in his applications.
Goals for this week:
Build up on my application to include the functions of Navier-Stokes equations
Look it to the techniques used to represent fluids (Grids and Particles).
Wednesday, 21 January 2009
21/01/09 Update
Over the Christmas period I have read up on several papers. Some have really interesting ideas. Stams' 'Stable fluids' which is something I should be aiming to achieve as Stable fluids can run for along time without 'blowing up'. Another paper by Foster and Metaxas goes on about the importance of boundaries and the different types you can have and how the effect the equations of motion.
Had my first meeting for this semester with Dr Lucas. He suggests that I start to implement some of the ideas which I think is a good idea, may help me to understand some of the equations more. Also he suggested reading a chapter in GPU Gems 3 on fluid simulation which I have had a quick glance at and seems really interesting.
So my goals for the next two weeks are:
Familiarise myself with Direct X
Get a basic window running up on Direct X
Read up on GPU Gems.
Read up and try to get some of particle engine implement in Direct X
Had my first meeting for this semester with Dr Lucas. He suggests that I start to implement some of the ideas which I think is a good idea, may help me to understand some of the equations more. Also he suggested reading a chapter in GPU Gems 3 on fluid simulation which I have had a quick glance at and seems really interesting.
So my goals for the next two weeks are:
Familiarise myself with Direct X
Get a basic window running up on Direct X
Read up on GPU Gems.
Read up and try to get some of particle engine implement in Direct X
Honours Project Proposal
Introduction:
“Fluid flows are everywhere from rising smoke, clouds and mist to the flows of rivers and oceans” (Stam 2003, p.1). The phenomena may seem simple in real-life but are complex and difficult to simulate in real-time. “The reason for the complexity of fluid behaviour is the complex interplay of various processes such as convection, diffusion, turbulence and surface tension” (Müller, Charypar and Gross 2003, p.1).
“One of the major goals of games is to immerse players into plausible virtual worlds. It is then desirable to include fluid flows into games engines” (Stam 2003, p.1) which is why for many years game developers have included some sort of fluid simulations within their games, from basic animated textures, which was basically used to give the essence of fluid to 3D fluid simulations, which had some of the physical properties of fluid included.
There are many algorithms for fluid simulation, most of which rely on the Navier-Stoke’s equations (named after Claude-Louis Navier and George Gabriel Stokes), which “simply account for all momentum exchange possibilities within a fluid” (Foster and Metaxas 1996, p.2). These equations are very good at describing a large number of simulations, for instance simulations of ocean currents and water flow in a pipe can use Navier-Stoke’s equations to accurately model the fluid. The accuracy of these equations comes at a price. They are very complex and time consuming and are pretty much impossible to use in real-time environments as frame-rates will be hit hard by the inclusion of them. They are usually used when great accuracy is necessary (e.g. designing aircrafts).
“In computer graphics and in games on the other hand what matters most is that simulations both look convincing and are fast” (Stam 2003, p.1). Therefore it is possible to have some simulation of the physical properties. These simulations do not have to be physically accurate but do have to look accurate enough to allow the player to believe that this substance is in fact a fluid. This allows the process of simplifying complex algorithms to allow the process of solving them to run a lot faster, improving the running of the game.
Even though fluid simulation has been around for many years is it still a hot topic within game development. As technology improves, what game developers can do with fluid simulation also improves. Many of the recent games which have been released have shown off their fluid simulation to advertise the game and the developers have been praised for it. One such game is BioShock (2007) developed by Irrational which was set in a under ocean city and not only used fluid simulation to model various fluids within the game but used it to set the “feel” of the game and to allow players to believe that they are in a city on the ocean floor, which may have been hard to achieve if the inclusion of simulation of fluid was not there.
Research Topic:
“Established engineering techniques for simulating and modelling the real world have been modified and applied to computer graphics more frequently over the last years” (Foster and Fedkiw 2001, p.1) . Therefore the main objective of this project is to not only perform a scholarly research into existing techniques and ideas for fluid simulations for current-state consoles and PCs but see if available real world techniques can be used in a real-time environment. Each of these techniques will be studied carefully to allow me to understand the equations and algorithms which are used for fluid simulation. Also research will be conducted to possibly improve current fluid simulation models. The kind of techniques which will be looked into are the ones which you uses versions of Navier-Stoke’s equations and Lagrange equations of motion which are “used to place buoyant dynamic objects into a scene” (Foster and Metaxas 1996, p.1).
Visual affects will also be looked into especially the laws which involve lighting like Snell’s law which can be used to produce the required underwater caustics by refracting and reflecting incoming light. This will allow the understanding of how fluid can get the visual simulation in a real-time environment.
The research will look in fluid as a whole but the algorithms and demo applications will be built around the physical properties of water rather than any other fluid (i.e. smoke).
Research Question:
“Can fluid interactions with objects be accurately simulated in a real-time environment?”
Addressing the Question:
Research will be conducted into existing techniques for fluid simulations and evaluations of these techniques will be done to determine what the best technique to use for the simulation is. What will determine a technique as the best is one that shows the physically properties of the fluid accurately enough and that it runs efficiently. For each technique studied determination of what is good about them and what is bad will be highlighted. Also, there might be possibility of combining a number of techniques to create a hybrid algorithm for fluid simulation which is better than a single technique.
A demo application will be built to show how the technique(s) are applied. The demo application will be built in Direct X and will show the fluid in a 2D environment and how the fluid interacts when it comes into contact with stationary objects. The fluid will also be represented by particles because this will allow it not to be restricted to a finite grid and only performs computation where necessary (Green 2008) meaning that it will be faster than using vertex grid. Frame rates will also be shown in the application to show the performance of this simulation.
A 3D application of the algorithms selected will also be built within the given time. Also as with the 2D simulation, the performance of the application will be shown in terms of frame rate being outputted to the screen.
The fluid that will be simulated in both these demo applications will be designed around the visual look and physical properties of water. This will allow a familiar visual comparison between real-life and the simulation to be made.
Project Evaluation:
The measure of success of my project will be shown through the demo applications. These applications will show clearly if the fluid technique is viable in producing accurate simulations in a real-time environment.
Frame rates will be measured as well for the application. For it to be used within a game engine then must have a suitable frame rate. In modern games frame rates can vary. Take Halo 3(2007) by Bungie for instance it runs at 30 frames per second while Call of Duty 4: Modern Warfare (2007) by Infinity Ward runs at 60 frames per second. So having a fluid simulation that runs at these frame rates or higher will be classified as a success.
Issues:
One main issue that needs to be addressed through this project is how physically accurate can fluid simulations be in real-time before the performance becomes a big issue. This balanced needs to be addressed through experimentation in order to determine the best technique to use for fluid simulation.
Applying the correct technique will be another issue which will have to be addressed during the course of this project. The techniques out there are mostly mathematical equations so they will have to be adapted so that they can be used with an application.
Resource Requirements:
The demo application will be built using Microsoft Visual Studios 2005 and Direct3D. The DirectX API has the ability of creating particles and is commonly used within the games industry.
Also as the demo application will be designed around the current generation of consoles and PCs, a modern PC preferably built for modern day games with appropriate graphics cards and processors will be required to run the application reasonably. These types of PCs are currently available at both home and the university game labs.
“Fluid flows are everywhere from rising smoke, clouds and mist to the flows of rivers and oceans” (Stam 2003, p.1). The phenomena may seem simple in real-life but are complex and difficult to simulate in real-time. “The reason for the complexity of fluid behaviour is the complex interplay of various processes such as convection, diffusion, turbulence and surface tension” (Müller, Charypar and Gross 2003, p.1).
“One of the major goals of games is to immerse players into plausible virtual worlds. It is then desirable to include fluid flows into games engines” (Stam 2003, p.1) which is why for many years game developers have included some sort of fluid simulations within their games, from basic animated textures, which was basically used to give the essence of fluid to 3D fluid simulations, which had some of the physical properties of fluid included.
There are many algorithms for fluid simulation, most of which rely on the Navier-Stoke’s equations (named after Claude-Louis Navier and George Gabriel Stokes), which “simply account for all momentum exchange possibilities within a fluid” (Foster and Metaxas 1996, p.2). These equations are very good at describing a large number of simulations, for instance simulations of ocean currents and water flow in a pipe can use Navier-Stoke’s equations to accurately model the fluid. The accuracy of these equations comes at a price. They are very complex and time consuming and are pretty much impossible to use in real-time environments as frame-rates will be hit hard by the inclusion of them. They are usually used when great accuracy is necessary (e.g. designing aircrafts).
“In computer graphics and in games on the other hand what matters most is that simulations both look convincing and are fast” (Stam 2003, p.1). Therefore it is possible to have some simulation of the physical properties. These simulations do not have to be physically accurate but do have to look accurate enough to allow the player to believe that this substance is in fact a fluid. This allows the process of simplifying complex algorithms to allow the process of solving them to run a lot faster, improving the running of the game.
Even though fluid simulation has been around for many years is it still a hot topic within game development. As technology improves, what game developers can do with fluid simulation also improves. Many of the recent games which have been released have shown off their fluid simulation to advertise the game and the developers have been praised for it. One such game is BioShock (2007) developed by Irrational which was set in a under ocean city and not only used fluid simulation to model various fluids within the game but used it to set the “feel” of the game and to allow players to believe that they are in a city on the ocean floor, which may have been hard to achieve if the inclusion of simulation of fluid was not there.
Research Topic:
“Established engineering techniques for simulating and modelling the real world have been modified and applied to computer graphics more frequently over the last years” (Foster and Fedkiw 2001, p.1) . Therefore the main objective of this project is to not only perform a scholarly research into existing techniques and ideas for fluid simulations for current-state consoles and PCs but see if available real world techniques can be used in a real-time environment. Each of these techniques will be studied carefully to allow me to understand the equations and algorithms which are used for fluid simulation. Also research will be conducted to possibly improve current fluid simulation models. The kind of techniques which will be looked into are the ones which you uses versions of Navier-Stoke’s equations and Lagrange equations of motion which are “used to place buoyant dynamic objects into a scene” (Foster and Metaxas 1996, p.1).
Visual affects will also be looked into especially the laws which involve lighting like Snell’s law which can be used to produce the required underwater caustics by refracting and reflecting incoming light. This will allow the understanding of how fluid can get the visual simulation in a real-time environment.
The research will look in fluid as a whole but the algorithms and demo applications will be built around the physical properties of water rather than any other fluid (i.e. smoke).
Research Question:
“Can fluid interactions with objects be accurately simulated in a real-time environment?”
Addressing the Question:
Research will be conducted into existing techniques for fluid simulations and evaluations of these techniques will be done to determine what the best technique to use for the simulation is. What will determine a technique as the best is one that shows the physically properties of the fluid accurately enough and that it runs efficiently. For each technique studied determination of what is good about them and what is bad will be highlighted. Also, there might be possibility of combining a number of techniques to create a hybrid algorithm for fluid simulation which is better than a single technique.
A demo application will be built to show how the technique(s) are applied. The demo application will be built in Direct X and will show the fluid in a 2D environment and how the fluid interacts when it comes into contact with stationary objects. The fluid will also be represented by particles because this will allow it not to be restricted to a finite grid and only performs computation where necessary (Green 2008) meaning that it will be faster than using vertex grid. Frame rates will also be shown in the application to show the performance of this simulation.
A 3D application of the algorithms selected will also be built within the given time. Also as with the 2D simulation, the performance of the application will be shown in terms of frame rate being outputted to the screen.
The fluid that will be simulated in both these demo applications will be designed around the visual look and physical properties of water. This will allow a familiar visual comparison between real-life and the simulation to be made.
Project Evaluation:
The measure of success of my project will be shown through the demo applications. These applications will show clearly if the fluid technique is viable in producing accurate simulations in a real-time environment.
Frame rates will be measured as well for the application. For it to be used within a game engine then must have a suitable frame rate. In modern games frame rates can vary. Take Halo 3(2007) by Bungie for instance it runs at 30 frames per second while Call of Duty 4: Modern Warfare (2007) by Infinity Ward runs at 60 frames per second. So having a fluid simulation that runs at these frame rates or higher will be classified as a success.
Issues:
One main issue that needs to be addressed through this project is how physically accurate can fluid simulations be in real-time before the performance becomes a big issue. This balanced needs to be addressed through experimentation in order to determine the best technique to use for fluid simulation.
Applying the correct technique will be another issue which will have to be addressed during the course of this project. The techniques out there are mostly mathematical equations so they will have to be adapted so that they can be used with an application.
Resource Requirements:
The demo application will be built using Microsoft Visual Studios 2005 and Direct3D. The DirectX API has the ability of creating particles and is commonly used within the games industry.
Also as the demo application will be designed around the current generation of consoles and PCs, a modern PC preferably built for modern day games with appropriate graphics cards and processors will be required to run the application reasonably. These types of PCs are currently available at both home and the university game labs.
Subscribe to:
Posts (Atom)