Photon Engine 2.0.0-beta
A physically based renderer.
Loading...
Searching...
No Matches
SGHalton.h
Go to the documentation of this file.
1#pragma once
2
17#include "Utility/TSpan.h"
18
19#include <Common/primitive_type.h>
20
21#include <cstddef>
22#include <vector>
23
24namespace ph
25{
26
28{
29public:
31 std::size_t numSamples,
32 EHaltonPermutation permutation,
33 EHaltonSequence sequence);
34
35 std::unique_ptr<SampleGenerator> makeNewborn(std::size_t numSampleBatches) const override;
36
37private:
38 void onRebirth() override;
39
40 void genSamples1D(
41 const SampleContext& context,
42 const SampleStage& stage,
43 SamplesND out_samples) override;
44
45 void genSamples2D(
46 const SampleContext& context,
47 const SampleStage& stage,
48 SamplesND out_samples) override;
49
50 void genSamplesGE3D(
51 const SampleContext& context,
52 const SampleStage& stage,
53 SamplesND out_samples) override;
54
55 bool isSamplesGE3DSupported() const override;
56
57 void startNewSequence();
58
59 void genSamplesOfAnyDimensions(
60 const SampleContext& context,
61 const SampleStage& stage,
62 SamplesND out_samples);
63
64 static real genSingleGeneralHaltonSample(
65 EHaltonPermutation permutation,
66 std::size_t dimIndex,
67 uint64 seedValue,
69
70 EHaltonPermutation m_permutation;
71 EHaltonSequence m_sequence;
72
73 std::vector<halton_detail::PermutationTable> m_permutationTables;
74 std::vector<uint64> m_dimSeedRecords;
75 uint64 m_leapAmount;
76};
77
78}// end namespace ph
Definition SGHalton.h:28
std::unique_ptr< SampleGenerator > makeNewborn(std::size_t numSampleBatches) const override
Make a new generator.
Definition SGHalton.cpp:203
SGHalton(std::size_t numSamples, EHaltonPermutation permutation, EHaltonSequence sequence)
Definition SGHalton.cpp:23
Definition SampleContext.h:9
Generates samples in [0, 1]. Generators of different types produces samples with different properties...
Definition SampleGenerator.h:35
std::size_t numSampleBatches() const
Definition SampleGenerator.h:143
Definition SampleStage.h:14
Definition SamplesND.h:16
The root for all renderer implementations.
Definition EEngineProject.h:6
std::span< const T, EXTENT > TSpanView
Same as TSpan, except that the objects are const-qualified. Note that for pointer types,...
Definition TSpan.h:19
EHaltonPermutation
Permutation schemes available for a Halton sequence. See sdl_halton_randomization_types....
Definition halton_randomization_enums.h:10
EHaltonSequence
Definition halton_randomization_enums.h:18