원시데이터 수집 시스템
선정목록으로

BRDF Importance Sampling for Linear Lights

관련 필름·전자재료 · (13) 프리즘 필름

기본 정보

저자
  1. Christoph Peters — Karlsruhe Institute of Technology
DOI
10.1111/cgf.14379
저널
Computer Graphics Forum
발행년도
2021
발행기관
Wiley
피인용수
1
라이선스
cc-by-nc-nd
논문 유형
–
언어
–
원문 페이지
https://doi.org/10.1111/cgf.14379
토픽
Surface Roughness and Optical Measurements
OpenAlex ID
W3179788358

평가 내용

관련도
관련
사업분야
필름·전자재료 · (13) 프리즘 필름
부 분야
–
R&D 측면
–
확신도
–
근거 용어
–
판단 근거
임베딩 유사도 기반 평가로 '필름·전자재료 > 프리즘 필름' 분야에 선정된 논문입니다.
R&D 활용 포인트
–
평가 입력
–

초록

Abstract We introduce an efficient method to sample linear lights, i.e. infinitesimally thin cylinders, proportional to projected solid angle. Our method uses inverse function sampling with a specialized iterative procedure that converges to high accuracy in only two iterations. It also allows us to sample proportional to a linearly transformed cosine. By combining both sampling techniques through suitable multiple importance sampling heuristics and by using good stratification, we achieve unbiased diffuse and specular real‐time shading with low variance outside penumbrae at two samples per pixel. Additionally, we provide a fast method for solid angle sampling.

본문 54,748자

본문 펼치기
[DOI: 10.1111/cgf.14379](https://doi.org/10.1111/cgf.14379) High-Performance Graphics 2021 N. Binder and T. Ritschel (Guest Editors) _Volume 40_ ( _2021_ ), _Number 8_ # BRDF Importance Sampling for Linear Lights Christoph Peters <sup>1</sup> 1Karlsruhe Institute of Technology 11.285 Clipped solid angle sampling, 1.1 ms 8.863 Our projected solid angle sampling, 1.1 ms 0.583 Our projected solid angle and LTC sampling with MIS, 1.5 ms Reference Figure 1: _The_ _bistro_ _exterior_ _(2.9_ _million_ _triangles),_ _lit_ _by_ _a_ _long_ _linear_ _light_ _source._ _We_ _compute_ _shading_ _using_ _Monte_ _Carlo_ _integration_ _with ray traced shadows. Taking one sample per pixel proportional to solid angle yields moderate noise throughout the scene. Our projected_ _solid_ _angle_ _sampling_ _achieves_ _clean_ _diffuse_ _shading_ _outside_ _penumbrae_ _but_ _specular_ _highlights_ _remain_ _noisy._ _If_ _we_ _take_ _a_ _second_ _sample_ _proportional to a linearly transformed cosine [HDHN16] and combine both techniques using clamped optimal MIS [Pet21], noise outside_ _penumbrae becomes weak everywhere. Timings are full frame times at_ 1920 _×_ 1080 _on an NVIDIA RTX 2080 Ti, numbers are RMSEs._ Abstract _We introduce an efficient method to sample linear lights, i.e. infinitesimally thin cylinders, proportional to projected solid angle._ _Our method uses inverse function sampling with a specialized iterative procedure that converges to high accuracy in only two_ _iterations. It_ _also_ _allows_ _us_ _to_ _sample_ _proportional to a linearly transformed_ _cosine. By combining_ _both_ _sampling_ _techniques_ _through_ _suitable_ _multiple_ _importance_ _sampling_ _heuristics_ _and_ _by_ _using_ _good_ _stratification,_ _we_ _achieve_ _unbiased_ _diffuse_ _and_ _specular_ _real-time_ _shading_ _with_ _low_ _variance_ _outside_ _penumbrae_ _at_ _two_ _samples_ _per_ _pixel._ _Additionally,_ _we_ _provide_ _a_ _fast_ _method for solid angle sampling._ Categories and Subject Descriptors (according to ACM CCS): I.3.7 [Computer Graphics]: Three-Dimensional Graphics and Realism—Color, shading, shadowing, and texture 1. Introduction Through new graphics hardware, real-time ray tracing has become practical. Nonetheless, real-time renderers have to limit their ray budget to a few rays per pixel. With generic path tracers, the variance at such low sample counts is too high. GPUfriendly importance sampling techniques for specific light transport phenomena are in high demand. We provide such a method for direct lighting with linear lights, which are an excellent idealization of fluorescent tubes. According to the reflection equation, the reflected radiance in direction ω _o ∈_ Ω is where Ω _⊂_ R <sup>3</sup> is the hemisphere around the surface normal _n ∈_ R <sup>3</sup>, _f_ is the bidirectional reflectance distribution function (BRDF), _Li_ gives incoming radiance due to the light source, _V_ (ω _i_ ) _∈{_ 0 _,_ 1 _}_ is light visibility and _⟨n,_ ω _i⟩_ denotes a dot product for the cosine term. A Monte Carlo estimator takes random samples ω _i_ from Ω proportional to a known density _p_ (ω _i_ ) and estimates the integral as _<u>Li</u>_ <u>(ω</u> _<u>i</u>_ <u>)</u> _<u>V</u>_ <u>(ω</u> _<u>i</u>_ <u>)</u> _<u>f</u>_ <u>(ω</u> _<u>i,</u>_ <u>ω</u> _<u>o</u>_ <u>)</u> _<u>⟨n,</u>_ <u>ω</u> _<u>i⟩</u>_ . _p_ (ω _i_ ) To cancel most of the variance, _p_ (ω _i_ ) should be nearly proportional to the integrand. For direct lighting with Lambertian emitters, _Li_ (ω _i_ ) is constant within the solid angle of the light source and zero elsewhere. Then techniques that sample this solid angle uniformly _Lo_ (ω _o_ ) = Ω _Li_ (ω _i_ ) _V_ (ω _i_ ) _f_ (ω _i,_ ω _o_ ) _⟨n,_ ω _i⟩_ dω _i_ © 2021 The Author(s). Computer Graphics Forum published by Eurographics - The European Association for Computer Graphics and John Wiley & Sons Ltd. This is an open access article under the terms of the Creative Commons Attribution-NonCommercialNoDerivs License, which permits use and distribution in any medium, provided the original work is properly cited, the use is non-commercial and no modifications or adaptations are made. 32 _C. Peters / BRDF Importance Sampling for Linear Lights_ [Wan92, Arv95, UnFK13, Gam16, GUnK <sup>_∗_</sup> 17] give a Monte Carlo estimate that is proportional to _V_ (ω _i_ ) _f_ (ω _i,_ ω _o_ ) _⟨n,_ ω _i⟩_ . No rays are wasted on directions that miss the light but the BRDF and cosine-term may introduce strong variance. Alternatively, we can sample the whole hemisphere proportional to BRDF times cosine [Hd14]. Then the Monte Carlo estimate is nearly proportional to _Li_ (ω _i_ ) _V_ (ω _i_ ). If the light source is small, most samples miss it. In fact, our linear lights are never hit. An ideal sampling technique would distribute samples proportional to BRDF times cosine but only within the solid angle of the light source. With such a technique, the only remaining source of noise is the visibility term _V_ (ω _i_ ). Sampling proportional to the visibility term requires global scene knowledge but neglecting it only introduces noise in penumbrae. To provide such a technique for diffuse BRDFs, we sample linear lights proportional to the cosine term _⟨n,_ ω _i⟩_ . In other words, we sample their projected solid angle uniformly. Our method accomplishes this goal by inverse function sampling with a highly optimized numerical inversion (Sec. 3). Our error analysis shows that it always converges to high accuracy in only two iterations. The implementation is thoroughly optimized and some of these ideas also apply to solid angle sampling of linear lights. Once we can sample linear lights proportional to a cosine, we can also sample them proportional to a linearly transformed cosine (LTC) [HDHN16]. That gives rise to a suitable sampling strategy for specular BRDFs (Sec. 4). We combine this strategy with projected solid angle sampling through clamped optimal MIS [Pet21]. Our sampling techniques enable unbiased shading for linear lights, with ray traced shadows and minimal noise outside of penumbrae (Fig. 1). Blue noise dithering and uniform jittered sampling [RAMN12] are highly effective for the one-dimensional linear lights (Sec. 5.3). Hence, even the shadows have good quality at two samples per pixel (one specular, one diffuse). Two prior works offer similar functionality but they are either prone to branch divergence [LADL18] or slower by a constant factor [Pet21] (Sec. 5.4). The full source code of our renderer is available. 2. Related Work There is extensive prior work on linear lights, partly because fluorescent tubes are widely used and partly because integration in one dimension is easier than in two. Early work on diffuse shading [NON85] solves special cases in closed form and relies on quadrature for the general case. Approximate [PA91] and exact [BP93] closed-form solutions for Phong shading followed. Picott [Pic92] presents a closed form for diffuse shading using a slightly different formulation, where the linear light is not an infinitesimally thin cylinder but a sequence of point lights. For specular shading, he proposes a most representative point approach, an approximation that persists in real-time rendering until today [Dro14, dCI17]. These older works advocate variants of shadow volumes [NON85, PA91, BP93, Pic92] whereas our method offers sampling for Monte Carlo integration. Ramamoorthi et. al. [RAMN12] use ray tracing and study the impact of different strategies for stratification on shadows (see Sec. 5.3). As a form of importance sampling, Gamito [Gam16] samples the solid angle of cylinders and disks of finite radius uniformly. The method samples a bounding rectangle using an exact method [UnFK13] and rejects samples outside of the relevant solid angle at the caps. Our method does not reject any samples because it takes the cylinder radius to zero in the limit. Solid angle sampling is available for all common types of area lights. For spheres [Wan92] and triangles [Arv95, Pet21], there are closed-form solutions. For ellipses and ellipsoids [Hei17] a method involving Newton-Raphson iterations and look-up tables exists [GUnK <sup>_∗_</sup> 17]. Still more effective importance sampling for diffuse shading takes samples proportional to the cosine term _⟨n,_ ω _i⟩_ (like our technique). For spheres that can be done through iterative root finding [UnG18] or in closed form [PD19]. For polygons, there are methods based on recursive subdivision [Un00], Newton’s method [Arv01] or special iterative algorithms [Pet21]. All of these could be combined with rejection sampling [Gam16] to sample cylinders of finite size in proportion to projected solid angle. However, we strive for a faster, more specialized solution. Projected solid angle sampling and LTC importance sampling of linear lights are also useful for differentiable rendering because moving edges make strong contributions to derivatives [LADL18]. The implementation used there employs costly Newton bisection for inverse function sampling. Our method uses a more specialized procedure that always converges in two iterations and is more thoroughly optimized. Recently, sampling problems have been studied more fundamentally. The triangle cut parametrization warps samples of a suitable approximate density into samples of another density [Hei20]. In one dimension, it still consumes two random numbers such that stratification is lost. Hart et al. [HPM <sup>_∗_</sup> 20] approximate a target density in primary sample space with linear or quadratic polynomials and sample proportional to those. LTCs [HDHN16] provide good approximations of many specular BRDFs. With this approximation, computation of unshadowed specular shading reduces to computation of the projected solid angle of the transformed light source. We use them for sampling. They also work for linear lights [HH17a] and disk lights [HH17b]. Dupuy et al. [DHB17] present a similar method for specular importance sampling of spherical lights. It is efficient but struggles with anisotropic highlight shapes. Moureau et al. [MPC19] describe a GPU-friendly hierarchical data structure to select important lights among thousands of dynamic lights. Most renderers combine strategies for sampling of light sources with methods to sample in proportion to the BRDF [Hd14] through multiple importance sampling (MIS) [VG95]. However, this approach is ineffective for linear lights since all samples miss the light. © 2021 The Author(s) Computer Graphics Forum © 2021 The Eurographics Association and John Wiley & Sons Ltd. _C. Peters / BRDF Importance Sampling for Linear Lights_ 33 _l_ 0 _R_ _q_ _l_ 1 _t_ _q_ _φR_ _t_ _R_ _l_ 0 _q_ _l_ 1 2 _R_ _l_ 0, _s_ _l_ 1, _s_ _t_ _u_ _s_ _s_ _u_ 0 0 (c) _View of the st-plane._ 0 (a) _The cylinder in relation to a shading point._ (b) _View of the ut-plane._ Figure 2: _A cylinder and its solid angle. Looking straight at a cap of the cylinder, we see that the solid angle has an opening angle_ ϕ _R. A_ _side view reveals that its extent can be described by the projection of its end points onto the sphere in the limit case R →_ 0 _._ 3. Sampling Linear Lights for Diffuse Shading Our method samples the solid angle of linear lights exactly proportional to the cosine term _⟨n,_ ω _i⟩_ . Then the Monte Carlo estimator for Lambertian emitters is proportional to _V_ (ω _i_ ) _f_ (ω _i,_ ω _o_ ). For diffuse BRDFs that gives low variance and we address specular BRDFs in Sec. 4. In the following, we derive formulas for the solid angle (Sec. 3.1) and projected solid angle of linear lights (Sec. 3.2). To perform inverse function sampling, we introduce an iterative inversion method (Sec. 3.3) with low error (Sec. 3.4). We optimize these methods thoroughly and also apply them for solid angle sampling (Sec. 3.5). 3.1. The Solid Angle of a Line As starting point, we need a proper definition of a linear light and we need to compute its solid angle. These considerations are not novel [NON85, BP93] but serve to fix the notation and to establish building blocks for an efficient algorithm. We follow the notion (unlike Picott [Pic92]) that a linear light is an infinitesimally thin cylinder. This model is a good fit for fluorescent tubes. Lambertian emitters are the easiest to implement but arbitrary emission profiles are applicable, possibly at the cost of increased variance [Pet21]. We could treat linear lights as limit case of rectangular lights [Pet21] but the self-contained approach presented here leads to an efficient formulation more easily. Let _l_ 0 _,_ _l_ 1 _∈_ R <sup>3</sup> with _l_ 0 _̸_ = _l_ 1 be the end points of the cylinder, i.e. the center points of its caps (Figure 2a). We work in a coordinate frame where the shading point is the origin. Let _R_ _>_ 0 be the cylinder radius, which we take to zero in the limit. The normalized line direction is given by _<u>l</u>_ <u>1</u> _<u>−</u>_ _<u>l</u>_ <u>0</u> _s_ := _∥l_ 1 _−_ _l_ 0 _∥_ <sup>_∈_</sup> <sup>S2,</sup> where S <sup>2</sup> _⊂_ R <sup>3</sup> denotes the unit sphere. We are interested in the solid angle of this cylinder. To this end, we consider the point _q_ closest to the origin on the infinite central axis of the cylinder. We © 2021 The Author(s) Computer Graphics Forum © 2021 The Eurographics Association and John Wiley & Sons Ltd. are also interested in the direction _t_ towards this point: _<u>q</u>_ _q_ := _l_ 0 _−⟨l_ 0 _, s⟩_ _s ∈_ R <sup>3</sup>, _t_ := _∥q∥_ <sup>_∈_</sup> <sup>S2.</sup> Together, the directions _s_, _t_ and _u_ := _s ×_ _t_ form an orthonormal coordinate frame. Viewing the geometric configuration in this frame simplifies the derivation of the solid angle. In the _ut_ -plane, the cylinder appears as circle of radius _R_ (Figure 2b). Its opening angle with respect to the shading point is ϕ _R_ := arcsin <sup>_<u>R</u>_</sup> _∥q∥_ <sup>.</sup> In the _st_ -plane, the cylinder appears as axis-aligned rectangle of height 2 _R_ (Figure 2c). Since we eventually take _R_ to zero, there is no need to bother with the exact shape of the caps. We capture the extent by storing _s_ -coordinates for the normalized end points of the line: _l_ 0 _,s_ := <sup>_<u>⟨l</u>_</sup> <sup><u>0</u></sup> <sup>_<u>, s⟩</u>_</sup> _∥l_ 0 _∥_ <sup>_<u>l</u>_</sup> <sup><u>0</u></sup> <sup>_<u>, s⟩</u>_</sup> _l_ 1 _,s_ := <sup>_<u>⟨l</u>_</sup> <sup><u>1</u></sup> <sup>_<u>, s⟩</u>_</sup> _∥l_ 0 _∥_ <sup>_∈_</sup> <sup>R,</sup> _∥l_ 1 _∥_ <sup>_<u>l</u>_</sup> <sup><u>1</u></sup> <sup>_<u>, s⟩</u>_</sup> _∥l_ 1 _∥_ <sup>_∈_</sup> <sup>R.</sup> Now we are prepared to compute the solid angle of the cylinder (with incorrect caps). We write it as integral over the hemisphere in cylindrical coordinates (see [PJH16] chapter 13.6.1): - _l_ 1 _,s_ Ω _R_ := _l_ 0 _,s_ - ϕ _R_ 1dϕ dω _s_ = 2ϕ _R_ ( _l_ 1 _,s −_ _l_ 0 _,s_ ). (1) _−_ ϕ _R_ The angle ϕ is an azimuthal coordinate around the central axis of the cylinder and ω _s ∈_ [ _−_ 1 _,_ 1] is the _s_ -coordinate of a unit-direction vector. For _R_ = 0, this solid angle is zero because ϕ _R_ = 0. Thus, we divide out _R >_ 0 before we take the limit: <u>dΩ</u> _<u>R</u>_ <u>ϕ</u> _<u>R</u>_ <u>1</u> d _R_ <sup>:=</sup> _∥q∥_ <sup>.</sup> d <sup><u>ϕ</u></sup> _R_ <sup>_<u>R</u>_</sup> <sup>(</sup> <sup>_l_</sup> <sup>1</sup> <sup>_,s −_</sup> <sup>_l_</sup> <sup>0</sup> <sup>_,s_</sup> <sup>),</sup> <u>ddϕ</u> _RR_ d _R_ <sup>:=</sup> _R_ <sup>lim</sup> _→_ 0 <u>Ω</u> _<u>R</u>_ _R→_ 0 <u>Ω</u> _RR_ <sup>= 2</sup> <sup><u>d</u></sup> d <sup><u>ϕ</u></sup> _R_ <sup>_<u>R</u>_</sup> According to L’Hôpital’s rule, the same result is attained by taking the derivative at _R_ = 0. Hence, the choice of notation. We discuss the construction of Monte Carlo estimates in this setting below. This derivation directly implies a strategy to sample linear 34 _C. Peters / BRDF Importance Sampling for Linear Lights_ lights proportional to solid angle, which is a limit case of prior work [Gam16]. Since the integrand in Equation (1) is constant, we simply sample ω _s_ uniformly in [ _l_ 0 _,s,_ _l_ 1 _,s_ ], set ω _t_ := �1 _−_ ω <sup>2</sup> _s_ and return ω _ss_ + ω _tt_ as sampled direction. Sec. 3.5 describes the implementation in more detail. _F_ 0.3, <sup>−1</sup> −0.95 The limit of the sampled density times radius is the reciprocal of the solid angle per radius <sup><u>d</u></sup> d <sup><u>Ω</u></sup> _R_ <sup>_<u>R</u>_</sup> <sup>. We specify the brightness of the</sup> linear light through the limit of radiance times radius. Then the integrand of the rendering equation and the term for the density both contain the infinitesimal radius as factor. It cancels out and we are left with a finite radiance. With this convention, the brightness is a physically meaningful quantity with unit srW _·_ m <sup>(or the photometric</sup> counterpart nit _·_ m). 3.2. Sampling the Projected Solid Angle of a Line To obtain the projected solid angle from the above formulation of the solid angle, we introduce a cosine term for the surface normal _n ∈_ S <sup>2</sup> . The normal has local coordinates _ns_ := _⟨n, s⟩_, _nt_ := _⟨n, t⟩_ . Recall that the local coordinate ω _s_ _∈_ [ _l_ 0 _,s,_ _l_ 1 _,s_ ] corresponds to the normalized direction ω _ss_ + �1 _−_ ω <sup>2</sup> _s_ _t_ . Thus, the projected solid angle per radius for _R →_ 0 is 1.0 0.5 0.0 −0.5 −1.0 _F_ 0.71, <sup>−1</sup> −0.71 _F_ 1, 0 <sup>−1</sup> _F_ 0.71, 0.71 <sup>−1</sup> _F_ 0, 1 <sup>−1</sup> ~~−~~ <sup>_<u>π</u>_</sup> <u>2</u> <sup>_<u>π</u>_</sup> <u>2</u> ~~−~~ <sup>_<u>π</u>_</sup> <u>4</u> <sup>_<u>π</u>_</sup> <u>4</u> 0 _<u>π</u>_ <u>4</u> _<u>π</u>_ <u>2</u> Integral _Fns_, _nt_ <u>dΩ</u> <sup>_⊥_</sup> _<u>r</u>_ := 2 <sup><u>dϕ</u></sup> <sup>_<u>R</u>_</sup> d _R_ d _R_ - _l_ 1 _,s_ _l_ 0 _,s_ - _l_ 1 _,s_ _n,_ ω _ss_ + - 1 _−_ ω <sup>2</sup> _s_ _t_ dω _s_ = 2 <sup><u>dϕ</u></sup> <sup>_<u>R</u>_</sup> d _R_ _l_ 0 _,s_ 1 _−_ ω <sup>2</sup> _s_ dω _s_ _ns_ ω _s_ + _nt_ = <sup><u>d</u></sup> d <sup><u>ϕ</u></sup> _R_ <sup>_<u>R</u>_</sup> <sup>(</sup> <sup>_Fns,nt_</sup> <sup>(</sup> <sup>_l_</sup> <sup>1</sup> <sup>_,s_</sup> <sup>)</sup> <sup>_−_</sup> <sup>_Fns,nt_</sup> <sup>(</sup> <sup>_l_</sup> <sup>0</sup> <sup>_,s_</sup> <sup>)),</sup> (2) where we use the indefinite integral Figure 3: _Plots_ _of_ _the_ _inverse_ _distribution_ _function_ _Fn_ <sup>_−_</sup> _s,n_ <sup>1</sup> _t_ <sup>_for_</sup> <sup>_five_</sup> _choices of ns,_ _nt_ _. At the left domain boundary, the derivative always_ _approaches_ _infinity._ _For_ _nt_ _near_ _−_ 1 _(orange,_ _blue),_ _the_ _domain_ _shrinks_ _and_ _the_ _function_ _becomes_ _steep._ _F_ <sup>_−_</sup> <sup>1</sup> 1 _,_ 0 <sup>_(green)_</sup> <sup>_is_</sup> <sup>_simply_</sup> <sup>_a_</sup> _square root._ _Fns,nt_, we are dealing with a one-dimensional family of functions to invert. Fig. 3 shows examples. It is possible to use a twodimensional lookup table but that requires a high resolution at boundaries and memory access at random locations thrashes caches. Instead, we take inspiration from recent work [Pet21] and design a specialized iterative procedure with rapid convergence. For our iterative procedure, we make the substitution α := arcsin ω _s_ and consider _Gns,nt_ (α) := _Fns,nt_ (sin α) = _ns_ sin <sup>2</sup> α + _nt_ (cos α sin α + α). Evaluation of this function does not involve costly inverse trigonometric functions and it is more well-behaved. In fact, quadratic Taylor expansions give good local fits of _Gns,nt_ (α). Our iterative method exploits that. In each step, it constructs a quadratic Taylor polynomial around the current estimate of α and solves Equation (4) with this approximation. The equation turns into a quadratic. Among the two solutions, we pick the one that is closer to the current estimate. If there are no roots, we take the extremum of the quadratic instead to safeguard against rare numerical issues. This approach can be thought of as quadratic generalization of Newton’s method. It is known as Halley’s irrational formula or Laguerre’s method [ST95]. Laguerre’s method is popular for polynomial root finding but uncommon as general root finding method [PTVF07]. Sec. 3.4 demonstrates that it works well here. For the initialization, we use solid angle sampling. As derived in Sec. 3.1, that means that we simply set ω _s_ to _l_ 0 _,s_ + ξ( _l_ 1 _,s −_ _l_ 0 _,s_ ). Thus, this initialization is extremely efficient. We proceed to show that it is also accurate enough. Algorithm 2 summarizes our inversion procedure. 3.4. Error Analysis To avoid branch divergence on GPUs, we want to use a small, fixed iteration count. However, we also want our renderer to be © 2021 The Author(s) Computer Graphics Forum © 2021 The Eurographics Association and John Wiley & Sons Ltd. _Fns,nt_ (ω _s_ ) := _ns_ ω <sup>2</sup> _s_ <sup>+</sup> <sup>_n_</sup> _t_ _Fns,nt_ (ω _s_ ) := _ns_ ω <sup>2</sup> _s_ - <sup>�</sup> 1 _−_ ω <sup>2</sup> _s_ ω _s_ + arcsin ω _s_ �. (3) The dot product in this integral must not be negative. Therefore, we clip the line connecting _l_ 0 to _l_ 1 against the tangent plane of the surface. We intend to use inverse function sampling to sample this projected solid angle uniformly. Our sampling procedure consumes a single uniform random number ξ in [0 _,_ 1). The sample coordinate ω _s_ has to be chosen so that the value of the distribution function matches the random number, i.e. <u>dϕ</u> _<u>R</u>_ _<u>r</u>_ (4) d _R_ <sup>(</sup> <sup>_Fns,nt_</sup> <sup>(ω</sup> <sup>_s_</sup> <sup>)</sup> <sup>_−_</sup> <sup>_Fns,nt_</sup> <sup>(</sup> <sup>_l_</sup> <sup>0</sup> <sup>_,s_</sup> <sup>)) = ξ</sup> <sup><u>d</u></sup> d <sup><u>Ω</u></sup> _R_ <sup>_⊥_</sup> <sup>.</sup> Assuming that we can evaluate the inverse distribution function _Fn_ <sup>_−_</sup> _s,n_ <sup>1</sup> _t_ <sup>, the solution is</sup> ω _s_ = _Fn_ <sup>_−_</sup> _s,n_ <sup>1</sup> _t_ ξ <sup><u>d</u></sup> <sup>_<u>R</u>_</sup> dϕ _R_ <u>ddΩ</u> _R_ <sup>_⊥_</sup> _<u>r</u>_ <sup>+</sup> <sup>_Fns,nt_</sup> <sup>(</sup> <sup>_l_</sup> <sup>0</sup> <sup>_,s_</sup> <sup>)</sup> . The whole sampling procedure, including optimizations described in Section 3.5, is summarized in Algorithm 1. 3.3. Inversion of the Distribution Function Inversion of _Fns,nt_ is challenging. A closed-form solution appears to be impossible. Since scaling of ( _ns,_ _nt_ ) only scales the integral _C. Peters / BRDF Importance Sampling for Linear Lights_ 35 (a) _Backward error_ 10 <sup>−2</sup> 10 <sup>−3</sup> 10 <sup>−4</sup> 10 <sup>−5</sup> 10 <sup>−6</sup> 10 <sup>−7</sup> (b) _Backward error times brightness_ Figure 4: _Errors_ _for_ _diffuse_ _samples_ _in_ _a_ _variant_ _of_ _Fig._ _6._ _The_ _linear light is cut in half such that it does not get close to the back_ _wall._ unbiased. Thus, we have to be sure that our method converges to sufficient accuracy in all cases. Since the beginning and the end of the line influence the initialization, the set of all test cases is fourdimensional. Once again, we take inspiration from recent work [Pet21]. We run the Nelder-Mead optimizer [NM65] in 80-bit float arithmetic to find a line that maximizes the error of our iterative procedure. Since Nelder-Mead is just a local optimizer, we try 28 billion random initializations. Sometimes the iteration is unstable near the endpoints of the linear light. However, the initialization is nearly perfect there. Thus, we skip the iteration if ξ _<_ 10 <sup>_−_</sup> <sup>5</sup> or ξ _>_ 1 _−_ 10 <sup>_−_</sup> <sup>5</sup> . As error metric, we use a backward error, namely the perturbation in the random number ξ that suffices to explain the error in the output. This way, we find that the worst possible error after two iterations is 1 _._ 58 _·_ 10 <sup>_−_</sup> <sup>5</sup> . On this basis, we consider our method unbiased. In practice, rounding errors in single-precision arithmetic are far more influential than these theoretical errors (Fig. 4a). The main problem is a cancellation in Equation (2). The indefinite integral _Fns,nt_ corresponds to the projected solid angle of a line starting at the closest point _q_ . When the actual projected solid angle is much smaller, we lose precision. However, that only happens in dark regions along the infinite extension of the line. If we take that into account, errors are always low (Fig. 4b). Therefore, we choose not to invest computational resources to avoid this cancellation. 3.5. Optimizations Conceptually, it is useful to work with the coordinate frame _s,t_ but in practice we skip computation of _t_ _∈_ S <sup>2</sup> . We only need it for two purposes: To compute _nt_ and to construct directions ω _ss_ + ω _tt_ . In both cases, we exploit <u>1</u> _t_ = _∥q∥_ <sup>(</sup> <sup>_l_</sup> <sup>0</sup> <sup>_−⟨l_</sup> <sup>0</sup> <sup>_, s⟩_</sup> <sup>_s_</sup> <sup>)</sup> <sup>.</sup> © 2021 The Author(s) Computer Graphics Forum © 2021 The Eurographics Association and John Wiley & Sons Ltd. Algorithm 1 sample_line_projected_solid_angle Input: Line begin _l_ 0 _∈_ R <sup>3</sup>, line direction _s ∈_ S <sup>2</sup>, line length _L >_ 0, shading normal _n ∈_ S <sup>2</sup>, uniform random number ξ _∈_ [0 _,_ 1). Output: Sampled direction ω _i_, density in solid angle measure times radius _p_ (ω _<u>i</u>_ )d _R_ . Clip the line against the plane through the origin with normal _n_ If the clipped line is empty: Return no sample. _∥q∥_ <sup>2</sup> := _⟨l_ 0 _, l_ 0 _⟩−⟨s, l_ 0 _⟩_ <sup>2</sup> <u>1</u> <u>1</u> _∥q∥_ <sup>:=</sup> ~~<u>�</u>~~ _∥q∥_ <sup>2</sup> _<u>⟨l</u>_ <u>0</u> _<u>, s⟩</u>_ _l_ 0 _,s_ := <u>�</u> _⟨l_ 0 _, l_ 0 _⟩_ _<u>⟨l</u>_ <u>0</u> _<u>, s⟩</u>_ <u>+</u> _<u>L</u>_ _l_ 1 _,s_ := <u>�(</u> _⟨l_ 0 _, s⟩_ + _L_ ) <sup>2</sup> + _∥q∥_ <sup>2</sup> _ns_ := _⟨n, s⟩_ <u>1</u> _nt_ := _∥q∥_ <sup>(</sup> <sup>_⟨n, l_</sup> <sup>0</sup> <sup>_⟩−_</sup> <sup>_ns ⟨l_</sup> <sup>0</sup> <sup>_, s⟩_</sup> <sup>)</sup> _E_ := _Fns,nt_ ( _l_ 1 _,s_ ) _−_ _Fns,nt_ ( _l_ 0 _,s_ ) // see Equation (3) <u>ddΩ</u> _R_ <sup>_⊥_</sup> _<u>r</u>_ := _∥_ <u>1</u> _q∥_ <sup>_E_</sup> ω _s_ := _l_ 0 _,s_ + ξ( _l_ 1 _,s −_ _l_ 0 _,s_ ) If ξ _≥_ 10 <sup>_−_</sup> <sup>5</sup> and ξ _≤_ 1 _−_ 10 <sup>_−_</sup> <sup>5</sup> : ω _s,_ ω _t_ := invert_line_sampling_cdf - _ns,_ _nt_ _,_ ω _s,_ ξ _E_ + _Fns,nt_ ( _l_ 0 _,s_ )� else: ω _t_ := ~~�~~ 1 _−_ ω <sup>2</sup> _s_ // solid angle sampling - _s_ + <sup><u>1</u></sup> _∥q∥_ <sup>ω</sup> <sup>_t_</sup> <sup>_l_</sup> <sup>0</sup> - _s_ + <sup><u>1</u></sup> _∥q_ ω _i_ := �ω _s −_ <sup><u>1</u></sup> _∥q∥_ <sup>ω</sup> <sup>_t ⟨l_</sup> <sup>0</sup> <sup>_, s⟩_</sup> �ω _s −_ <sup><u>1</u></sup> _∥q_ Return ω _i,_ (ω _sns_ + ω _t_ _nt_ )� <u>dΩ</u> _⊥r_ d _R_ Then - _−_ 1 - _s_ + <sup><u>ω</u></sup> <sup>_<u>t</u>_</sup> _∥q_ <sup><u>ω</u></sup> <sup>_<u>t</u>_</sup> _∥q∥_ <sup>_l_</sup> <sup>0,</sup> ω _ss_ + ω _tt_ = �ω _s −_ <sup><u>ω</u></sup> <sup>_<u>t</u>_</sup> _∥q_ <sup><u>ω</u></sup> <sup>_<u>t</u>_</sup> _∥q∥_ <sup>_⟨l_</sup> <sup>0</sup> <sup>_, s⟩_</sup> <u>1</u> _nt_ = _∥q∥_ <sup>(</sup> <sup>_⟨n, l_</sup> <sup>0</sup> <sup>_⟩−_</sup> <sup>_ns ⟨l_</sup> <sup>0</sup> <sup>_, s⟩_</sup> <sup>)</sup> <sup>.</sup> For efficiency reasons, lines are represented by their beginning _l_ 0 _∈_ R <sup>3</sup>, their direction _s_ _∈_ S <sup>2</sup> and their length _L_ := _∥l_ 1 _−_ _l_ 0 _∥_ . We precompute these attributes per linear light. Since _l_ 1 = _l_ 0 + _Ls_, we have _⟨l_ 1 _, s⟩_ = _⟨l_ 0 _, s⟩_ + _L_ . Algorithms 1 and 2 implement our method with these optimizations. Our supplementary code additionally eliminates common subexpressions like _⟨l_ 0 _, s⟩_, _⟨l_ 0 _, l_ 0 _⟩_ and _Fns,nt_ ( _l_ 0 _,s_ ). We always clamp coordinates ω _s_ to [ _−_ 1 _,_ 1] to avoid invalid results. Blinn’s quadratic solver [Bli06] makes Algorithm 2 more stable. Besides, it is useful to split Algorithm 1 into a part that executes once per line and another part that runs once per sample. Minor changes turn Algorithm 1 into a heavily optimized implementation of solid angle sampling. We simply omit all lines 36 _C. Peters / BRDF Importance Sampling for Linear Lights_ Algorithm 2 invert_line_sampling_cdf Input: _ns,_ _nt_ _∈_ R, an initialization ω _s ∈_ [ _<u>−</u>_ <u>1</u> _<u>,</u>_ <u>1],</u> _<u>F</u>_ _∈_ R Output: ω _s_ = _Fn_ <sup>_−_</sup> _s,n_ <sup>1</sup> _t_ <sup>(</sup> <sup>_F_</sup> <sup>)</sup> <sup>_∈_</sup> <sup>[</sup> <sup>_−_</sup> <sup>1</sup> <sup>_,_</sup> <sup>1], ω</sup> _t_ <sup>=</sup> �1 _−_ ω <sup>2</sup> _s_ α := arcsin ω _s_ ω _t_ := ~~�~~ 1 _−_ ω <sup>2</sup> _s_ Repeat twice: _G_ δ := ( _ns_ ω _s_ + _nt_ ω _t_ )ω _s_ + _nt_ α _−_ _F_ // = _Gns,nt_ (α) _−_ _F_ _G_ <sup>_′_</sup> := 2( _ns_ ω _s_ + _nt_ ω _t_ )ω _t_ _G_ <sup>_′′_</sup> := 2( _ns_ ω _t −_ _nt_ ω _s_ )ω _t −_ 2( _ns_ ω _s_ + _nt_ ω _t_ )ω _s_ Solve <sup>_<u>G′′</u>_</sup> 2 <sup>β2 +</sup> <sup>_G′_</sup> <sup>β</sup> <sup>+</sup> <sup>_G_</sup> <sup>δ = 0</sup> Let β be the root of smaller magnitude (extremum if none exists) - _,_ <sup><u>π</u></sup> 2 �α + β _,_ _−_ <sup><u>π</u></sup> 2 α := min max ω _s_ := sin α ω _t_ := cos α Return ω _s,_ ω _t_ that deal with _n_ and always take the else-branch for computation of ω _t_ . 4. Sampling Linear Lights for Specular Shading By itself, our projected solid angle sampling gives low variance for diffuse BRDFs but not for specular BRDFs, especially at low roughness (Fig. 1). The same is true for sampling of polygonal lights and we overcome this limitation in the same way [Pet21]. This section briefly describes the necessary steps. For a detailed discussion, we refer to prior work [Pet21]. 4.1. Sampling Linearly Transformed Cosines LTCs [HDHN16] are probability density functions of the form (a) _LTC integral in world space_ (b) _Clamped cosine integral_ Figure 5: _Integration_ _over_ _an_ _LTC_ _is_ _equivalent_ _to_ _integrating_ _a_ _clamped cosine over the solid angle of the transformed light source._ _Note_ _that_ _the_ _horizon_ H _changes_ _through_ _the_ _transformation._ _The_ _LTC is zero in parts of the upper hemisphere and non-zero in parts_ _of the lower hemisphere._ Linear transformations change the opening angle of the cylinder. To account for this effect, we use the correction factor [HH17a] <u>d</u> _<u>R</u>_ . (5) d _Rc_ <sup>:=</sup> <sup>_<u>∥M</u>_</sup> _∥_ <sup>T</sup> _s_ <sup><u>(</u></sup> _×_ <sup>_<u>s</u>_</sup> <sup>_<u>×</u>_</sup> _l_ 0 _∥_ <sup>_<u>l</u>_</sup> <sup><u>0)</u></sup> <sup>_<u>∥</u>_</sup> We multiply it onto densities and divide it out of projected solid angles and LTC shading estimates. 4.2. Combining Diffuse and Specular Samples The LTC density _pM_ is zero in parts of the upper hemisphere (Fig. 5). Thus, we have to combine the corresponding samples with samples from projected solid angle sampling to get an unbiased estimate. Standard MIS heuristics introduce considerable variance outside of penumbrae. For example, the balance heuristic effectively samples the sum of both densities but this density differs from the BRDF times cosine. Therefore, we use clamped optimal MIS [Pet21], which is designed specifically for this situation. To use it, we have to compute estimates of unshadowed diffuse and specular shading _c_ 0 _,_ _c_ 1 as in the original work on LTCs [HDHN16, HH17a]. Both of these are computed per color channel using the readily available projected solid angle of the linear light. All entries of _c_ 0 must be non-zero, so we clamp diffuse albedos to a minimum of 0.01. Then clamped optimal MIS weights are [Pet21] - _<u>M</u>_ <sup>_−_</sup> <sup>1</sup> <u>ω</u> _∥M_ <sup>_−_</sup> <sup>1</sup> ω _∥_ <sup>_,_</sup> <sup>(0</sup> <sup>_,_</sup> <sup>0</sup> <sup>_,_</sup> <sup>1)T</sup> �� _<u>|M</u>_ <sup>_−_</sup> <sup>1</sup> _<u>|</u>_ _∥M_ <sup>_−_</sup> <sup>1</sup> ω _∥_ <sup>3</sup> <sup>,</sup> _pM_ (ω) := <sup><u>1</u></sup> π <sup>max</sup> 0 _,_ where _M ∈_ R <sup>3</sup> <sup>_×_</sup> <sup>3</sup> is chosen so that _pM_ fits a specular BRDF times cosine for a particular outgoing light direction. By construction, integrating an LTC over a solid angle is the same as integrating a cosine distribution over the linearly transformed solid angle (Fig. 5). For sampling, we transform the clipped end points of the linear light to cosine space through _l_ 0 _,c_ := _M_ <sup>_−_</sup> <sup>1</sup> _l_ 0 _,_ _l_ 1 _,c_ := _M_ <sup>_−_</sup> <sup>1</sup> _l_ 1. Since this transformation changes the horizon (Fig. 5a), we clip the line between _l_ 0 _,c_ and _l_ 1 _,c_ a second time. Then we apply our projected solid angle sampling procedure. Resulting samples ω _c ∈_ S <sup>2</sup> get transformed back to world space through _<u>M</u>_ <u>ω</u> _<u>c</u>_ _∥M_ ω _c∥_ <sup>.</sup> When using LTCs for linear lights, there is a potential pitfall: where _j_ _∈{_ 0 _,_ 1 _}_ is the index of the technique that generated the sample ω _j_ _∈_ S <sup>2</sup> and _pk_ (ω _j_ )d _R_ is the density times radius for technique _k_ . The parameter _v ∈_ [0 _,_ 1] blends between the standard balance heuristic and a weighted balance heuristic, which is optimal under idealizing assumptions such as no occlusion [Pet21]. Setting _v_ = 0 _._ 5 works well in practice. 5. Results In the following, we evaluate the quality of our importance sampling for diffuse (Sec. 5.1) and specular shading (Sec. 5.2) in comparison to prior work. We also make recommendations on stratification (Sec. 5.3) and measure timings (Sec. 5.4). © 2021 The Author(s) Computer Graphics Forum © 2021 The Eurographics Association and John Wiley & Sons Ltd. _c_ _<u>j</u>_ _p_ _<u>j</u>_ (ω _<u>j</u>_ )d _R_ _w j_ (ω _j_ ) := _v_ ∑ <sup>1</sup> _k_ <sup>1</sup> _k_ =0 <sup>_ck_</sup> <sup>_pk_</sup> <sup>(ω</sup> <sup>_j_</sup> <sup>)d</sup> <sup>_R_</sup> _p_ _<u>j</u>_ (ω _<u>j</u>_ )d _R_ +(1 _−_ _v_ ) ∑ <sup>1</sup> _k_ <sup>1</sup> _k_ =0 <sup>_pk_</sup> <sup>(ω</sup> <sup>_j_</sup> <sup>)d</sup> <sup>_R_</sup> . _C. Peters / BRDF Importance Sampling for Linear Lights_ Our Vulkan renderer uses the extension VK_KHR_ray_query to cast shadow rays. It is a deferred renderer with a 32-bit visibility buffer [BH13]. Unless stated otherwise, our experiments use the isotropic Frostbite BRDF [LdR14]. For LTCs, we use a 64 _×_ 64 _×_ 51 table of transforms _M_ parameterized by roughness, outgoing inclination and Fresnel reflectance at 0 <sup>_◦_</sup> . Support for arbitrary anisotropic BRDFs would require a 5D table, which is hardly viable. We inherit this limitation from LTCs [HDHN16]. Linear lights are displayed with finite extent to convey geometric relations better. Alongside our results, we report root-mean-square errors (RMSEs) computed from HDR frames. 5.1. Diffuse Shading Figure 6 compares different approaches for diffuse shading using a Lambertian diffuse BRDF. Area sampling (Fig. 6a) places samples uniformly along the length of the linear light. The square falloff term and the two cosine terms introduce strong variance, especially on the ceiling and near the light. These regions look darker because sRGB values get clamped at one. Solid angle sampling (Fig. 6c) is far better but the remaining cosine term still causes variance, especially on the white wall, where it ranges down to zero. On the box (orange inset) the linear light is partially below the horizon. Clipping (Fig. 6d) eliminates samples without contribution. We apply warping of random numbers [HPM <sup>_∗_</sup> 20] on top of clipped solid angle sampling to incorporate the cosine term into the density. With a linear density, this approach is effective on the back wall but barely improves results on the ceiling or the red wall (Fig. 6e). Results deteriorate in the overexposed parts of the ceiling, hence the bad RMSE. A quadratic density helps everywhere, at an increased overhead (Fig. 6f). As expected, our projected solid angle sampling achieves zero variance outside of penumbrae (Fig. 6h). Noise in penumbrae is not reduced significantly but stratification through blue noise works well (red inset). The method of Li et al. [LADL18] gives identical results at a higher cost. 5.2. Specular Shading Fig. 1 demonstrates the benefits of our specular importance sampling. The puddle in the foreground (red inset) has low roughness such that solid angle sampling and projected solid angle sampling rarely sample the peak of the specular BRDF. Thus, shading is far from convergence at one sample per pixel. Using an additional specular sample distributed proportional to an LTC through clamped optimal MIS with _v_ = 0 _._ 5 improves the result drastically. Remaining noise is mostly due to the penumbra of the bollard. Note that the shadow of the bollard looks more like a glossy reflection due to the narrow peak of the BRDF. 5.3. Stratification We find two established methods to be particularly effective for linear lights. Ramamoorthi et al. [RAMN12] recommend uniform jittered sampling for linear lights. That means that we only consume a single random number ξ on [0 _,_ 1) per technique per light. If we take _N_ _∈_ N samples, the random number fed to sampling © 2021 The Author(s) Computer Graphics Forum © 2021 The Eurographics Association and John Wiley & Sons Ltd. 6.723 (a) _Area_ 0.765 (c) _Solid angle_ 0.766 (e) _Linear cosine warp [HPM_ <sup>_∗_</sup> _20]_ 0.108 (g) _Projected solid angle [LADL18]_ 37 0 (b) _Reference_ 0.752 (d) _Clipped solid angle_ 0.354 (f) _Quadratic cosine warp[HPM_ <sup>_∗_</sup> _20]_ 0.108 (h) _Projected solid angle, ours_ Figure 6: _A_ _Lambertian_ _diffuse_ _Cornell_ _box_ _lit_ _by_ _a_ _single_ _linear_ _light_ _just_ _below_ _the_ _ceiling._ _All_ _techniques_ _use_ _one_ _sample_ _per_ _pixel._ _Dependent_ _on_ _their_ _geometric_ _relation_ _to_ _the_ _light,_ _different_ _surfaces_ _benefit_ _differently_ _from_ _better_ _sampling._ _Our_ _projected_ _solid angle sampling has zero variance outside penumbrae._ 38 _C. Peters / BRDF Importance Sampling for Linear Lights_ 0.187 (a) _Independent, white_ 0.128 (c) _Uniform jittered, blue_ 0.180 (b) _Independent, blue_ 0 (d) _Reference_ Figure 7: _The_ _bistro_ _interior_ _lit_ _by_ _a_ _long_ _linear_ _light_ _above_ _the_ _counter._ _We_ _compare_ _white_ _noise_ _against_ _blue_ _noise_ _and_ _independent sampling against uniform jittered sampling. All results_ _use_ _clamped_ _optimal_ _MIS_ _with_ _v_ = 0 _._ 5 _and_ _six_ _samples_ _per_ _pixel_ _(three_ _diffuse,_ _three_ _specular)._ _Uniform_ _jittered_ _sampling_ _reduces_ _variance,_ _blue_ _noise_ _pushes_ _it_ _into_ _higher_ _frequencies_ _in_ _screen_ _space._ algorithms for sample _k_ _∈{_ 0 _,...,_ _N_ _−_ 1 _}_ is <u>ξ+</u> _N_ _<u>k</u>_ <sup>.</sup> <sup>Indeed,</sup> <sup>this</sup> approach gives an appreciable reduction of variance in penumbrae (Fig. 7). Additionally, we use precomputed 64 _×_ 64 blue noise textures [Uli93]. The blue noise patterns are preserved relatively well in penumbrae. 5.4. Run Time To measure timings, we use the same setup as previous work [Pet21] such that numbers are comparable. Our test system consists of an NVIDIA Geforce RTX 2080 Ti, an Intel Core i59600K and 16 GB RAM. When ray tracing is enabled, our clipped solid angle sampling and our projected solid angle sampling perform identically. The computation is hidden by the latency, even with the geometrically simple Cornell box (Fig. 6). Adding one sample per pixel at 1920 _×_ 1080 resolution for the bistro exterior (Fig. 1) takes 0.45 ms. Therefore, we focus on computational cost and disable ray tracing. We point the camera at a plane and either take 128 samples from 128 different lights or from a single light. Our renderer has an overhead per sample, e.g. to evaluate the BRDF. To measure this overhead separately, we define a cheap baseline sampling technique, namely area sampling without proper density computation. Table 1 lists the results. Our optimized solid angle sampling Table 1: _Delta_ _timings_ _in_ _milliseconds_ _for_ _rendering_ _a_ _frame_ _at_ 1920 _×_ 1080 _resolution using 128 samples per pixel. The samples_ _are either taken from 128 different linear lights or all from the same_ _light._ _The_ _baseline_ _timings_ _have_ _been_ _subtracted_ _from_ _each_ _of_ _the_ _timings in the rows above to isolate the cost of sampling itself._ <u>128 lights</u> <u>128 samples</u> Area 0.47 0.41 Solid angle, ours, Sec. 3.1 0.75 0.17 Clipped solid angle, ours, Sec. 3.1 1.29 0.17 Linear cosine warp [HPM <sup>_∗_</sup> 20] 2.32 0.49 Quadratic cosine warp [HPM <sup>_∗_</sup> 20] 4.78 1.97 Projected solid angle [LADL18] 10.0 5.20 Projected solid angle, ours, Sec. 3 4.40 2.05 <u>+</u> <u>Baseline</u> <u>3.25</u> <u>2.99</u> Projected solid angle, Fig. 1 [LADL18] 13.6 10.6 Projected solid angle, Fig. 1, ours 4.13 2.34 <u>+</u> <u>Baseline</u> <u>3.36</u> <u>2.55</u> Rectangle solid angle [UnFK13] 3.65 1.11 Quad projected solid angle [Pet21] 28.9 11.5 + Baseline 6.46 3.61 is extremely fast, especially regarding the cost per sample. Note however, that the marginal cost of the baseline sampling technique comes on top of that. Even area sampling has a higher cost per sample due to the more complex density. Clipping doubles the cost per light. Warping [HPM <sup>_∗_</sup> 20] benefits from our fast implementation of solid angle sampling. The quadratic variant with closed-form cubic solver performs similarly to our projected solid angle sampling. The linear variant is faster but both of these have inferior quality. Compared to the method with Newton bisection [LADL18], our projected solid angle sampling costs 2.5 times less per sample and 2 times less per light. However, Newton bisection has a variable iteration count and potentially divergent execution. Therefore, we repeat this experiment on the geometrically more complex scene in Fig. 1 and find that our cost per sample is 4.5 times lower. This gap could grow further in a full path tracer. Through rejection sampling, rectangle sampling techniques can sample cylinders [Gam16]. However, our specialized methods for the limit case are considerably faster for solid angle sampling [UnFK13] and projected solid angle sampling [Pet21], respectively. 6. Conclusions Our work takes importance sampling of linear lights to its natural conclusion. Except for visibility, all terms of the reflection equation are accounted for and the method is stable and inexpensive. It is a valuable addition to any path tracer and also offers efficiency improvements for differentiable rendering [LADL18]. Methodically, our work reinforces the value of tailor-made iterative algorithms for sampling problems in computer graphics. Since we guarantee accurate results with two inexpensive iterations, there is no practical reason to prefer closed-form solutions. Now that fast projected solid angle sampling and LTC © 2021 The Author(s) Computer Graphics Forum © 2021 The Eurographics Association and John Wiley & Sons Ltd. _C. Peters / BRDF Importance Sampling for Linear Lights_ 39 importance sampling are available for polygonal [Pet21] and linear lights, the most important remaining light type are ellipsoids. Spheres have been addressed [PD19] but that is not sufficient for LTC importance sampling. We hope that similar iterative methods will be applicable. Our optimizations may also apply to rectangle solid angle sampling [UnFK13]. Besides, our work further motivates the generalization of LTCs to arbitrary anisotropic BRDFs. Acknowledgments We thank Alisa Jung, Johannes Schudeiske, Tobias Zirr, Carsten Dachsbacher and our reviewers for their constructive input. Figs. 1 and 7 use [ORCA](https://developer.nvidia.com/orca) models courtesy of Amazon [Lumberyard.](https://developer.nvidia.com/orca/amazon-lumberyard-bistro) Our renderer ships with additional scenes. The [attic](https://blendswap.com/blend/25057) is created by [Shuprobho](https://www.blendswap.com/blend/25057) Das, Fran [Calvente,](https://3dmodelhaven.com/model/?c=furniture&m=WoodenTable_02) [Asterlil,](https://www.blendswap.com/blend/20724) [YopLand,](https://www.blendswap.com/blend/12262) M. [Ziemys,](https://blendswap.com/blend/17472) [Eva11dragon, Rob Tuytel and me. The arcade is made by Nicholas](https://www.blendswap.com/blend/11475) [Hull for NVIDIA’s Falcor. The living room is made by Jay Artist.](https://github.com/NVIDIAGameWorks/Falcor) Open access funding enabled and organized by Projekt DEAL. [Correction added on 15 June 2022, after first online publication: Projekt Deal funding statement has been added.] References [Arv95] ARVO J.: Stratified sampling of spherical triangles. In _Proceedings of the 22nd Annual Conference on Computer Graphics and_ _Interactive_ _Techniques_ (1995), SIGGRAPH ’95, ACM, pp. 437–438. [doi:10.1145/218380.218500.](https://doi.org/10.1145/218380.218500) 2 [Arv01] ARVO J.: Stratified sampling of 2-manifolds. In _State of the Art_ _in Monte Carlo Ray Tracing for Realistic Image Synthesis (SIGGRAPH_ _2001 Course Notes)_ (Aug. 2001), ACM. 2 [BH13] BURNS C. A., HUNT W. A.: The visibility buffer: A cachefriendly approach to deferred shading. _Journal_ _of_ _Computer_ _Graphics_ _Techniques_ _(JCGT)_ _2_, 2 (Aug. 2013), 55–69. URL: [http://jcgt.](http://jcgt.org/published/0002/02/04/) [org/published/0002/02/04/.](http://jcgt.org/published/0002/02/04/) 7 [Bli06] BLINN J. F.: How to solve a quadratic equation. part 2. _IEEE_ _Computer_ _Graphics_ _and_ _Applications_ _26_, 2 (2006), 82–87. [doi:10.](https://doi.org/10.1109/MCG.2006.35) [1109/MCG.2006.35.](https://doi.org/10.1109/MCG.2006.35) 5 [BP93] BAO H., PENG Q.: Shading models for linear and area light sources. _Computers_ _&_ _Graphics_ _17_, 2 (1993), 137–145. [doi:10.](https://doi.org/10.1016/0097-8493%0x2893%0x2990097-S) [1016/0097-8493(93)90097-S.](https://doi.org/10.1016/0097-8493%0x2893%0x2990097-S) 2, 3 [dCI17] DE CARPENTIER G., ISHIYAMA K.: Advances in real-time rendering, part II: Decima engine: Advances in lighting and AA. In _ACM_ _SIGGRAPH_ _2017_ _Courses_ (2017). [doi:10.1145/3084873.](https://doi.org/10.1145/3084873.3096477) [3096477.](https://doi.org/10.1145/3084873.3096477) 2 [DHB17] DUPUY J., HEITZ E., BELCOUR L.: A spherical cap preserving parameterization for spherical distributions. _ACM_ _Trans._ _Graph._ _(proc._ _SIGGRAPH)_ _36_, 4 (July 2017). [doi:10.1145/](https://doi.org/10.1145/3072959.3073694) [3072959.3073694.](https://doi.org/10.1145/3072959.3073694) 2 [Dro14] DROBOT M.: Physically based area lights. In _GPU_ _Pro_ _5:_ _Advanced_ _Rendering_ _Techniques_ (May 2014), A K Peters/CRC Press, pp. 67–100. 2 [Gam16] GAMITO M. N.: Solid angle sampling of disk and cylinder lights. _Computer Graphics Forum (proc. EGSR) 35_ [, 4 (June 2016). doi:](https://doi.org/10.1111/cgf.12946) [10.1111/cgf.12946.](https://doi.org/10.1111/cgf.12946) 2, 4, 8 [GUnK <sup>_∗_</sup> 17] GUILLÉN I., UREÑA C., KING A., FAJARDO M., GEORGIEV I., LÓPEZ-MORENO J., JARABO A.: Area-preserving parameterizations for spherical ellipses. _Computer_ _Graphics_ _Forum_ _(proc. EGSR) 36_, 4 (June 2017). [doi:10.1111/cgf.13234.](https://doi.org/10.1111/cgf.13234) 2 [Hd14] HEITZ E., D’EON E.: Importance sampling microfacet-based BSDFs using the distribution of visible normals. _Computer_ _Graphics_ © 2021 The Author(s) Computer Graphics Forum © 2021 The Eurographics Association and John Wiley & Sons Ltd. _Forum_ _(proc._ _EGSR)_ _33_, 4 (2014), 103–112. [doi:10.1111/cgf.](https://doi.org/10.1111/cgf.12417) [12417.](https://doi.org/10.1111/cgf.12417) 2 [HDHN16] HEITZ E., DUPUY J., HILL S., NEUBELT D.: Realtime polygonal-light shading with linearly transformed cosines. _ACM_ _Trans. Graph. (proc. SIGGRAPH) 35_, 4 (July 2016). [doi:10.1145/](https://doi.org/10.1145/2897824.2925895) [2897824.2925895.](https://doi.org/10.1145/2897824.2925895) 1, 2, 6, 7 [Hei17] HEITZ E.: Analytical calculation of the solid angle subtended by an arbitrarily positioned ellipsoid to a point source. _Nuclear_ _Instruments_ _and_ _Methods_ _in_ _Physics_ _Research_ _Section_ _A:_ _Accelerators,_ _Spectrometers, Detectors and Associated Equipment 852_ (2017), 10–14. [doi:https://doi.org/10.1016/j.nima.2017.02.004.](https://doi.org/https://doi.org/10.1016/j.nima.2017.02.004) 2 [Hei20] HEITZ E.: Can’t invert the CDF? The triangle-cut parameterization of the region under the curve. _Computer_ _Graphics_ _Forum 39_, 4 (2020). [doi:10.1111/cgf.14058.](https://doi.org/10.1111/cgf.14058) 2 [HH17a] HEITZ E., HILL S.: Linear-light shading with linearly transformed cosines. In _GPU_ _Zen:_ _Advanced_ _Rendering_ _Techniques_ [(2017), Black Cat Publishing Inc., pp. 137–162. URL: https://hal.](https://hal.archives-ouvertes.fr/hal-02155101) [archives-ouvertes.fr/hal-02155101.](https://hal.archives-ouvertes.fr/hal-02155101) 2, 6 [HH17b] HEITZ E., HILL S.: Physically based shading in theory and practice: Real-time line and disk light shading. In _ACM_ _SIGGRAPH_ _2017 Courses_ (2017). [doi:10.1145/3084873.3084893.](https://doi.org/10.1145/3084873.3084893) 2 [HPM <sup>_∗_</sup> 20] HART D., PHARR M., MÜLLER T., LOPES W., MCGUIRE M., SHIRLEY P.: Practical product sampling by fitting and composing warps. _Computer Graphics Forum 39_ [, 4 (2020). doi:10.1111/cgf.](https://doi.org/10.1111/cgf.14060) [14060.](https://doi.org/10.1111/cgf.14060) 2, 7, 8 [LADL18] LI T.-M., AITTALA M., DURAND F., LEHTINEN J.: Differentiable Monte Carlo ray tracing through edge sampling. _ACM_ _Trans._ _Graph._ _(proc._ _SIGGRAPH_ _Asia)_ _37_, 6 (Dec. 2018). [doi:10.](https://doi.org/10.1145/3272127.3275109) [1145/3272127.3275109.](https://doi.org/10.1145/3272127.3275109) 2, 7, 8 [LdR14] LAGARDE S., DE ROUSIERS C.: Physically based shading in theory and practice: Moving Frostbite to PBR. In _ACM_ _SIGGRAPH_ _2014_ _Courses_ (2014). URL: [https:](https://seblagarde.files.wordpress.com/2015/07/course_notes_moving_frostbite_to_pbr_v32.pdf) [//seblagarde.files.wordpress.com/2015/07/](https://seblagarde.files.wordpress.com/2015/07/course_notes_moving_frostbite_to_pbr_v32.pdf) [course_notes_moving_frostbite_to_pbr_v32.pdf,](https://seblagarde.files.wordpress.com/2015/07/course_notes_moving_frostbite_to_pbr_v32.pdf) [doi:10.1145/2614028.2615431.](https://doi.org/10.1145/2614028.2615431) 7 [MPC19] MOREAU P., PHARR M., CLARBERG P.: Dynamic many-light sampling for real-time ray tracing. In _High-Performance_ _Graphics_ _-_ _Short Papers_ (2019), Steinberger M., Foley T., (Eds.), The Eurographics Association. [doi:10.2312/hpg.20191191.](https://doi.org/10.2312/hpg.20191191) 2 [NM65] NELDER J. A., MEAD R.: A simplex method for function minimization. _The_ _Computer_ _Journal_ _7_, 4 (01 1965), 308–313. [doi:](https://doi.org/10.1093/comjnl/7.4.308) [10.1093/comjnl/7.4.308.](https://doi.org/10.1093/comjnl/7.4.308) 5 [NON85] NISHITA T., OKAMURA I., NAKAMAE E.: Shading models for point and linear sources. _ACM Trans. Graph. 4_, 2 (Apr. 1985), 124–146. [doi:10.1145/282918.282938.](https://doi.org/10.1145/282918.282938) 2, 3 [PA91] POULIN P., AMANATIDES J.: Shading and shadowing with linear light sources. _Computers_ _&_ _Graphics_ _15_, 2 (1991), 259–265. [doi:](https://doi.org/10.1016/0097-8493%0x2891%0x2990079-W) [10.1016/0097-8493(91)90079-W.](https://doi.org/10.1016/0097-8493%0x2891%0x2990079-W) 2 [PD19] PETERS C., DACHSBACHER C.: Sampling projected spherical caps in real time. _Proc. ACM Comput. Graph. Interact. Tech. 2_, 1 (June 2019). [doi:10.1145/3320282.](https://doi.org/10.1145/3320282) 2, 9 [Pet21] PETERS C.: BRDF importance sampling for polygonal lights. _ACM_ _Trans._ _Graph._ _(proc._ _SIGGRAPH)_ _40_, 4 (July 2021). [doi:10.](https://doi.org/10.1145/3450626.3459672) [1145/3450626.3459672.](https://doi.org/10.1145/3450626.3459672) 1, 2, 3, 4, 5, 6, 8, 9 [Pic92] PICOTT K. P.: Extensions of the linear and area lighting models. _IEEE Computer Graphics and Applications 12_, 2 (1992), 31–38. [doi:](https://doi.org/10.1109/38.124286) [10.1109/38.124286.](https://doi.org/10.1109/38.124286) 2, 3 [PJH16] PHARR M., JAKOB W., HUMPHREYS G.: _Physically_ _Based_ _Rendering,_ _3rd_ _Edition_ . Morgan Kaufmann, Nov. 2016. URL: [http:](http://www.pbr-book.org) [//www.pbr-book.org.](http://www.pbr-book.org) 3 [PTVF07] PRESS W. H., TEUKOLSKY S. A., VETTERLING W. T., FLANNERY B. P.: _Numerical_ _recipes:_ _The_ _art_ _of_ _scientific_ _computing_ _(third edition)_ . Cambridge University Press, 2007. 4 40 _C. Peters / BRDF Importance Sampling for Linear Lights_ [RAMN12] RAMAMOORTHI R., ANDERSON J., MEYER M., NOWROUZEZAHRAI D.: A theory of Monte Carlo visibility sampling. _ACM_ _Trans._ _Graph._ _31_, 5 (Sept. 2012). [doi:](https://doi.org/10.1145/2231816.2231819) [10.1145/2231816.2231819.](https://doi.org/10.1145/2231816.2231819) 2, 7 [ST95] SCAVO T. R., THOO J. B.: On the geometry of Halley’s method. _The_ _American_ _Mathematical_ _Monthly_ _102_, 5 (1995), 417–426. [doi:](https://doi.org/10.2307/2975033) [10.2307/2975033.](https://doi.org/10.2307/2975033) 4 [Uli93] ULICHNEY R. A.: Void-and-cluster method for dither array generation. _Proc._ _SPIE_ _1913_ (1993), 1–12. [doi:10.1117/12.](https://doi.org/10.1117/12.152707) [152707.](https://doi.org/10.1117/12.152707) 8 [Un00] UREÑA C.: Computation of irradiance from triangles by adaptive sampling. _Computer_ _Graphics_ _Forum_, 2 (2000). [doi:10.1111/](https://doi.org/10.1111/1467-8659.00452) [1467-8659.00452.](https://doi.org/10.1111/1467-8659.00452) 2 [UnFK13] UREÑA C., FAJARDO M., KING A.: An area-preserving parametrization for spherical rectangles. _Computer_ _Graphics_ _Forum_ _(proc. EGSR) 36_, 4 (June 2013). [doi:10.1111/cgf.12151.](https://doi.org/10.1111/cgf.12151) 2, 8, 9 [UnG18] UREÑA C., GEORGIEV I.: Stratified sampling of projected spherical caps. _Computer_ _Graphics_ _Forum_ _(proc._ _EGSR)_ _37_, 4 (2018). [doi:10.1111/cgf.13471.](https://doi.org/10.1111/cgf.13471) 2 [VG95] VEACH E., GUIBAS L. J.: Optimally combining sampling techniques for Monte Carlo rendering. In _Proceedings_ _of_ _the_ _22nd_ _Annual_ _Conference_ _on_ _Computer_ _Graphics_ _and_ _Interactive_ _Techniques_ (1995), SIGGRAPH ’95, ACM. [doi:10.1145/218380.218498.](https://doi.org/10.1145/218380.218498) 2 [Wan92] WANG C.: Physically correct direct lighting for distribution ray tracing. In _Graphics_ _Gems_ _III_ (1992), Academic Press Professional, pp. 307–313. 2 © 2021 The Author(s) Computer Graphics Forum © 2021 The Eurographics Association and John Wiley & Sons Ltd.

섹션 본문

섹션 본문이 없습니다.

참고문헌 31건

  1. PHYSICALLY CORRECT DIRECT LIGHTING FOR DISTRIBUTION RAY TRACING Elsevier eBooks · Elsevier BV · 1992 10.1016/b978-0-08-050755-2.50067-1
  2. Stratified sampling of spherical triangles 1995 10.1145/218380.218500
  3. Computation of Irradiance from Triangles by Adaptive Sampling Computer Graphics Forum · Wiley · 2000 10.1111/1467-8659.00452
  4. A theory of monte carlo visibility sampling ACM Transactions on Graphics · Association for Computing Machinery · 2012 10.1145/2231816.2231819
  5. Shading and shadowing with linear light sources Computers & Graphics · Elsevier BV · 1991 10.1016/0097-8493(91)90079-w
  6. &lt;title&gt;Void-and-cluster method for dither array generation&lt;/title&gt; Proceedings of SPIE, the International Society for Optical Engineering/Proceedings of SPIE · SPIE · 1993 10.1117/12.152707
  7. How to solve a quadratic equation. Part 2 IEEE Computer Graphics and Applications · Institute of Electrical and Electronics Engineers · 2006 10.1109/mcg.2006.35
  8. On the Geometry of Halley's Method American Mathematical Monthly · Taylor & Francis · 1995 10.1080/00029890.1995.12004594
  9. Shading models for point and linear sources ACM Transactions on Graphics · Association for Computing Machinery · 1985 10.1145/282918.282938
  10. Shading models for linear and area light sources Computers & Graphics · Elsevier BV · 1993 10.1016/0097-8493(93)90097-s
  11. An Area‐Preserving Parametrization for Spherical Rectangles Computer Graphics Forum · Wiley · 2013 10.1111/cgf.12151
  12. Optimally combining sampling techniques for Monte Carlo rendering 1995 10.1145/218380.218498
  13. Extensions of the linear and area lighting models IEEE Computer Graphics and Applications · Institute of Electrical and Electronics Engineers · 1992 10.1109/38.124286
  14. Importance Sampling Microfacet‐Based BSDFs using the Distribution of Visible Normals Computer Graphics Forum · Wiley · 2014 10.1111/cgf.12417
  15. A Simplex Method for Function Minimization The Computer Journal · Oxford University Press · 1965 10.1093/comjnl/7.4.308
  16. The Visibility Buffer: A Cache-Friendly Approach to Deferred Shading 2013
  17. Real-time polygonal-light shading with linearly transformed cosines ACM Transactions on Graphics · Association for Computing Machinery · 2016 10.1145/2897824.2925895
  18. GPU Pro2 : advanced rendering techniques A K Peters eBooks · 2011
  19. Solid Angle Sampling of Disk and Cylinder Lights Computer Graphics Forum · Wiley · 2016 10.1111/cgf.12946
  20. Analytical calculation of the solid angle subtended by an arbitrarily positioned ellipsoid to a point source Nuclear Instruments and Methods in Physics Research Section A Accelerators Spectrometers Detectors and Associated Equipment · Elsevier BV · 2017 10.1016/j.nima.2017.02.004
  21. A spherical cap preserving parameterization for spherical distributions ACM Transactions on Graphics · Association for Computing Machinery · 2017 10.1145/3072959.3073694
  22. Stratified Sampling of Projected Spherical Caps Computer Graphics Forum · Wiley · 2018 10.1111/cgf.13471
  23. Differentiable Monte Carlo ray tracing through edge sampling ACM Transactions on Graphics · Association for Computing Machinery · 2018 10.1145/3272127.3275109
  24. Sampling Projected Spherical Caps in Real Time Proceedings of the ACM on Computer Graphics and Interactive Techniques · Association for Computing Machinery · 2019 10.1145/3320282
  25. Practical Product Sampling by Fitting and Composing Warps Computer Graphics Forum · Wiley · 2020 10.1111/cgf.14060
  26. Can't Invert the CDF? The Triangle‐Cut Parameterization of the Region under the Curve Computer Graphics Forum · Wiley · 2020 10.1111/cgf.14058
  27. Area‐Preserving Parameterizations for Spherical Ellipses Computer Graphics Forum · Wiley · 2017 10.1111/cgf.13234
  28. BRDF importance sampling for polygonal lights ACM Transactions on Graphics · Association for Computing Machinery · 2021 10.1145/3450626.3459672
  29. Physically based shading in theory and practice 2014 10.1145/2614028.2615431
  30. On the Geometry of Halley's Method American Mathematical Monthly · Taylor & Francis · 1995 10.2307/2975033
  31. Advances in real-time rendering, part II 2017 10.1145/3084873.3096477