Photon Engine 2.0.0-beta
A physically based renderer.
Loading...
Searching...
No Matches
HaltonSampleSource.h
Go to the documentation of this file.
1#pragma once
2
5#include "SDL/sdl_interface.h"
6
7namespace ph
8{
9
11{
12public:
13 void cook(const CoreCookingContext& ctx, CoreCookedUnit& cooked) override;
14
15private:
16 EHaltonPermutation m_permutation;
17 EHaltonSequence m_sequence;
18
19public:
21 {
22 ClassType clazz("halton");
23 clazz.docName("Halton Sample Source");
24 clazz.description(
25 "Generating samples based on the Halton sequence. The samples generated are somewhat "
26 "deterministic and can lead to visible patterns if the number of samples is too low. "
27 "Also, when Halton sequence is used with a low sample count generator, this often "
28 "results in visible artifact along edges even after a large number of iterations. "
29 "This is partially due to low sample index being repeatedly used. When this happens, "
30 "try more advanced permutation scheme or use back-to-back sample indices.");
31 clazz.baseOn<RuntimeSampleSource>();
32
33 TSdlEnumField<OwnerType, EHaltonPermutation> permutation("permutation", &OwnerType::m_permutation);
34 permutation.description("Permutation scheme of Halton sequence.");
35 permutation.defaultTo(EHaltonPermutation::Fixed);
36 permutation.optional();
37 clazz.addField(permutation);
38
39 TSdlEnumField<OwnerType, EHaltonSequence> sequence("sequence", &OwnerType::m_sequence);
40 sequence.description("Generated sequence of Halton sample generator.");
42 sequence.optional();
43 clazz.addField(sequence);
44
45 return clazz;
46 }
47};
48
49}// end namespace ph
Definition CoreCookedUnit.h:19
Definition CoreCookingContext.h:15
Definition HaltonSampleSource.h:11
void cook(const CoreCookingContext &ctx, CoreCookedUnit &cooked) override
Definition HaltonSampleSource.cpp:8
PH_DEFINE_SDL_CLASS(TSdlOwnerClass< HaltonSampleSource >)
Definition HaltonSampleSource.h:20
Definition RuntimeSampleSource.h:17
Definition TSdlEnumField.h:23
SDL binding type for a canonical SDL resource class.
Definition TSdlOwnerClass.h:23
TSdlValue & description(std::string descriptionStr)
Definition TSdlValue.ipp:95
TSdlValue & optional()
Definition TSdlValue.ipp:103
TSdlValue & defaultTo(T defaultValue)
Definition TSdlValue.ipp:71
The root for all renderer implementations.
Definition EEngineProject.h:6
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