Mitsuba Renderer  0.5.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
vpl.h
Go to the documentation of this file.
1 /*
2  This file is part of Mitsuba, a physically based rendering system.
3 
4  Copyright (c) 2007-2014 by Wenzel Jakob and others.
5 
6  Mitsuba is free software; you can redistribute it and/or modify
7  it under the terms of the GNU General Public License Version 3
8  as published by the Free Software Foundation.
9 
10  Mitsuba is distributed in the hope that it will be useful,
11  but WITHOUT ANY WARRANTY; without even the implied warranty of
12  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  GNU General Public License for more details.
14 
15  You should have received a copy of the GNU General Public License
16  along with this program. If not, see <http://www.gnu.org/licenses/>.
17 */
18 
19 #pragma once
20 #if !defined(__MITSUBA_RENDER_VPL_H_)
21 #define __MITSUBA_RENDER_VPL_H_
22 
23 #include <mitsuba/render/scene.h>
24 
26 
27 enum EVPLType {
31 };
32 
33 /**
34  * Support routines for rendering algorithms based on VPLs (virtual
35  * point lights)
36  * \ingroup librender
37  */
38 struct VPL {
39  inline VPL(EVPLType type, const Spectrum &P)
40  : type(type), P(P) {
41  }
45  const Emitter *emitter;
47 
48  std::string toString() const;
49 };
50 
51 /**
52  * Generate a series of point light sources by sampling from the Halton
53  * sequence (as is done in Instant Radiosity). The parameter \c offset
54  * allows setting the initial QMC sample index (should be set to 0 if no offset is
55  * desired), and the last index is returned after the function finishes. This can
56  * be used to generate an arbitrary number of VPLs incrementally. Note that the
57  * value supplied with the parameter \c count is only a suggestion to the implementation.
58  * Generally, it will produce a few more VPLs than the requsted amount. After VPL
59  * generation is done, their power must be scaled by the inverse of the returned index.
60  * The implementation here also needs an pseudorandom number generator, which
61  * is used to prune VPLs in an unbiased manner.
62  */
63 extern MTS_EXPORT_RENDER size_t generateVPLs(const Scene *scene,
64  Random *random, size_t offset,
65  size_t count, int maxDepth, bool prune,
66  std::deque<VPL> &vpls);
67 
69 
70 #endif /* __MITSUBA_RENDER_VPL_H_ */
VPL(EVPLType type, const Spectrum &P)
Definition: vpl.h:39
Definition: vpl.h:30
Abstract radiance emitter interface.
Definition: emitter.h:443
Random number generator based on SIMD-oriented Fast Mersenne Twister
Definition: random.h:88
EVPLType
Definition: vpl.h:27
Principal scene data structure.
Definition: scene.h:49
Intersection its
Definition: vpl.h:44
#define MTS_NAMESPACE_BEGIN
Definition: platform.h:137
EVPLType type
Definition: vpl.h:42
const Emitter * emitter
Definition: vpl.h:45
Definition: vpl.h:28
Container for all information related to a surface intersection.
Definition: shape.h:36
Spectrum P
Definition: vpl.h:43
Definition: vpl.h:38
#define MTS_EXPORT_RENDER
Definition: platform.h:109
Discrete spectral power distribution based on a number of wavelength bins over the 360-830 nm range...
Definition: spectrum.h:663
Float emitterScale
Definition: vpl.h:46
#define MTS_NAMESPACE_END
Definition: platform.h:138
size_t generateVPLs(const Scene *scene, Random *random, size_t offset, size_t count, int maxDepth, bool prune, std::deque< VPL > &vpls)