![]() That is the size of the object in the scene. A 3D grid storing density values is rather simple to define in any programming language through they are subtleties that we will look into at the end of this chapter.īesides the grid resolution (the number of voxels it contains in any dimension like 32x32x32), we also need to define the size of the grid in world space. ![]() 3D Grids are too fluid sims, what bitmaps are to images. Each voxel in the grid stores one unique density value (the density "filling up" the volume of the voxel). All you need to know for this lesson is that the results of fluid sims are stored in 3D grids made up of voxels that are storing density values (either 0 or a value greater than 0). But again, this topic is left to another lesson. ![]() The way they move from voxel to voxel is ruled by the Navier-Stokes equation. Grids are nice to simulate the motion of fluids because, the grid's voxels (these are the small volume elements making up the grid which we can also call cells) are set with some initial density (imagine that they are filled up with smoke), and this density is distributed among the neighboring cells, as time progresses. Figure 1: a 8x8x8 grid, storing density values. Making the solution generic (aka supporting grids that are not axis aligned can easily be done by transforming the camera ray into the grid object space using the grid's world-to-object transformation matrix as explained in this lesson). So we assume the grid is an axis-aligned box: we can treat our grid as an axis-aligned bounding box (AABB) which will simplify our ray-box intersection test. Also, we won't be transforming the grid in this lesson. In practice, it doesn't have to be the case. This is just for the sake of this lesson. 32x32x32 in the x, y, and z coordinates respectively) and that this resolution is a power of 2 (8, 16, 32, 64, 128, etc.). For simplicity and this lesson, we will assume that these grids have an equal resolution in all three dimensions (e.g. Many techniques for simulating a fluid (smoke, water, etc.) exist, but generally, at some point or another in the process, the result of the simulation is stored in a 3D grid. Step 1: Using a 3D Grid to Store Density Values We will learn about fluid simulation in the future, promise. We will learn how to render the data produced from a fluid sim. Note that in this lesson, we won't learn how fluid simulation works. In this chapter, we will look at the latter. As mentioned in the previous chapter, you can create density fields using two techniques: procedurally or using fluid simulation software.
0 Comments
Leave a Reply. |