Revision 2900,
1.2 KB
checked in by mattausch, 16 years ago
(diff) |
changed to real 3d samples which are then projected to texture space
|
Line | |
---|
1 | #ifndef __SAMPLEGENERATOR_H
|
---|
2 | #define __SAMPLEGENERATOR_H
|
---|
3 |
|
---|
4 |
|
---|
5 | /** Class that generates samples on a circle
|
---|
6 | */
|
---|
7 |
|
---|
8 | struct Sample2
|
---|
9 | {
|
---|
10 | Sample2() {}
|
---|
11 | Sample2(float _x, float _y): x(_x), y(_y) {}
|
---|
12 |
|
---|
13 | float x;
|
---|
14 | float y;
|
---|
15 | };
|
---|
16 |
|
---|
17 |
|
---|
18 | struct Sample3
|
---|
19 | {
|
---|
20 | Sample3() {}
|
---|
21 | Sample3(float _x, float _y, float _z): x(_x), y(_y), z(_z) {}
|
---|
22 |
|
---|
23 | float x;
|
---|
24 | float y;
|
---|
25 | float z;
|
---|
26 | };
|
---|
27 |
|
---|
28 | /** Class generating random samples on a disc or a sphere, respectively.
|
---|
29 | */
|
---|
30 | class SampleGenerator
|
---|
31 | {
|
---|
32 | public:
|
---|
33 |
|
---|
34 | SampleGenerator(int numSamples, float radius);
|
---|
35 |
|
---|
36 | virtual void Generate(float *samples) const = 0;
|
---|
37 |
|
---|
38 | protected:
|
---|
39 |
|
---|
40 | SampleGenerator() {};
|
---|
41 |
|
---|
42 | int mNumSamples;
|
---|
43 | float mRadius;
|
---|
44 | };
|
---|
45 |
|
---|
46 |
|
---|
47 | class PoissonDiscSampleGenerator: public SampleGenerator
|
---|
48 | {
|
---|
49 | public:
|
---|
50 |
|
---|
51 | PoissonDiscSampleGenerator(int numSamples, float radius);
|
---|
52 |
|
---|
53 | virtual void Generate(float *samples) const;
|
---|
54 | };
|
---|
55 |
|
---|
56 |
|
---|
57 | class GaussianSampleGenerator: public SampleGenerator
|
---|
58 | {
|
---|
59 | public:
|
---|
60 |
|
---|
61 | GaussianSampleGenerator(int numSamples, float radius);
|
---|
62 |
|
---|
63 | virtual void Generate(float *samples) const;
|
---|
64 | };
|
---|
65 |
|
---|
66 |
|
---|
67 | class SphericalSampleGenerator: public SampleGenerator
|
---|
68 | {
|
---|
69 | public:
|
---|
70 |
|
---|
71 | SphericalSampleGenerator(int numSamples, float radius);
|
---|
72 |
|
---|
73 | virtual void Generate(float *samples) const;
|
---|
74 | };
|
---|
75 |
|
---|
76 |
|
---|
77 | #endif |
---|
Note: See
TracBrowser
for help on using the repository browser.