Photon Engine 2.0.0-beta
A physically based renderer.
Loading...
Searching...
No Matches
DiffuseSurfaceEmitter.h
Go to the documentation of this file.
1#pragma once
2
6
7#include <Common/assertion.h>
8#include <Common/primitive_type.h>
9
10#include <memory>
11
12namespace ph
13{
14
15class Primitive;
16
20{
21public:
23 const Primitive* surface,
24 const std::shared_ptr<TTexture<math::Spectrum>>& emittedEnergy,
26
27 void evalEmittedEnergy(const SurfaceHit& Xe, math::Spectrum* out_energy) const override;
28
29 void genDirectSample(
31 SampleFlow& sampleFlow,
32 HitProbe& probe) const override;
33
34 void calcDirectPdf(DirectEnergyPdfQuery& query) const override;
35
36 void emitRay(
38 SampleFlow& sampleFlow,
39 HitProbe& probe) const override;
40
41 real calcRadiantFluxApprox() const override;
42
43 const Primitive& getSurface() const;
45
46private:
47 const Primitive* m_surface;
48 std::shared_ptr<TTexture<math::Spectrum>> m_emittedEnergy;
49};
50
52{
53 PH_ASSERT(m_surface);
54 return *m_surface;
55}
56
58{
59 PH_ASSERT(m_emittedEnergy);
60 return *m_emittedEnergy;
61}
62
63}// end namespace ph
Base for diffusive surface emitters.
Definition DiffuseSurfaceEmitterBase.h:15
Diffusive surface emitter.
Definition DiffuseSurfaceEmitter.h:20
real calcRadiantFluxApprox() const override
Definition DiffuseSurfaceEmitter.cpp:55
void evalEmittedEnergy(const SurfaceHit &Xe, math::Spectrum *out_energy) const override
Evaluate emitted energy from a point on the surface.
Definition DiffuseSurfaceEmitter.cpp:29
const TTexture< math::Spectrum > & getEmittedEnergy() const
Definition DiffuseSurfaceEmitter.h:57
void genDirectSample(DirectEnergySampleQuery &query, SampleFlow &sampleFlow, HitProbe &probe) const override
Sample direct lighting for a target position.
Definition DiffuseSurfaceEmitter.cpp:34
void emitRay(EnergyEmissionSampleQuery &query, SampleFlow &sampleFlow, HitProbe &probe) const override
Emit a ray that carries some amount of energy from this emitter.
Definition DiffuseSurfaceEmitter.cpp:47
const Primitive & getSurface() const
Definition DiffuseSurfaceEmitter.h:51
void calcDirectPdf(DirectEnergyPdfQuery &query) const override
Calculate the PDF of direct lighting for a target position.
Definition DiffuseSurfaceEmitter.cpp:42
DiffuseSurfaceEmitter(const Primitive *surface, const std::shared_ptr< TTexture< math::Spectrum > > &emittedEnergy, EmitterFeatureSet featureSet=defaultFeatureSet)
Definition DiffuseSurfaceEmitter.cpp:15
Information for the probability of generating a specific sample for direct energy estimation.
Definition DirectEnergyPdfQuery.h:81
Information for generating a sample for direct energy estimation.
Definition DirectEnergySampleQuery.h:89
static constexpr auto defaultFeatureSet
Definition Emitter.h:70
Information for generating a sample for energy emission.
Definition EnergyEmissionSampleQuery.h:63
Lightweight ray intersection testing and reporting object. If an intersection is found,...
Definition HitProbe.h:27
A physical shape in the scene.
Definition Primitive.h:23
A sample with arbitrary dimensions with fine-grained sampling control.
Definition SampleFlow.h:19
General information about a ray-surface intersection event.
Definition SurfaceHit.h:59
Manipulate a value type where each bit is a binary flag.
Definition TBitFlags.h:17
Definition TTexture.h:12
Definition TTristimulusSpectrum.h:11
The root for all renderer implementations.
Definition EEngineProject.h:6