Photon Engine 2.0.0-beta
A physically based renderer.
Loading...
Searching...
No Matches
SurfaceEmitter.h
Go to the documentation of this file.
1#pragma once
2
3#include "Common/primitive_type.h"
4#include "Math/math_fwd.h"
9#include "Core/LTA/PDF.h"
10
11#include <memory>
12
13namespace ph { class Primitive; }
14
15namespace ph
16{
17
18class SurfaceEmitter : public Emitter
19{
20public:
22
23 void evalEmittedEnergy(const SurfaceHit& Xe, math::Spectrum* out_energy) const override = 0;
24
27 SampleFlow& sampleFlow,
28 HitProbe& probe) const override = 0;
29
30 void calcDirectPdf(DirectEnergyPdfQuery& query) const override = 0;
31
32 void emitRay(
34 SampleFlow& sampleFlow,
35 HitProbe& probe) const override = 0;
36
37 virtual void setFrontFaceEmit();
38 virtual void setBackFaceEmit();
39
40protected:
45 bool canEmit(const math::Vector3R& emitDir, const math::Vector3R& N) const;
46
55 const lta::PDF& pickPdf = lta::PDF::D(1),
56 const lta::PDF& emitPosUvwPdf = {}) const;
57
59};
60
61}// end namespace ph
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
An electromagnetic energy emitting source. The emitted energy can be captured by a Receiver.
Definition Emitter.h:68
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 sample with arbitrary dimensions with fine-grained sampling control.
Definition SampleFlow.h:19
Definition SurfaceEmitter.h:19
void calcDirectPdf(DirectEnergyPdfQuery &query) const override=0
Calculate the PDF of direct lighting for a target position.
void calcDirectPdfWForSrcPrimitive(DirectEnergyPdfQuery &query, const lta::PDF &pickPdf=lta::PDF::D(1), const lta::PDF &emitPosUvwPdf={}) const
Definition SurfaceEmitter.cpp:37
bool m_isBackFaceEmission
Definition SurfaceEmitter.h:58
virtual void setBackFaceEmit()
Definition SurfaceEmitter.cpp:32
virtual void setFrontFaceEmit()
Definition SurfaceEmitter.cpp:27
SurfaceEmitter(EmitterFeatureSet featureSet=defaultFeatureSet)
Definition SurfaceEmitter.cpp:15
bool canEmit(const math::Vector3R &emitDir, const math::Vector3R &N) const
Definition SurfaceEmitter.cpp:20
void emitRay(EnergyEmissionSampleQuery &query, SampleFlow &sampleFlow, HitProbe &probe) const override=0
Emit a ray that carries some amount of energy from this emitter.
void genDirectSample(DirectEnergySampleQuery &query, SampleFlow &sampleFlow, HitProbe &probe) const override=0
Sample direct lighting for a target position.
void evalEmittedEnergy(const SurfaceHit &Xe, math::Spectrum *out_energy) const override=0
Evaluate emitted energy from a point on the surface.
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
A sample from a Probability Density Function (PDF).
Definition PDF.h:14
static PDF D(real pdfD)
Definition PDF.h:82
Definition TTristimulusSpectrum.h:11
The root for all renderer implementations.
Definition EEngineProject.h:6