Photon Engine 2.0.0-beta
A physically based renderer.
Loading...
Searching...
No Matches
TDirectLightEstimator.h
Go to the documentation of this file.
1#pragma once
2
3#include "Math/math_fwd.h"
6
7#include <Common/primitive_type.h>
8
9#include <optional>
10
11namespace ph { class Scene; }
12namespace ph { class SurfaceHit; }
13namespace ph { class SampleFlow; }
14namespace ph { class Emitter; }
15namespace ph { class Primitive; }
16namespace ph { class SurfaceOptics; }
17namespace ph { class BsdfSampleQuery; }
18namespace ph { class DirectEnergySampleQuery; }
19
20namespace ph::lta
21{
22
29template<ESidednessPolicy POLICY>
31{
32public:
33 explicit TDirectLightEstimator(const Scene* scene);
34
44 [[nodiscard]]
46 BsdfSampleQuery& bsdfSample,
47 SampleFlow& sampleFlow,
48 math::Spectrum* out_Le = nullptr,
49 std::optional<SurfaceHit>* out_X = nullptr) const;
50
60 [[nodiscard]]
62 DirectEnergySampleQuery& directSample,
63 SampleFlow& sampleFlow,
64 SurfaceHit* out_Xe = nullptr) const;
65
76 [[nodiscard]]
78 BsdfSampleQuery& bsdfSample,
79 SampleFlow& sampleFlow,
80 math::Spectrum* out_Lo = nullptr,
81 std::optional<SurfaceHit>* out_X = nullptr) const;
82
87 [[nodiscard]]
89 const SurfaceHit& X,
90 const SurfaceHit& Xe) const;
91
96 [[nodiscard]]
97 bool isNeeSamplable(const SurfaceHit& X) const;
98
99private:
100 const Scene& getScene() const;
101
102 const Scene* m_scene;
103};
104
105}// end namespace ph::lta
106
Information for generating a BSDF sample.
Definition BsdfSampleQuery.h:141
Information for generating a sample for direct energy estimation.
Definition DirectEnergySampleQuery.h:89
A sample with arbitrary dimensions with fine-grained sampling control.
Definition SampleFlow.h:19
A unified interface for accessing cooked content in a visual world.
Definition Scene.h:27
General information about a ray-surface intersection event.
Definition SurfaceHit.h:59
Estimate direct lighting for a surface point. This is a lightweight helper type for estimating direct...
Definition TDirectLightEstimator.h:31
bool bsdfSamplePathWithNee(BsdfSampleQuery &bsdfSample, SampleFlow &sampleFlow, math::Spectrum *out_Lo=nullptr, std::optional< SurfaceHit > *out_X=nullptr) const
Sample lighting by combining the techniques used by bsdfSample() and neeSample(). A light sampling te...
Definition TDirectLightEstimator.ipp:105
bool bsdfSampleEmission(BsdfSampleQuery &bsdfSample, SampleFlow &sampleFlow, math::Spectrum *out_Le=nullptr, std::optional< SurfaceHit > *out_X=nullptr) const
Sample lighting using BSDF's suggestion. A light sampling technique that is always valid.
Definition TDirectLightEstimator.ipp:39
TDirectLightEstimator(const Scene *scene)
Definition TDirectLightEstimator.ipp:32
bool isNeeSamplable(const SurfaceHit &X) const
Definition TDirectLightEstimator.ipp:233
bool neeSampleEmission(DirectEnergySampleQuery &directSample, SampleFlow &sampleFlow, SurfaceHit *out_Xe=nullptr) const
Sample lighting using next-event estimation. This light sampling technique may not always be valid....
Definition TDirectLightEstimator.ipp:71
real neeSamplePdfWUnoccluded(const SurfaceHit &X, const SurfaceHit &Xe) const
Get the solid angle domain PDF of an next-event estimation lighting sample. Surface occlusion is not ...
Definition TDirectLightEstimator.ipp:219
Definition TTristimulusSpectrum.h:11
Light transport algorithms.
Definition enums.h:6
The root for all renderer implementations.
Definition EEngineProject.h:6