Photon Engine 2.0.0-beta
A physically based renderer.
Loading...
Searching...
No Matches
LatLongEnvEmitter.h
Go to the documentation of this file.
1#pragma once
2
7#include "Math/TVector2.h"
8
9#include <memory>
10#include <cstddef>
11
12namespace ph
13{
14
15class Primitive;
16
26{
27public:
28 using RadianceTexture = std::shared_ptr<TTexture<math::Spectrum>>;
29
31 const Primitive* envSurface,
32 const RadianceTexture& radiance,
33 const math::Vector2S& resolution,
35
36 void evalEmittedEnergy(const SurfaceHit& Xe, math::Spectrum* out_energy) const override;
37
38 void genDirectSample(
40 SampleFlow& sampleFlow,
41 HitProbe& probe) const override;
42
43 void calcDirectPdf(DirectEnergyPdfQuery& query) const override;
44
45 void emitRay(
47 SampleFlow& sampleFlow,
48 HitProbe& probe) const override;
49
50 real calcRadiantFluxApprox() const override;
51
52 void setFrontFaceEmit() override;
53 void setBackFaceEmit() override;
54
55private:
56 const Primitive* m_envSurface;
57 RadianceTexture m_radiance;
58 math::TPwcDistribution2D<real> m_sampleDistribution;
59 real m_radiantFluxApprox;
60};
61
62}// 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
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
Models energy coming from background.
Definition LatLongEnvEmitter.h:26
real calcRadiantFluxApprox() const override
Definition LatLongEnvEmitter.cpp:214
void genDirectSample(DirectEnergySampleQuery &query, SampleFlow &sampleFlow, HitProbe &probe) const override
Sample direct lighting for a target position.
Definition LatLongEnvEmitter.cpp:97
void emitRay(EnergyEmissionSampleQuery &query, SampleFlow &sampleFlow, HitProbe &probe) const override
Emit a ray that carries some amount of energy from this emitter.
Definition LatLongEnvEmitter.cpp:170
void setFrontFaceEmit() override
Definition LatLongEnvEmitter.cpp:221
void setBackFaceEmit() override
Definition LatLongEnvEmitter.cpp:228
std::shared_ptr< TTexture< math::Spectrum > > RadianceTexture
Definition LatLongEnvEmitter.h:28
LatLongEnvEmitter(const Primitive *envSurface, const RadianceTexture &radiance, const math::Vector2S &resolution, EmitterFeatureSet featureSet=defaultFeatureSet)
Definition LatLongEnvEmitter.cpp:31
void calcDirectPdf(DirectEnergyPdfQuery &query) const override
Calculate the PDF of direct lighting for a target position.
Definition LatLongEnvEmitter.cpp:146
void evalEmittedEnergy(const SurfaceHit &Xe, math::Spectrum *out_energy) const override
Evaluate emitted energy from a point on the surface.
Definition LatLongEnvEmitter.cpp:86
A physical shape in the scene.
Definition Primitive.h:23
A sample with arbitrary dimensions with fine-grained sampling control.
Definition SampleFlow.h:19
Definition SurfaceEmitter.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 TPwcDistribution2D.h:16
Definition TTristimulusSpectrum.h:11
The root for all renderer implementations.
Definition EEngineProject.h:6