In the introduction section, there were several points brought up as challenges to the combina- tion of a particle system and a surface generation method. When testing this method there arise several different variables which greatly affect how well the program performs as well as how well the surface renders. These are:
• The particle system size.
• The Marching Cubes grid size.
• The particle field radius size.
When obtaining performance results for the surface generation, these three aspects in par- ticular are considered. In general, a larger particle system size results in a slower simulation overall (this is already known from previous tests), but this is amplified in relation to the size of the particle field - large fields influence more marching cube cells, thus more fields due to more particles slow the performance down even further. Particle field size on its own must be consid- ered from a visual perspective - particles should not be too large and make the fluid seem too “globby”. Additionally, the field radius in relation to the Marching Cubes grid size also must be considered - if the field size is too small (in relation), the resulting Marching Cubes states will give “sharp” corners to what would otherwise be a smooth sphere.
In terms of units, the field radius is defined relative to the total size of the simulation area.
For the results in this section, the simulation area used was a cube ranging from−0.5 in the
x,y andz directions, to+0.5 in thex, y andz directions. Therefore the cube in which the
surface is rendered is a 1 ×1×1 centered at (0, 0). This area is divided up equally into
Marching Cubes voxels of a certain size depending on the resolution of the Marching Cubes grid (number of voxels), and the field radius size is set at a fraction of this simulation area. This way, if the simulation area must be increased (perhaps to accommodate a particular 3d model or scene) the field radius will be scaled accordingly, while keeping the same Marching Cubes grid resolution.
Tables 7.1 and 7.2 show the test results for different scenarios changing these three at- tributes. The results are measured in frames per second (FPS), which means the times include
both the computational aspects of both the particle modelandthe surface generation, and also
Field Radius 32k Particles 64k Particles 128k Particles
0.0625 34.4 17.8 9.7
0.0313 99.7 55.9 34.7
0.0156 158.9 103.6 65.8
Table 7.1: Test results for water simulation with isosurface generation with 262,000 Marching Cubes voxels. Different results are gathered for particle system size and particle field radius. Results are measured as an averaged FPS over 100 frames.
SECTION 7.7: RESULTS DISCUSSION 153
Field Radius 32k Particles 64k Particles 128k Particles
0.0625 6.8 3.6 1.5
0.0313 30.9 17.8 10.7
0.0156 70.9 46.3 33.1
Table 7.2: Test results for water simulation with isosurface generation using 2.1 million march- ing cube voxels. Different results are gathered for particle system size and particle field radius. Results are measured as an averaged FPS over 100 frames.
the rendering time. The particle system in question is an SPH system with the optimal specifi- cations shown earlier in Chapter 6. The scenario given is simply a calm, flat surface - this way, other influences on the performance of the system (i.e. excessive movement of fluid particles) is minimized. In addition to this information, visual representation of the results is displayed in a series of screenshots below (Figures 7.12 and 7.13). To demonstrate the differences in the smoothness of the surface, the Blinn-Phong shading model is used over the Fresnel effect.
Many conclusions can be drawn from observing these results. Although smaller particle field sizes give relatively good performance benefits in relation to both Marching Cubes grid size and particle system size, the visual rendering of these systems is not as smooth as others. As shown in both Figures 7.12 and 7.13, the lower three screenshots (referring to the small
field size of 0.0156) show a much moreroughlooking surface compared to those on the upper
layer (referring to a field size of 0.0313).
Adding on to the first point, the rendering for a field size of 0.0625 (relatively large) pro- duces a very smooth surface for both Marching Cubes grid sizes, with very little change when comparing increasing system sizes (these screenshots were omitted for brevity). However, as shown in the performance tables, this large field radius is much more computationally expen- sive, as the large field is coupled with many more particles as well as more Marching Cubes voxels when compared with smaller sizes.
At the end of the day, real-time simulation is also important. When considering FPS, it is a necessity to define which FPS values are considered to be acceptably “real-time” and which are not. Generally, anything below 15-20 FPS is starting to be too slow and the fluid loses its realism. Therefore, combinations which produce a superior visual result are:
• 2.1 million Marching Cubes voxels, 128k particles, field size of 0.0313
Figure 7.12: Rendering surfaces using different configurations. The rendering method used is a Blinn-Phong shading model specifically modified to demonstrate the differences in the smooth- ness of the surface and in particular the polygon makeup. This particular set of screenshots uses a Marching Cubes grid size of 2.1 million voxels. The top left screenshot shows a 32k par- ticle system size with a field radius of 0.0313. On the top right, the system with 128k particles using the same field size. On the bottom left, a 32k system size with a 0.0156 field size, and on the bottom right a system size of 128k particles using the same field size as the bottom left. The difference in smoothness of can be clearly seen in these screenshots. Looking back at Table 7.2, although the average execution time for the top two configurations are slower, it produces a smoother surface. Visual results for configurations with 262k Marching Cubes voxels is shown in the next figure.
This would all depend on what resources are available - if the graphics card is powerful enough, the case with 2.1 million Marching Cubes voxels would be the preferable choice as it can be rendered in real-time easily. There may even be the option, given a very powerful card, to be able to use an even higher resolution Marching Cubes grid. Additionally, this does not take into account the different scenarios that are available. For example, if the simulation is not as calm and many particles are dropping individually or are sloshing around violently in the simulation, a larger field size might not be optimal, as the larger representation of the particles would not demonstrate the turbulence as well as a smaller field radius would.
SECTION 7.7: RESULTS DISCUSSION 155
Figure 7.13: Similar rendering results as the above screenshots, however these results are using a Marching Cubes grid size of 262,000 voxels rather than 2.1 million. At the top left, a 32k particle system size using a field radius of 0.0313. On the top right, a 128k particle system size using the same field radius. On the bottom left, a 32k system size using a 0.0156 field radius, and on the bottom right a 128k system size using the same field radius. It can be seen that reducing the Marching Cubes grid size does in general result in a poor quality surface, but using certain configurations can provide a surface which is still reasonably smooth.
Figure 7.14: Rendering results for a field radius of 0.0625. These are compared separately as there is not much change in varying different system sizes here. The left image represents a 64k system size with 262k Marching Cubes voxels, while the right represents a 64k system size with 2.1 million Marching Cubes voxels. These configurations produce a very smooth surface (in relation to smaller field sizes) but as shown in Tables 7.1 and 7.2, run relatively slowly.
Figure 7.15: Comparison between simulated fire and real fire for a standard fire scenario. It demonstrates the suitability of the method for the behavioural aspect of the simulation, where it clearly shows the tongue-licking style of effect shown in the photo [137].