Mitsuba Renderer  0.5.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
noise.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_NOISE_H_)
21 #define __MITSUBA_RENDER_NOISE_H_
22 
23 #include <mitsuba/mitsuba.h>
24 
26 
27 /**
28  * \brief Contains a few useful noise functions
29  *
30  * The implementations in this class are based on PBRT
31  * \ingroup librender
32  * \ingroup libpython
33  */
35 public:
36  /**
37  * \brief Evaluate the Perlin noise function at \a p.
38  */
39  static Float perlinNoise(const Point &p);
40 
41  /**
42  * \brief Evaluate a fractional Brownian noise function
43  * based on \ref perlinNoise() at \a p.
44  *
45  * \param dpdx Differential of p with respect to
46  * the next horizontal pixel in screen-space.
47  * \param dpdy Differential of p with respect to
48  * the next vertical pixel in screen-space.
49  * \param omega Controls the falloff weights applied
50  * to higher-frequency octaves
51  * \param maxOctaves Max. number of octaves used
52  * in the noise computation
53  */
54  static Float fbm(const Point &p, const Vector &dpdx,
55  const Vector &dpdy, Float omega, int maxOctaves);
56 
57  /**
58  * \brief Similar to \ref fbm, but adds first-derivative
59  * discontinuities, causing the resulting function to have
60  * infinite frequency content.
61  *
62  * \param dpdx Differential of p with respect to
63  * the next horizontal pixel in screen-space.
64  * \param dpdy Differential of p with respect to
65  * the next vertical pixel in screen-space.
66  * \param omega Controls the falloff weights applied
67  * to higher-frequency octaves
68  * \param maxOctaves Max. number of octaves used
69  * in the noise computation
70  */
71  static Float turbulence(const Point &p, const Vector &dpdx,
72  const Vector &dpdy, Float omega, int maxOctaves);
73 };
74 
76 
77 #endif /* __MITSUBA_RENDER_NOISE_H_ */
Contains a few useful noise functions.
Definition: noise.h:34
#define MTS_NAMESPACE_BEGIN
Definition: platform.h:137
Definition: fwd.h:96
Definition: fwd.h:100
#define MTS_EXPORT_RENDER
Definition: platform.h:109
#define MTS_NAMESPACE_END
Definition: platform.h:138