-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathobservers.html
More file actions
371 lines (350 loc) · 26.1 KB
/
observers.html
File metadata and controls
371 lines (350 loc) · 26.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
<!DOCTYPE html>
<html class="writer-html5" lang="en" data-content_root="./">
<head>
<meta charset="utf-8" /><meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>6. Sampling and Observers — Raysect Documentation</title>
<link rel="stylesheet" href="_static/theme.css" type="text/css" />
<link rel="shortcut icon" href="_static/RaysectLogo_web.ico"/>
<script src="_static/documentation_options.js?v=39bb1c6d"></script>
<script src="_static/doctools.js?v=9bcbadda"></script>
<script src="_static/sphinx_highlight.js?v=dc90522c"></script>
<script async="async" src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js"></script>
<script src="_static/js/theme.js"></script>
<link rel="index" title="Index" href="genindex.html" />
<link rel="search" title="Search" href="search.html" />
<link rel="next" title="7. Primitives" href="primitives.html" />
<link rel="prev" title="5. Quickstart Guide" href="quickstart_guide.html" />
</head>
<body class="wy-body-for-nav">
<div class="wy-grid-for-nav">
<nav data-toggle="wy-nav-shift" class="wy-nav-side">
<div class="wy-side-scroll">
<div class="wy-side-nav-search" >
<a href="index.html" class="icon icon-home">
Raysect
<img src="_static/RaysectLogo_web.png" class="logo" alt="Logo"/>
</a>
<div role="search">
<form id="rtd-search-form" class="wy-form" action="search.html" method="get">
<input type="text" name="q" placeholder="Search docs" aria-label="Search docs" />
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
</div>
</div><div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="Navigation menu">
<p class="caption" role="heading"><span class="caption-text">Table of Contents</span></p>
<ul class="current">
<li class="toctree-l1"><a class="reference internal" href="introduction.html">1. Introduction</a></li>
<li class="toctree-l1"><a class="reference internal" href="license.html">2. License</a></li>
<li class="toctree-l1"><a class="reference internal" href="installation.html">3. Downloading and Installation</a></li>
<li class="toctree-l1"><a class="reference internal" href="how_it_works.html">4. How it works</a></li>
<li class="toctree-l1"><a class="reference internal" href="quickstart_guide.html">5. Quickstart Guide</a></li>
<li class="toctree-l1 current"><a class="current reference internal" href="#">6. Sampling and Observers</a><ul>
<li class="toctree-l2"><a class="reference internal" href="#primer-on-monte-carlo-integration">6.1. Primer on Monte-Carlo Integration</a><ul>
<li class="toctree-l3"><a class="reference internal" href="#average-value-method">6.1.1. Average value method</a></li>
<li class="toctree-l3"><a class="reference internal" href="#importance-sampling">6.1.2. Importance Sampling</a></li>
<li class="toctree-l3"><a class="reference internal" href="#multiple-importance-sampling">6.1.3. Multiple Importance Sampling</a></li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="#observing-surfaces">6.2. Observing Surfaces</a><ul>
<li class="toctree-l3"><a class="reference internal" href="#ccd-pixel-with-uniform-hemisphere-sampling">6.2.1. CCD Pixel with Uniform Hemisphere Sampling</a></li>
<li class="toctree-l3"><a class="reference internal" href="#ccd-pixel-with-a-cosine-distribution">6.2.2. CCD Pixel with a Cosine distribution</a></li>
<li class="toctree-l3"><a class="reference internal" href="#optical-fibre">6.2.3. Optical Fibre</a></li>
<li class="toctree-l3"><a class="reference internal" href="#sampling-the-lights">6.2.4. Sampling the lights</a></li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="#material-surfaces">6.3. Material Surfaces</a><ul>
<li class="toctree-l3"><a class="reference internal" href="#sampling-the-brdf">6.3.1. Sampling the BRDF</a></li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="#participating-media">6.4. Participating Media</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="primitives.html">7. Primitives</a></li>
<li class="toctree-l1"><a class="reference internal" href="materials.html">8. Materials</a></li>
<li class="toctree-l1"><a class="reference internal" href="conventions.html">9. Conventions</a></li>
<li class="toctree-l1"><a class="reference internal" href="references.html">10. References</a></li>
<li class="toctree-l1"><a class="reference internal" href="glossary.html">11. Glossary</a></li>
</ul>
<p class="caption" role="heading"><span class="caption-text">Demonstrations</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="demonstrations/demonstrations.html">1. Core Functionality</a></li>
<li class="toctree-l1"><a class="reference internal" href="demonstrations/demonstrations.html#materials">2. Materials</a></li>
<li class="toctree-l1"><a class="reference internal" href="demonstrations/demonstrations.html#observers">3. Observers</a></li>
<li class="toctree-l1"><a class="reference internal" href="demonstrations/demonstrations.html#optics">4. Optics</a></li>
</ul>
<p class="caption" role="heading"><span class="caption-text">API Reference</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="api_reference/core/core.html">1. Raysect Core</a></li>
<li class="toctree-l1"><a class="reference internal" href="api_reference/primitives/primitives.html">2. Primitives Module</a></li>
<li class="toctree-l1"><a class="reference internal" href="api_reference/optical/optical.html">3. Optical Module</a></li>
</ul>
</div>
</div>
</nav>
<section data-toggle="wy-nav-shift" class="wy-nav-content-wrap"><nav class="wy-nav-top" aria-label="Mobile navigation menu" >
<i data-toggle="wy-nav-top" class="fa fa-bars"></i>
<a href="index.html">Raysect</a>
</nav>
<div class="wy-nav-content">
<div class="rst-content">
<div role="navigation" aria-label="Page navigation">
<ul class="wy-breadcrumbs">
<li><a href="index.html" class="icon icon-home" aria-label="Home"></a></li>
<li class="breadcrumb-item active"><span class="section-number">6. </span>Sampling and Observers</li>
<li class="wy-breadcrumbs-aside">
<a href="_sources/observers.rst.txt" rel="nofollow"> View page source</a>
</li>
</ul>
<hr/>
</div>
<div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
<div itemprop="articleBody">
<section id="sampling-and-observers">
<h1><span class="section-number">6. </span>Sampling and Observers<a class="headerlink" href="#sampling-and-observers" title="Link to this heading">¶</a></h1>
<section id="primer-on-monte-carlo-integration">
<h2><span class="section-number">6.1. </span>Primer on Monte-Carlo Integration<a class="headerlink" href="#primer-on-monte-carlo-integration" title="Link to this heading">¶</a></h2>
<section id="average-value-method">
<h3><span class="section-number">6.1.1. </span>Average value method<a class="headerlink" href="#average-value-method" title="Link to this heading">¶</a></h3>
<p>The integrals encountered in optical ray-tracing are exact but difficult to evaluate
analytically for most physically relevant scenes. Monte-Carlo integration is a
technique for approximating the value of an integral by simulating a random process
with random numbers.</p>
<p>The simplest form of Monte-Carlo integration is the average value method, which starts by
considering the integral</p>
<div class="math notranslate nohighlight">
\[I = \int_{a}^{b} f(x) dx\]</div>
<p>The average value of the function <span class="math notranslate nohighlight">\(f(x)\)</span> over the domain can be expressed in terms
of the integral over the same domain.</p>
<div class="math notranslate nohighlight">
\[<f> = \frac{1}{b-a} \int_{a}^{b} f(x) dx = \frac{I}{b-a}\]</div>
<p>Therefore, through manipulation we can express our integral in terms of the average of
<span class="math notranslate nohighlight">\(f(x)\)</span>. We can measure <span class="math notranslate nohighlight">\(<f(x)>\)</span> by sampling <span class="math notranslate nohighlight">\(f(x)\)</span> at <span class="math notranslate nohighlight">\(N\)</span> points
<span class="math notranslate nohighlight">\(x_1\)</span>, <span class="math notranslate nohighlight">\(x_2\)</span>, …, <span class="math notranslate nohighlight">\(x_N\)</span> chosen randomly between <span class="math notranslate nohighlight">\(a\)</span> and
<span class="math notranslate nohighlight">\(b\)</span>.</p>
<div class="math notranslate nohighlight">
\[I \approx \frac{b-a}{N} \sum_{i=1}^{N} f(x_i) = \frac{1}{N} \sum_{i=1}^{N} \frac{f(x_i)}{p(x_i)}\]</div>
<p><span class="math notranslate nohighlight">\(p(x_i) = 1/(a-b)\)</span> is the uniform distribution we are sampling from. For a rectangular
pixel in a camera the sampling distributions would be uniformly distributed 2D points in the
square area <span class="math notranslate nohighlight">\(A\)</span> and 3D vectors in the hemisphere <span class="math notranslate nohighlight">\(\Omega\)</span>.</p>
<p>In general, the standard error on the approximation scales as <span class="math notranslate nohighlight">\(1/\sqrt{N}\)</span> with
<span class="math notranslate nohighlight">\(N\)</span> samples.</p>
</section>
<section id="importance-sampling">
<h3><span class="section-number">6.1.2. </span>Importance Sampling<a class="headerlink" href="#importance-sampling" title="Link to this heading">¶</a></h3>
<p>The average value formula works well for smoothly varying functions but becomes inefficient when
the integral contains steep gradients or a divergence, for example, a bright point light source.
The standard error on the integral estimator can become large in such circumstances.</p>
<p>We can get around these problems by drawing the sample points <span class="math notranslate nohighlight">\(x_i\)</span> from a non-uniform
probability density function (i.e. higher density for regions with stronger emission). Formally, <span class="math notranslate nohighlight">\(p(x_i)\)</span>
is defined as</p>
<div class="math notranslate nohighlight">
\[p(x_i) = \frac{w(x_i)}{\int_{a}^{b} w(x) dx}\]</div>
<p>where <span class="math notranslate nohighlight">\(w(x)\)</span> is the weight function describing the distribution of sampling points. <span class="math notranslate nohighlight">\(p(x)\)</span> has
the same functional shape as <span class="math notranslate nohighlight">\(w(x)\)</span> but has been normalised so that its integral is 1. For uniform
sampling, <span class="math notranslate nohighlight">\(w(x) = 1\)</span> and <span class="math notranslate nohighlight">\(p(x_i) = 1/(b-a)\)</span> recovering the average value formula.</p>
<p>For the general case function <span class="math notranslate nohighlight">\(w(x)\)</span> the estimator for the integral is now</p>
<div class="math notranslate nohighlight">
\[I \approx \frac{1}{N} \sum_{i=1}^{N} \frac{f(x_i)}{w(x_i)} \int_{a}^{b} w(x) dx\]</div>
<p>This is the fundamental formula of importance sampling and a generalisation of the average
value method. It allows estimation of the integral <span class="math notranslate nohighlight">\(I\)</span> by performing
a weighted sum, which can be weighted to have higher density in regions of interest. The price we
pay is that the random samples are being drawn from a more complicated distribution.</p>
<p>Importance sampling exploits the fact that the Monte-Carlo estimator converges fastest when samples
are taken from a distribution p(x) that is similar to the function f(x) in the integrand
(i.e. concentrate the calculations where the integrand is high).</p>
</section>
<section id="multiple-importance-sampling">
<h3><span class="section-number">6.1.3. </span>Multiple Importance Sampling<a class="headerlink" href="#multiple-importance-sampling" title="Link to this heading">¶</a></h3>
<p>It is difficult to construct a single sampling distribution that represents a physically relevant scene.
Instead, the integrand of the lighting equations can be approximated as sums and products of the
underlying features in a scene, such as individual light sources and geometry factors. Ideally we would
sample all candidate distributions in a physical scene.</p>
<p>Suppose the complicated integrand in our scene can approximated by a set operations on a number of simpler
underlying distributions. e.g.</p>
<div class="math notranslate nohighlight">
\[f(x) = (f_1(x) + f_2(x)) \times f_3(x)\]</div>
<p>Multiple importance sampling is a generalisation of the importance sampling equation which allows us to
evaluate complicated integrands by simultaneously sampling multiple underlying important distributions
(see Veach, E. 1998). Without going into the derivation, the integrand becomes</p>
<div class="math notranslate nohighlight">
\[I \approx \sum_{i=1}^{N} \sum_{j=1}^{n_i} \frac{w_i(x_{i,j}) f(x_{i,j})}{p(x_{i,j})}\]</div>
<p>with sample weights given by</p>
<div class="math notranslate nohighlight">
\[w_i(x) = \frac{n_i p_i(x)}{\sum_j n_j p_j(x)}\]</div>
</section>
</section>
<section id="observing-surfaces">
<h2><span class="section-number">6.2. </span>Observing Surfaces<a class="headerlink" href="#observing-surfaces" title="Link to this heading">¶</a></h2>
<p>The total power (radiant flux) measured by an observing surface is given be the integral
of the incident radiance over the collecting solid angle <span class="math notranslate nohighlight">\(\Omega\)</span> and surface
area <span class="math notranslate nohighlight">\(A\)</span>. Therefore the observer equation is</p>
<div class="math notranslate nohighlight">
\[\Phi = \int_{A} \int_{\Omega} L_{i}(x_j, \omega_j) \times \cos (\theta_j) d\omega dA\]</div>
<p>Here, <span class="math notranslate nohighlight">\(L_{i}(x_j, \omega_j)\)</span> is the incident radiance at a given point <span class="math notranslate nohighlight">\(x_j\)</span>
and incident angle <span class="math notranslate nohighlight">\(\omega_j\)</span> on the observing surface. <span class="math notranslate nohighlight">\(\cos (\theta_j)\)</span>
is a geometry factor describing the increase in effective observing area as the incident
rays become increasingly parallel to the surface.</p>
<p>The mean radiance measured by an observing surface is simply</p>
<div class="math notranslate nohighlight">
\[L = \frac{\Phi}{A \Omega}.\]</div>
<p>All raysect observers measure the mean spectral radiance <span class="math notranslate nohighlight">\(L\)</span> as their base quantity.
All other quantities of interest can be evaluated through integration over areas, solid
angles and nm.</p>
<p>Let us now re-express this equation in terms of a general Monte Carlo estimator. The
samples will be drawn from two different distributions, 2D points on the observing
surface and 3D Vectors over the <span class="math notranslate nohighlight">\(2/pi\)</span> solid angle hemisphere. Therefore, the
average value estimator would become</p>
<div class="math notranslate nohighlight">
\[L = \frac{1}{N} \sum_{j=1}^{N} \frac{L_i(x_j, \omega_j) \cos(\theta_j)}{p_A(x_j) p_\Omega(\omega_j) A \Omega}\]</div>
<p>where <span class="math notranslate nohighlight">\(p_A(x_j)\)</span> is the probability of drawing sample point <span class="math notranslate nohighlight">\(x_j\)</span> from
area <span class="math notranslate nohighlight">\(A\)</span> and <span class="math notranslate nohighlight">\(p_\Omega(\omega_j)\)</span> is the probability of drawing sample
vector <span class="math notranslate nohighlight">\(\omega_j\)</span> from solid angle <span class="math notranslate nohighlight">\(\Omega\)</span>.</p>
<p>This is the root equation being evaluated in all Raysect observers. In most cases
the detector area is sampled with uniform sampling and hence <span class="math notranslate nohighlight">\(p_A(x_j) = 1/A\)</span>
ends up cancelling <span class="math notranslate nohighlight">\(A\)</span> out of the equation. It is far more common to use a variety
of sampling strategies for the sample directions, <span class="math notranslate nohighlight">\(\omega_j\)</span>, and hence
<span class="math notranslate nohighlight">\(p_\Omega(\omega_j)\)</span> is typically more important.</p>
<p>Let us now consider some more specialised cases.</p>
<figure class="align-center" id="id1">
<img alt="_images/pixel_sampling.png" src="_images/pixel_sampling.png" />
<figcaption>
<p><span class="caption-text"><strong>Caption:</strong> Example sampling geometry for a pixel in a camera. (Image credit: Carr, M.,
Meakins, A., et. al. (2017))</span><a class="headerlink" href="#id1" title="Link to this image">¶</a></p>
</figcaption>
</figure>
<section id="ccd-pixel-with-uniform-hemisphere-sampling">
<h3><span class="section-number">6.2.1. </span>CCD Pixel with Uniform Hemisphere Sampling<a class="headerlink" href="#ccd-pixel-with-uniform-hemisphere-sampling" title="Link to this heading">¶</a></h3>
<p>Let us consider one of the most common cases for an observing surface, a rectangular
pixel surface with a hemisphere of solid angle over which incident light can be collected.
To calculate the Monte Carlo estimator we need <span class="math notranslate nohighlight">\(N\)</span> sample points and vectors. The simplest
vector distribution would be the uniform distribution where all angles over <span class="math notranslate nohighlight">\(2 \pi\)</span> have equal
probability of being sampled. The weighting distribution is</p>
<div class="math notranslate nohighlight">
\[w(\omega) = 1.\]</div>
<p>Thus the distributions normalisation constant evaluates to the area of solid angle being sampled, similar to
the <span class="math notranslate nohighlight">\(b-a\)</span> length scale for the 1D cartesian case.</p>
<div class="math notranslate nohighlight">
\[c = \int_{0}^{2\pi} \int_{0}^{\frac{\pi}{2}} \sin(\theta) d\theta d\phi = 2 \pi\]</div>
<p>Therefore <span class="math notranslate nohighlight">\(p(\omega)\)</span> for uniformly distributed vectors is</p>
<div class="math notranslate nohighlight">
\[p_\Omega(\omega_j) = \frac{w(\omega_j)}{\int_{a}^{b} w(\omega) d\omega} = \frac{1}{2 \pi}.\]</div>
<p>The estimator for the mean radiance becomes</p>
<div class="math notranslate nohighlight">
\[L = \frac{1}{N} \sum_{j=1}^{N} L_i(x_j, \omega_j) \cos(\theta_j)\]</div>
</section>
<section id="ccd-pixel-with-a-cosine-distribution">
<h3><span class="section-number">6.2.2. </span>CCD Pixel with a Cosine distribution<a class="headerlink" href="#ccd-pixel-with-a-cosine-distribution" title="Link to this heading">¶</a></h3>
<p>As mentioned above, it is often advantageous to draw samples from a distribution with similar shape
to the function being integrated. The observer equation is weighted with a cosine theta term meaning
that vector samples near the top of the hemisphere are weighted much more than samples near the edge.
Hence it is useful to generate vector samples proportional to the cosine distribution.</p>
<div class="math notranslate nohighlight">
\[w(\omega_j) = \cos(\theta_j)\]</div>
<p>The normalisation constant, <span class="math notranslate nohighlight">\(c\)</span>, can be evaluated by integrating <span class="math notranslate nohighlight">\(w(\omega)\)</span> over the domain.</p>
<div class="math notranslate nohighlight">
\[c = \int_{0}^{2\pi} \int_{0}^{\frac{\pi}{2}} w(\omega) \sin(\theta) d\theta d\phi = \pi\]</div>
<p>Therefore <span class="math notranslate nohighlight">\(p(\omega_j)\)</span> for a cosine distribution would be</p>
<div class="math notranslate nohighlight">
\[p_\Omega(\omega_j) = \frac{w(\omega_j)}{\int_{a}^{b} w(\omega) d\omega} = \frac{\cos(\theta)}{\pi}\]</div>
<p>and the estimator becomes</p>
<div class="math notranslate nohighlight">
\[L = \frac{1}{N} \sum_{j=1}^{N} L_i(x_j, \omega_j) \cos(\theta_j) \frac{\pi}{\cos(\theta_j) \Omega} = \frac{1}{2N} \sum_{j=1}^{N} L_i(x_j, \omega_j)\]</div>
<p>Note that the cosine factors have cancelled, which makes sense since we are treating
the <span class="math notranslate nohighlight">\(\cos(\theta)\)</span> term as the important distribution.</p>
</section>
<section id="optical-fibre">
<h3><span class="section-number">6.2.3. </span>Optical Fibre<a class="headerlink" href="#optical-fibre" title="Link to this heading">¶</a></h3>
<p>Consider an optical fibre with circular area <span class="math notranslate nohighlight">\(A_f\)</span> and radius <span class="math notranslate nohighlight">\(r_f\)</span>. The area of solid angle
over which light can be collected is a cone with half angle <span class="math notranslate nohighlight">\(\theta_{max}\)</span>. The circular area can
be sampled with uniformly distributed points, meaning <span class="math notranslate nohighlight">\(p_A(x_j)\)</span> would cancel out again. An
appropriate vector sampling distribution is the uniform cone, where vectors are sampled uniformly
over the circular solid angle centred around the z-axis with angle to z <span class="math notranslate nohighlight">\(\theta_{max}\)</span>. Samples
around the z-axis can be transformed by rotation without effecting the sample density. The weighting
function is uniform and hence</p>
<div class="math notranslate nohighlight">
\[w(\omega) = 1.\]</div>
<p>The normalisation constant for the distribution is now the fractional solid angle area,</p>
<div class="math notranslate nohighlight">
\[c = \int_{0}^{2\pi} \int_{0}^{\theta_{max}} \sin(\theta) d\theta d\phi = 2\pi (1-\cos(\theta_{max})) = \Omega_{\theta_{max}},\]</div>
<p>with corresponding pdf equal to</p>
<div class="math notranslate nohighlight">
\[p_\Omega(\omega_i) = \frac{1}{\Omega_{\theta_m}}.\]</div>
<p>The estimator is</p>
<div class="math notranslate nohighlight">
\[L = \frac{(1-\cos(\theta_{max}))}{N} \sum_{i=1}^{N} L_i(x_i, \omega_i) \cos(\theta_i).\]</div>
</section>
<section id="sampling-the-lights">
<h3><span class="section-number">6.2.4. </span>Sampling the lights<a class="headerlink" href="#sampling-the-lights" title="Link to this heading">¶</a></h3>
<p>Arbitrary light sources and important primitives can be sampled with the projection method. The
light (or primitive) in question is wrapped in a bounding sphere that just encloses the object.
It is then a matter of projecting the bounding sphere into a uniform cone at the surface of the
sample point. The vector from the sample point to the bounding sphere can be used to find a disk
inside the bounding sphere that defines the effective solid angle to be sampled.</p>
<figure class="align-center" id="id2">
<img alt="_images/light_sampling.png" src="_images/light_sampling.png" />
<figcaption>
<p><span class="caption-text"><strong>Caption:</strong> A complex light source sampled with the projection method.</span><a class="headerlink" href="#id2" title="Link to this image">¶</a></p>
</figcaption>
</figure>
</section>
</section>
<section id="material-surfaces">
<h2><span class="section-number">6.3. </span>Material Surfaces<a class="headerlink" href="#material-surfaces" title="Link to this heading">¶</a></h2>
<p>The amount of light that reaches a camera from a point on an object surface is
given by the sum of light emitted and reflected from other sources.</p>
<div class="math notranslate nohighlight">
\[L_{O}(p, \omega_O) = \int_{\Omega} L_{i}(p, \omega_i) \times f(\omega_i, \omega_o) \times \cos (\theta_i) d\omega_i\]</div>
<p>This equation is the same as the observer equation with the addition of the
bidirectional reflectance distribution function (BRDF) term <span class="math notranslate nohighlight">\(f(\omega_i , \omega_o )\)</span>.
The BRDF is a weighting function that describes the redistribution of incident light
into outgoing reflections and transmission/absorption. It is commonly approximated in
terms of two ideal material components, specular and diffuse reflections. Ideal specular
reflection behaves like a mirror where the incoming light is perfectly reflected into
one angle, <span class="math notranslate nohighlight">\(f_s (\omega_i, \omega_o ) = \rho_s(\omega_i )\delta(\omega_i ,\omega_o )\)</span>.
An ideal diffuse surface (matte paper) will evenly redistribute incident light across all
directions and hence has no angular dependance, <span class="math notranslate nohighlight">\(f_d (\omega_i , \omega_o ) = \rho_d /\pi\)</span>.
Real physical materials exhibit a complex combination of both behaviours in addition to
transmission and absorption.</p>
<figure class="align-center" id="id3">
<img alt="_images/material_reflections.png" src="_images/material_reflections.png" />
<figcaption>
<p><span class="caption-text"><strong>Caption:</strong> Example geometry for light reflected from a material surface. (Image credit: Carr, M.,
Meakins, A., et. al. (2017))</span><a class="headerlink" href="#id3" title="Link to this image">¶</a></p>
</figcaption>
</figure>
<section id="sampling-the-brdf">
<h3><span class="section-number">6.3.1. </span>Sampling the BRDF<a class="headerlink" href="#sampling-the-brdf" title="Link to this heading">¶</a></h3>
</section>
</section>
<section id="participating-media">
<h2><span class="section-number">6.4. </span>Participating Media<a class="headerlink" href="#participating-media" title="Link to this heading">¶</a></h2>
<p>Volume scattering, fluorescence and opacity effects.</p>
</section>
</section>
</div>
</div>
<footer><div class="rst-footer-buttons" role="navigation" aria-label="Footer">
<a href="quickstart_guide.html" class="btn btn-neutral float-left" title="5. Quickstart Guide" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left" aria-hidden="true"></span> Previous</a>
<a href="primitives.html" class="btn btn-neutral float-right" title="7. Primitives" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right" aria-hidden="true"></span></a>
</div>
<hr/>
<div role="contentinfo">
<p>© Copyright 2014-2025, Dr Alex Meakins.</p>
</div>
Built with <a href="https://www.sphinx-doc.org/">Sphinx</a> using a
<a href="https://github.com/readthedocs/sphinx_rtd_theme">theme</a>
provided by <a href="https://readthedocs.org">Read the Docs</a>.
</footer>
</div>
</div>
</section>
</div>
<script>
jQuery(function () {
SphinxRtdTheme.Navigation.enable(true);
});
</script>
</body>
</html>