Photon Engine 2.0.0-beta
A physically based renderer.
Loading...
Searching...
No Matches
RuntimeSampleSource.h
Go to the documentation of this file.
1#pragma once
2
4#include "SDL/sdl_interface.h"
5
6#include <Common/assertion.h>
7#include <Common/primitive_type.h>
8
9#include <cstddef>
10
11namespace ph
12{
13
14// TODO: cached samples
15
17{
18public:
19 void cook(const CoreCookingContext& ctx, CoreCookedUnit& cooked) override = 0;
20
21 std::size_t getNumSamples() const;
22
23private:
24 std::size_t m_numSamples;
25
26public:
28 {
29 ClassType clazz("runtime");
30 clazz.docName("Runtime Sample Source");
31 clazz.description(
32 "Sample sources that generate samples during render engine execution time.");
33 clazz.baseOn<SampleSource>();
34
35 TSdlSize<OwnerType> numSamples("samples", &OwnerType::m_numSamples);
36 numSamples.description(
37 "Number of samples that will be generated. This is the number of samples "
38 "that each data unit (such as a single pixel) will receive, on average.");
39 numSamples.defaultTo(1);
40 numSamples.required();
41 clazz.addField(numSamples);
42
43 return clazz;
44 }
45};
46
47// In-header Implementations:
48
49inline std::size_t RuntimeSampleSource::getNumSamples() const
50{
51 return m_numSamples;
52}
53
54}// end namespace ph
Definition CoreCookedUnit.h:19
Definition CoreCookingContext.h:15
Definition RuntimeSampleSource.h:17
PH_DEFINE_SDL_CLASS(TSdlOwnerClass< RuntimeSampleSource >)
Definition RuntimeSampleSource.h:27
void cook(const CoreCookingContext &ctx, CoreCookedUnit &cooked) override=0
std::size_t getNumSamples() const
Definition RuntimeSampleSource.h:49
Definition SampleSource.h:10
A field class that binds a integral member variable.
Definition TSdlInteger.h:21
SDL binding type for a canonical SDL resource class.
Definition TSdlOwnerClass.h:23
The root for all renderer implementations.
Definition EEngineProject.h:6