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
|
Rev | Line | |
---|
[2853] | 1 | #ifndef __SAMPLEGENERATOR_H
|
---|
| 2 | #define __SAMPLEGENERATOR_H
|
---|
| 3 |
|
---|
| 4 |
|
---|
| 5 | /** Class that generates samples on a circle
|
---|
| 6 | */
|
---|
| 7 |
|
---|
| 8 | struct Sample2
|
---|
| 9 | {
|
---|
[2886] | 10 | Sample2() {}
|
---|
| 11 | Sample2(float _x, float _y): x(_x), y(_y) {}
|
---|
| 12 |
|
---|
[2853] | 13 | float x;
|
---|
| 14 | float y;
|
---|
| 15 | };
|
---|
| 16 |
|
---|
| 17 |
|
---|
[2900] | 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 | */
|
---|
[2853] | 30 | class SampleGenerator
|
---|
| 31 | {
|
---|
| 32 | public:
|
---|
| 33 |
|
---|
| 34 | SampleGenerator(int numSamples, float radius);
|
---|
| 35 |
|
---|
[2900] | 36 | virtual void Generate(float *samples) const = 0;
|
---|
[2853] | 37 |
|
---|
| 38 | protected:
|
---|
| 39 |
|
---|
| 40 | SampleGenerator() {};
|
---|
| 41 |
|
---|
| 42 | int mNumSamples;
|
---|
| 43 | float mRadius;
|
---|
| 44 | };
|
---|
| 45 |
|
---|
| 46 |
|
---|
| 47 | class PoissonDiscSampleGenerator: public SampleGenerator
|
---|
| 48 | {
|
---|
| 49 | public:
|
---|
[2886] | 50 |
|
---|
[2853] | 51 | PoissonDiscSampleGenerator(int numSamples, float radius);
|
---|
| 52 |
|
---|
[2900] | 53 | virtual void Generate(float *samples) const;
|
---|
[2853] | 54 | };
|
---|
| 55 |
|
---|
[2898] | 56 |
|
---|
| 57 | class GaussianSampleGenerator: public SampleGenerator
|
---|
| 58 | {
|
---|
| 59 | public:
|
---|
| 60 |
|
---|
| 61 | GaussianSampleGenerator(int numSamples, float radius);
|
---|
| 62 |
|
---|
[2900] | 63 | virtual void Generate(float *samples) const;
|
---|
[2898] | 64 | };
|
---|
| 65 |
|
---|
| 66 |
|
---|
[2899] | 67 | class SphericalSampleGenerator: public SampleGenerator
|
---|
| 68 | {
|
---|
| 69 | public:
|
---|
| 70 |
|
---|
| 71 | SphericalSampleGenerator(int numSamples, float radius);
|
---|
| 72 |
|
---|
[2900] | 73 | virtual void Generate(float *samples) const;
|
---|
[2899] | 74 | };
|
---|
| 75 |
|
---|
| 76 |
|
---|
[2853] | 77 | #endif |
---|
Note: See
TracBrowser
for help on using the repository browser.