Skip to content

Implement RandomSampler #26

@wahn

Description

@wahn

The example scene assets/scenes/veach-mis/mis.pbrt uses a RandomSampler:

> grep Sampler assets/scenes/veach-mis/mis.pbrt
Sampler "random" "integer pixelsamples" [128]

Right now we have three implementors of the trait Sampler:

> rg -trust "impl Sampler for"
src/samplers/sobol.rs
90:impl Sampler for SobolSampler {

src/samplers/zerotwosequence.rs
96:impl Sampler for ZeroTwoSequenceSampler {

src/samplers/halton.rs
178:impl Sampler for HaltonSampler {

In C++ the class RandomSampler ist directly inherited from Sampler:

class RandomSampler : public Sampler {
  public:
    RandomSampler(int ns, int seed = 0);
    void StartPixel(const Point2i &);
    Float Get1D();
    Point2f Get2D();
    std::unique_ptr<Sampler> Clone(int seed);

  private:
    RNG rng;
};

Metadata

Metadata

Assignees

Labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions