Efficient Rendering of Caustics with Streamed Photon Mapping
Total Page:16
File Type:pdf, Size:1020Kb
BULLETIN OF THE POLISH ACADEMY OF SCIENCES TECHNICAL SCIENCES, Vol. 65, No. 3, 2017 DOI: 10.1515/bpasts-2017-0040 Efficient rendering of caustics with streamed photon mapping K. GUZEK and P. NAPIERALSKI* Institute of Information Technology, Lodz University of Technology, 215 Wolczanska St., 90-924 Lodz, Poland Abstract. In this paper, we present the streamed photon mapping method for enhancing the rendering of caustics. In order to achieve a realistic caustic effect, global illumination methods require additional data, which are gathered by creating a caustic map or increasing the number of samples used for rendering. Our method employs a stream of photons with a varying luminance level depending on the material properties of the surface. The application of a concentrated photon stream provides the ability to render caustics effectively without increasing the number of photons in a photon map. Such an approach increases visibility of results, while also allowing for faster computations. Key words: rendering, global illumination, photon mapping, caustics. 1. Introduction 2. Rendering caustics The interaction of light with matter in the real world results The first attempt to simulate a natural caustic effect was the in a variety of optical phenomena. Understanding how those path tracing method, introduced by James Kajiya in 1986 [4]. phenomena occur and where to implement them is crucial for However, the method proved to be highly inefficient. The creating realistic image renders. When observing the reflection caustics were poorly rendered, as the light source was obscure. or refraction of light through curved surfaces, one may notice A significant improvement was introduced both and inde- some characteristic patches of light, referred to as caustics. The pendently by Lafortune et al. in 1993 [5] and by Veach et al. in caustic effects can be classified into two types: diacaustics and 1994 [6]. They proposed the bi-directional path tracing method. catacaustics. The former refer to the caustics formed by the re- This solution improved the quality of caustics, but the changes fraction of light rays, while the latter denote the caustics formed in the direction of light reflection resulted in large variance, by the reflection of light rays (Fig. 1). The shape of a caustic is which in turn increased the amount of noise. determined by the shape of the reflective or refractive surface, The metropolis light transport method significantly im- as well as its position in relation to the light source [1]. proved the quality of rendered images by decreasing the amount of noise whilst maintaining the crucial attributes associated with global illumination. The use of caustic perturbations provided the ability to achieve a more realistic caustic effect [7]. In 1996, the method based on path tracing was extended by introducing a photon map [8]. This approach was designed to enhance the rendering of both direct and indirect light effects, including caustics. Today, the photon mapping method is one of the most popular algorithms employed by commercial ren- dering engines, such as V-Ray Chaos Group, Nvidia Mental Fig. 1. Scheme showing the generation of diacaustics (on the left) and catacaustics (on the right) Ray or YafaRay. 2.1. Rendering caustics with photon mapping. The photon The rendering of caustics involves the simulation of a light mapping algorithm assumes a two-stage process. The first stage path in a virtual scene. In this case the light path can be de- consists in emitting from the light source and tracing through scribed by the light transport notation as L(D)*(S)+DE [2]., the scene a defined number of photons. When the photon hits where L denotes the light source, S denotes a specular surface, the diffusive surface, information about the position of the hit D – diffusive surface and E – the observer. The * operator de- point, photon energy and incoming vector, are saved into a data notes the occurrence of zero or more events, while the + oper- structure called the photon map. If the surface is specular or ator denotes one or more events. However, the simulation of refractive, the photon is propagated further according to the a light transport path is a very complex and computationally law of reflection and Snellʼs law, until it finally hits the diffu- expensive process. Thus, the stochastic Monte Carlo methods sive surface. Then, depending on its coefficient of probability, have been applied to this purpose [3]. the photon is either absorbed or reflected with a scaled energy value. The process is repeated until it reaches a specified depth *e-mail: [email protected] of recursion. The second stage is the classical ray-tracing ren- Bull. Pol. Ac.: Tech. 65(3) 2017 361 Brought to you by | Gdansk University of Technology Authenticated Download Date | 8/2/17 10:34 AM K. Guzek and P. Napieralski dering of the scene using the information collected in the photon photon mapping is the selection of the data search technique map [9]. Photon mapping estimates the irradiance at a point applied to radiance estimation. It is assumed that most (95%) of where a photon strikes, i.e. intersects a surface, by adding up the rendering time is used for gathering photons [18]. the flux of the nearest photons in the area aroundK. Guzek,that intersec P. Napieralski- Rescaling photon energy could affect the simulation of light tion point. The result of irradiance estimation is prone to bias concentration, while preserving single data structure. on the nearest-neighbourerrors. In particular, density it may estimation, be affected due by proximity, to which theboundary3. Enhancing caustics with Streamed Photon estimation resultor topological converges bias. with The proximity the weighted bias is average related to of the light problem Mapping energy depositedof density in the estimation, area surrounding relying on thethe intersectionnearest-neighbour point. density 3. Enhancing caustics with streamed The Streamed Photon Mapping method proposed in [19] is a The boundaryestimation, bias manifests due to which itself inthe the estimation darkening result of converges polygon with photon mapping edges, wheretheno weighted photons average are stored. of light Topologicalenergy deposited bias in results the area surmodification- of the classic Photon Mapping. Its aim is to en- from the assumptionrounding the that intersection the considered point. geometry The boundary is flat. bias Thus, manifestshance The the streamed search for photon neighbouring mapping photonsmethod byproposed assembling in [19] pho- is any curved surfaceitself in the leads darkening to overestimation of polygon edges, of flux where density no photons [10]. aretons a into modification streams andof the thus classic improve photon the mapping. quality ofIts globalaim is to il- stored. Topological bias results from the assumption that thelumination enhance effects, the search such for as neighbouring caustics, colour photons bleeding by assembling and soft A few methodsconsidered have geometry been proposed is flat. Thus, to eliminate any curved the surface estima- leads shadows.to photons into streams and thus improve the quality of global tion bias. Rayoverestimation Mapping, of proposed flux density by [10]. Lastra et al. [11], de- A streamillumination of photons effects, issuch defined as caustics, by the colour so called bleeding leading and pho-soft parted from theAassumption few methods thathave the been area proposed surrounding to eliminate the sam-the estimaton,- whichshadows. indicates the direction of propagation of the stream, pling pointtion is flat. bias. InRay their mapping, method, proposed the densityby Lastra estimation et al. [11], departed is A stream of photons is defined by the so called leading and a number of associated photons (n fa), with directions of performed onfrom the the plane assumption tangent that tothe a area surface surrounding point the on sampling the ba- point photon, which indicates the direction of propagation of the propagation deviating from the direction of the( leading) photon sis of the vectoris flat. ofIn their photon method, propagation the density direction estimation rather is performed than on stream, and a number of associated photons nfa , with direc- the plane tangent to a surface point on the basis of the vectorin thetions area of with propagation a radius deviating(rs). The from number the direction of streams of the(n leadingfs), the the very hit point. An example of an efficient ray map was of photon propagation direction rather than the very hit point.number photon of associated in the area photonswith a radius in the (r streams). The number(n fa) ofand streams radius introduced by Havran [12]. Tobler and Maierhofer [13] sug- s An example of an efficient ray map was introduced by Havran(rs ) are(nfs) parameters, the number defined of associated by the photons user. The in the input streams energy (nfa of) gested replacing the circular estimation area with an octagon [12]. Tobler and Maierhofer [13] suggested replacing the circulara singleand streamradius ( isrs) calculatedare parameters based defined on the by energythe user. of The the input light or eight octagonsestimation to area eliminate with an undesired octagon orshadow eight octagons leaks to close eliminatesource energy and of the a single number stream of emitted is calculated streams, based according on the energy to theof to wall corners.undesired Such shadow an approach leaks close enables to wall precisecorners. estimationSuch an approachfollowing the light formula: source and the number of emitted streams, according of indirectenables illumination precise close estimation to the of edgesindirect of illumination objects and close on to the to the following formula: edges of objects and on relatively small isolated objects. relatively small isolated objects. Ez Frisvad et al. [14] proposed a photon splatting technique Es = , (1)(1) Frisvad etwhich al. reduces [14] proposed noise and a blur photon in the splattingrendering techniqueof caustics. They n fs which reducesused noise photon and differentials blur in the to rendering determine ofthe caustics.