Lightmetrica  0.0.1.50dbee3 (yosakoi)
 All Classes Functions Variables Typedefs Enumerations Enumerator
pssmlt.splat.h
1 /*
2  Lightmetrica : A research-oriented renderer
3 
4  Copyright (c) 2014 Hisanari Otsu
5 
6  This program is free software: you can redistribute it and/or modify
7  it under the terms of the GNU General Public License as published by
8  the Free Software Foundation, either version 3 of the License, or
9  (at your option) any later version.
10 
11  This program is distributed in the hope that it will be useful,
12  but WITHOUT ANY WARRANTY; without even the implied warranty of
13  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  GNU General Public License for more details.
15 
16  You should have received a copy of the GNU General Public License
17  along with this program. If not, see <http://www.gnu.org/licenses/>.
18 */
19 
20 #pragma once
21 #ifndef LIB_LIGHTMETRICA_PSSMLT_SPLAT_H
22 #define LIB_LIGHTMETRICA_PSSMLT_SPLAT_H
23 
24 #include "common.h"
25 #include "math.types.h"
26 #include "align.h"
27 #include <vector>
28 
29 LM_NAMESPACE_BEGIN
30 
36 {
37 
38  int s;
39  int t;
40  Math::Vec2 rasterPos;
41  Math::Vec3 L;
42 
43  PSSMLTSplat()
44  {
45 
46  }
47 
48  PSSMLTSplat(int s, int t, const Math::Vec2& rasterPos, const Math::Vec3& L)
49  : s(s)
50  , t(t)
51  , rasterPos(rasterPos)
52  , L(L)
53  {
54 
55  }
56 
57  PSSMLTSplat(const Math::Vec2& rasterPos, const Math::Vec3& L)
58  : s(0)
59  , t(0)
60  , rasterPos(rasterPos)
61  , L(L)
62  {
63 
64  }
65 
66 };
67 
68 class Film;
69 
75 {
76 
77  std::vector<PSSMLTSplat, aligned_allocator<PSSMLTSplat, std::alignment_of<PSSMLTSplat>::value>> splats;
78 
79  LM_PUBLIC_API Math::Float SumI() const;
80  LM_PUBLIC_API void AccumulateContributionToFilm(Film& film, const Math::Float& weight) const;
81 
82 };
83 
84 LM_NAMESPACE_END
85 
86 #endif // LIB_LIGHTMETRICA_PSSMLT_SPLAT_H
Definition: pssmlt.splat.h:35
Math::Vec2 rasterPos
Raster position.
Definition: pssmlt.splat.h:40
Definition: pssmlt.splat.h:74
int s
of light subpath vertices
Definition: pssmlt.splat.h:38
Math::Vec3 L
Radiance.
Definition: pssmlt.splat.h:41
int t
of eye subpath vertices
Definition: pssmlt.splat.h:39
Definition: film.h:34