3.5 Rendering Framework
To achieve real-time rendering of the simulated result, we apply the screen space ap-proach similar to [Gre10]. Moreover, to model the protruded and sharp shape of the thread formed by the liquid drops, we stretch the sphere that is usually used in the screen space rendering to the ellipsoid, vary the radius of the sphere based on its mass, and rotate it to fit the surface of the model.
3.5.1 Screen Space Rendering
Figure 3.10: Flowchart of screen Space Rendering.
As shown in Figure 3.10, by rendering particles as spherical point sprites, we obtain a depth map of the particles viewing from the eye point. However, the depth map is often too bumpy to be used. Hence, we smooth the depth map by using Gaussian filter.
Figure 3.11 shows the depth map with and without applying Gaussian filter.
3.5 Rendering Framework 27
Figure 3.11: Depth map with/without Gaussian Filter.
After smoothing the depth map, we use it to compute the fluid normal vectors in per-pixel manner; see Figure 3.12. In addition, we also calculate the eye-space surface position from the smoothed depth map. Once we have the per-pixel information of the surface, such as depth, normal, and position, we could shade the surface as usual, such as by Phong shading. Finally, because there exist solidified particles on the object surface that often introduce self-shadows, we also apply shadow map to generate the shadow.
Figure 3.12: Normal map obtained from the depth map filtered with Gaussian filter.
3.5 Rendering Framework 28
3.5.2 Model the shape using ellipsoids
To model the shape of a thread formed by the melting liquid on the solid surface , we first render the spheres in different radius based on the particle’s split level obtained in adaptive sampling. For the particle with less mass, we render it with a relatively small sphere, and vice versa, for the particle at lower split level that has heavier mass, we render it with a relatively large sphere. Figure 3.13 demonstrates the idea. Moreover, according to the suggestion of Cords et al. [CS08], the radius for rendering a particle is determined when approximating the surface of calm liquid and mainly depends on the distance to its nearest neighbor.
Figure 3.13: Render particles using spheres in different radius. The number indicates the particle’s split level.
Then, we stretch the sphere in specific direction, trying to model the protruded shape of the thread. For the sphere at the bottom of the thread, we stretch it in the direction such that a sharp prominence could be formed at the bottom of the thread. For the sphere located at the middle of the thread, we stretch the sphere in the direction to make the filament appearance. The stretchiness of the sphere is an empirical adaption that depends on the specific requirement. See the Figure 3.14.
3.5 Rendering Framework 29
(a) (b)
Figure 3.14: (a) Stretch the sphere in y-direction so that it looks like a filament. (a) Stretch the sphere in z-direction to make a sharp prominence.
Finally, we rotate the ellipsoid, and align its orientation with the surface normal vector obtained by computing the divergence of the color field [MCG03].
Figure 3.15: Rotate the ellipsoid to align the surface normal vector.
3.5.3 Translucent Rendering
Because the wax is a translucent material, we integrate Translucent Shadow Map [DS03]
in our rendering framework. Figure 3.16 shows the standard process of Translucent Shadow Map.
3.5 Rendering Framework 30
Figure 3.16: The Translucent Shadow Map stores irradiance samples (left). The ra-diance leaving the object is them computed by filtering these rara-diance samples (right) [DS03].
In first step, we view the candle flame as the light source and place a virtual camera at this position. The virtual camera looks at the particles and the shadow map stores irradiance samples. In the second step, we compute the radiance leaving the object and use it to shade the object. However, to get better visual effect and prevent the detail of droplets from looking blurred due to the strong translucent effect, we additionally consider the local light source to make the shaded droplet stereoscopic.
C H A P T E R 4
Results
In this chapter, we first show the value of simulation parameters used in our results and how we render the results. Second, we demonstrate the effect of parameter that determines the stickiness of the fluid. Third, we show the thread-preserving flow of melting liquid by applying the adaptive particle sampling model. Then, we demonstrate the rendering result using screen space rendering approach. Finally, we compare our candle melting result with previous methods [CMRBVHT02][PPLT09].
Table 4.1 shows the value of simulation parameters used in the following results except Figure 4.1, 4.2, and 4.3. Table 4.2 show whether the technique in each column is applied in the following figures.
31
32
parameters meaning value
k liquid incompressibility (Eq. 3.10) 645000 µmax max viscosity coefficient (Eq. 3.9 and Fig. 3.6) 17000 µmin min viscosity coefficient (Eq. 3.9 and Fig. 3.6) 16000 ϵ degree of velocity diffusion (Eq. 3.14) 0.72 α tangential friction of solid surface (Eq. 3.16) 0.38 Qs heat energy from heat source (Eq. 3.19) 65
δ heat absorption ratio (Eq. 3.19) 0.063
rs heat source effective radius (Eq. 3.19) 0.18
cd thermal conductivity (Eq. 3.24) 0.004
ϵe thermal emissivity (Eq. 3.21) 0.001
s split number (Eq. 3.26) 2
Table 4.1: Main parameters of candle melting simulation
Translucent Shadow Map Adaptive Particle Sampling Render the particle as ellipsoid
Fig 4.1 o o o
Table 4.2: How we render the simulation results. The circle (o) means the technique in that column is applied and (x) vice versa. (∆) means we show the comparison with and without applying the technique.
To illustrate that the parameter α appeared in Equation 3.16 determines the
stick-33
iness of the fluid, Figure 4.1, Figure 4.2, and Figure 4.3 show the simulation process with different α values. The value of other parameters used in these results are equal to those in Table 4.1. Obviously, by setting different α values, the stickiness of the fluid on the solid surface is different. Hence, we could achieve the expected stickiness easily by only tunning this parameter.
Figure 4.1: α = 0.2. The fluid move slowly and almost stick on the solid surface.
34
Figure 4.2: α = 0.5. The fluid run along the solid surface smoothly.
Figure 4.3: α = 0.8. The fluid on the slope run away from the solid surface easily.
35
Figure 4.4 shows the simulation result with and without applying adaptive particle sampling. The particle in the simulation result without applying adaptive particle sam-pling is rendered as the sphere as usual. Adaptive samsam-pling does preserve the thread formed by the flow of melting liquid, comparing to the one without particle split.
Figure 4.4: The upper row shows the simulation result without adaptive particle sam-pling. The droplet simply flows on the surface. The bottom row shows that the thread is preserved with particle splitting.
Figure 4.5 shows the comparison between rendering the particle as the sphere and the ellipsoid. Translucent effects are removed in order to clearly observe the sharp shape of melting droplets. The shape of small droplets after splitting is sharper in Figure 4.5(b).
36
(a) (b)
Figure 4.5: (a) Render the droplet using the sphere (b) Render the droplet using the ellipsoid.
Figure 4.6, 4.7, and 4.8 shows a comparison of a candle melting scene between our result, Carlson et al. [CMRBVHT02], and Pavia et al.[PPLT09]. Different from their melting behavior, our simulation model focuses on the surface flow of melting liquid and looks much more realistic.
Figure 4.6: Wax melting in [CMRBVHT02].
37
Figure 4.7: Candle melting in [PPLT09].
Figure 4.8: Our simulation result
C H A P T E R 5
Conclusions
In this chapter, we briefly summarize our candle melting approach and rendering frame-work. Also, we describe the limitations and some future directions of improvement.
5.1 Summary
We have proposed a SPH-based simulation framework for candle melting. By utilizing the concepts proposed by Schechter et al. [SB12], we solve the density deficiency prob-lem near the fluid boundary and achieve no-penetration and no-separataion solid-liquid boundary condition easily. The melting liquids thus could run along the surface closely without introducing any artificial interfacial tension. Moreover, by applying XSPH and setting appropriate ghost-solid velocities, the fluids can flow on the surface smoothly and achieve the expected stickiness easily. We propose a complete transfer system that considers the heat radiation, conduction, and dissipation. We model the heat source as the light source, and the surface particles that receive the radiation energy are de-termined by using shadow map. The radiation energy attenuates with the distance and
38