

In commercial caustic processors, it is common to see ratios of useful rays versus total rays of between 1 and 5 These remaining rays must be propagated in the air, to test whether each hypothetical ray actually emanated from a light source or was simply a false hypothesis.Īgain, only those rays that actually end up hitting a light source do contribute to the caustic, and the rest of the rays are just discarded as false hypotheses.īoth approaches are thus very costly: only a tiny portion of the computation time actually contributes to the end result. Thus, they must be refracted, using the inverse of Snell's Law. On the other hand, rays that hit the ocean surface definitely came from the outside, making them Those that hit other objects (such as a whale, a ship, or a stone) are discarded. Thus, a beam of candidate rays is sent in allĭirections over the hemisphere, centered at the sampling point. Still, for practical reasons, the result of the integral is resolved via Monte Carlo sampling. Ideally, this would beĪchieved by solving the hemispherical integral of all light coming from above the point being lit. It begins at the ocean floor and traces rays backward in reverse chronological order, trying to compute the sum of all incoming lighting for a given point. Method, even with some speed-ups thanks to spatial subdivision.īackward ray tracing works in the opposite direction. The problem with this approach is that many photons do not even collide with the ocean surface, and from those that actually collide with it, very few actually contribute to caustic formation. In forward ray tracing, photons are sent from light sources and followed through the scene, accumulating their contribution over discreteĪreas of the ground. Whenever this happens, we see a bright spot created by the concentration of light in a caustic, similar to the way a lens focuses light.įrom a simulation standpoint, caustics are usually computed by either forward or backward ray tracing. Due to the ocean surface's waviness, photons entering the water fromĭifferent paths can end up lighting the same area of the ocean floor. Eventually, some of these photons will strike the ocean floor, lighting it. Once bent, photons advance through the water, their intensity attenuating as they get deeper. Here T is the transmitted ray, N is the surface normal, E is the incident ray, and 1, 2 are the indices of Variety of coder-friendly formulas can be used, such as the one in Foley et al. Assuming that the incident, transmitted, and surface normal rays are co-planar, a
#Pixar renderman ocean material code#
Snell's Law is not easy to code with this formulation, because it only imposes one restriction, making the computation of the refracted ray nontrivial. The index of refraction, IOR, can then simply be written as the ratio of the sines of the angles of In the preceding equations, 1 and 2 are the indices of refraction for the respective materials, and 1 and 2 are the incident and refraction angles, as shown in Figure 2-2. Let's forget about reflection for a moment and see how transmitted photons are refracted according to A fraction of these photons eventually collide with the ocean surface, which either reflects or refracts them.

To simulate it properly, we must begin by shooting photons from the light source (for example,įor a sea scene, the Sun). 2.2 Computing CausticsĬomputing underwater caustics accurately is a complex process: millions of individual photons are involved, with many interactions taking place. Implementation using a high-level shading language. Because the technique is procedural, it yields elegantly to an The purpose of this chapter is to expose a new technique for rendering real-time caustics, describing the method from its physical foundations to its implementation details. This simplified approach has proven very successful in many fractal-related disciplines, such as mountain and cloud rendering or tree

As we show in this chapter, the results of ourĪpproach look remarkably realistic, and the method can be implemented easily on most graphics hardware. The result is a scene that looks good, but may not correctly simulate the physics of the setting. Our purely aesthetics-driven approach simply leaves realism out of consideration. This chapter explains an aesthetics-driven method for rendering underwater caustics Caustics result from light rays reflecting or refracting from a curved surface and hence focusing only in certain areas of the receiving surface.
