Single-Scattering Volume Rendering Using Ray Tracing A ray tracing renderer works by gathering rays of light from a scene that correspond to a pixel in the resulting image. Each ray interacts with the scene, determines how much light hits the “virtual film” at a location corresponding to a pixel, and then records this as the color and intensity of light associated with this pixel. For efficiency, almost all ray tracers actually solve the reverse problem; instead of considering rays coming from the light and hitting the camera, as would seem intuitive from physics, they consider rays that originate at the camera and hit the light. This algorithm is considerably faster, as the vast number of paths of light rays that leave the light but never hit the camera are ignored. A basic result from radiometry is that these two methods of tracing rays are equivalent; rays interact with the scene the same in the forward and backward direction [ 4]. An important characteristic of ray tracing algorithms is that they never produce the “correct” result. A correct, or true-to-life result, is impractical to compute, as it would require an almost infinite number of ray interactions to be calculated. The efficiency of ray tracing algorithms is measured by comparing how many ray interactions need to be calculated versus the difference (called variance) between the true-to-life result and the actual image produced by the algorithm. Ray tracing algorithms that produce low noise with a set number of rays are more efficient than algorithms that produce high noise with the same number of rays.
A single-scattering volume integrator is an extension of the ray tracing algorithm that makes light interact correctly with volumes of particles. Typically, ray tracers make the assumption that there will be no interactions with empty space, only interactions with surfaces, so they ignore volumetric data. In reality, light traveling through a volume of particles will be absorbed, emitted, and scattered. If the particles absorb light, then rays from the light to the camera are decreased in intensity in proportion to the absorption factor of the particles. Some particles may actually emit light; often this is physically incorrect but used because it produces practical and attractive visual results. Scattered light is light that hits a particle and changes direction. A simulator must account for absorption, emission, and scattering to accurately simulate light transport through volumes of particles. In a renderer, a volume integrator serves this purpose and collects the light along rays that interact with volumes of particles based on this physical model.
A single-scattering volume integrator “marches” along a ray that enters a volume of particles at a certain step distance, usually provided by the user. At each step, the integrator sends a ray in the direction of the light, and it once again performs a marching algorithm to determine how much light went from the source to the point that is being considered in this step. The light along this ray then contributes to the total amount of light that hits the virtual camera. Because this algorithm only considers single-scattering, it does not recurse; it only calculates paths directly from the light to the camera. It is not physically correct because, in reality, light can scatter in all directions, not just directory toward the light. The light ray is modulated at every step by the water droplet function described in the previous section. For the sample implementation, the integrator is biased to weight the amount of light contributed by the direct, rain-bow-producing light based on a user-given parameter, so that the rainbow’s intensity could be controlled for artistic effect.
The sample implementation of this algorithm used to produce the images in this paper was based on the Physically Based Ray Tracer (PBRT) renderer [ 4]. The default single-scattering VolumeIntegrator class was extended to include the techniques described above. Figure 4 shows a full scene rendered using this technique.
Figure 4: Example image rendered using single-scattering water droplet algorithm.
Although the single-scattering-based integrator was successful at producing rainbows, it is possible to more accurately simulate the effect of light entering a volume of particles and interacting with transparent particles before it reaches the viewer. This should reduce the “flat” appearance of the water spray in Figure 4 and make it appear more voluminous and cloudlike. To accomplish this, a multiple-scattering integrator based on path tracing could be used.
A multiple-scattering integrator differs from a single-scattering integrator in that each ray that enters a volume region is simulated to randomly walk through the region at a step distance provided by the user, instead of light rays marching along in one direction. At each step, the ray randomly continues straight or bounces off in a random direction. This corresponds to the physical concept of a light ray having traveled through space, and either continuing straight or being deflected, based on whether it actually hit a water particle or not. The probability that a ray gets deflected depends on the density of particles at its current location. In areas of zero density, the ray is never deflected, so it continues straight into the scene (never scattering). This is the behavior that would be expected for rays that do not interact with the particles. If the particle is deflected, the color that the ray contributes is modulated using the rainbow transmittance lookup table described earlier, based on the angle between the incident and refracted ray. If a ray ends up hitting a light, then it contributes light to the image.
The integrator just described is a subset of a larger set of techniques known as path tracing. With path tracing, rays are sent into the scene from the camera, bounce around the scene and interact with surfaces and volumes in the scene until they reach the light source. This tech-
References:
Archives