Font Size: a A A

Real-Time Simulation Of 3D Fluids On GPU

Posted on:2008-10-07Degree:MasterType:Thesis
Country:ChinaCandidate:Y ChenFull Text:PDF
GTID:2178360212497314Subject:Computer application technology
Abstract/Summary:PDF Full Text Request
Along with the constant development of personal computers, especially the computing power of GPU, the rapid development of physically based computer animation is made possible. This paper focuses on simulating the fluid phenomena such as smoke, water, wave, bubble, fire, explosion, etc.Nowadays, these special effects are presented frequently in movie, animation and video game. The fluid effects in movie and animation are pre-rendering which means they take seconds, minutes even hours to render one frame and these effects are made by foreign professional animation software mostly, such as MAYA and 3DS Max. It takes high cost but gets nothing about the core technique. On the other hand, with the development of video game, players want high demands on visual effects increasingly, so getting more realistic fluid effects is the goal which game programmers are pursuing.There are two purposes for this paper: studying and analyzing the core technique about fluid simulation and presenting some techniques and methods to meet the needs of real-time applications, such as video game and virtual reality.Firstly, this paper presents a survey on the development of physically based fluid simulation in computer animation and then studies and analyzes the computation of 3D Navier-Stokes Equations (NSEs) which is the physical model of fluid flow. The process to solve this equation is also the arithmetic to simulate fluids of which the core methods are semi-Lagrangian and partial differential equations (PDE).At last, this paper presents the details of solving NSEs on GPU and some acceleration techniques and methods at the same time, for example: (1) Using two-grid method to accelerate the convergence speed for linear equationsThe iterative methods for solution of linear equations will produce error which can be decomposed into low frequency component and high frequency component. The former is smooth, changes slowly and the latter swings.The low frequency and high frequency are relative to grid scale. The smooth component in fine grid may be seen as swing component in coarse grid which illumines people to use multigrid methods to reduce the error. When convergence speed slows down in finer grid, the solution is then transferred to coarser gird. After some iterations cycles on the coarse level, the solution is then transferred to next coarser level until the coarsest level is reached. The solution obtained at the coarsest level is then interpolated back to the finer level and is prorogated till the finest level is reached. The whole process is repeated until satisfactory convergence is reached.Taking the speed into account, this paper uses two-grid method. As using flat 3D texture technique, we chose the non-uniform mesh (only coarsen in the x and y direction) for simplifying the implementation process.(2) Improving the arithmetic of clipping 3D scene to fit complex geometry The original clipping method can't deal with hollow objects (e.g. torus).So this paper adds one pass between the old 2 passes: set the orthogonal projectionfor (move the clipping plane along the depth Z- axis) { set parameters for clipping plane (the front face faces the camera)pass 1 render the back face of geometries which are behind theclipping plane, do not write the frame buffer, set the stencil bufferpass 2 (new pass) render the front face of geometries which are behindthe clipping plane, do not write the frame buffer, clear the stencil bufferpass 3 render the front face of geometries which are front of theclipping plane, write the frame buffer where the stencil is set clear the stencil buffer for next clipping }(3) Presenting the way to deal with dynamic boundary on GPU(a) Obstacle map (boundary info) must be generated in real-time For moving objects, the obstacle map must be generated in real-time to show the correct interaction.More moving objects in scene, it takes more time to generate the boundary info which affects application performance greatly. It must take account of the generation speed of boundary info. For example, there is no need to regenerate info for objects which do not move at that time and objects which are out of the simulation domain. We can even use reduction model, that is, the models for rendering and generating are different.(b) Moving boundary must take speedFor moving boundary, it must set the speed of the objects to boundaryvalue, that is, the c in equation is equal to the object speed.(c) Physical quantity in objectsAfter the object move, the space cells (voxels) which held by object will become fluids cells. So the physical quantity in object must be considered.(d) Modifying the advection stepIt is possible that the trace point ends up in one of the occupied voxels. In this case we simply clip the path against the voxel boundary. This guarantees that the point always lies in the unoccupied fluid.(e) The coupling between fluid and solidFluid and solid interplay each other indeed, but we must consider the tradeoff in applications.(4) Using integer one-pass voxel traversal algorithm for accelerating computing lightMore accurate hardware-based computing lighting effects can be used. Before the ray which is sent from the light source reaches the destination voxel, it has traveled through some other voxels. So we should take account of the light attenuation along the light path. This paper uses integer one-pass algorithm for voxel traversal and it is fast as using integer for computing.(5) Using space-for-time algorithm for accelerating volume rendering This paper presents a method for no computing the polygons and texture coordinates: pre-computing all possible scenarios. In fact, it only needs pre-compute there groups of polygons which are aligned with the three main axes. As using alpha blending operation, the orders of rendering are different between positive directions and negative directions of the same axis. So it should generate six groups of polygons which are aligned with +X, -X, +Y, -Y, +Z, -Z. Two conditions will be used for selecting the right group at run time: the angles between the view ray and the three axes and the positive directions and negative directions in that axis.Smoke simulation is the main part of this paper. By the use of highly processing power, parallelism and programmability of GPU, we have implemented real-time smoke simulation which can be interacted with static/dynamic scene and can be rendered into animation. Although there are some restricts for using physics-based fluids simulation in video game perfectly, with the development of hardware and mature technology, this day will come soon.
Keywords/Search Tags:Computational Fluid Dynamic, Navier-Stokes Equations, 3D Fluids, Real-Time Simulation, GPU, Shader, Boundary
PDF Full Text Request
Related items