Photon Engine 2.0.0-beta
A physically based renderer.
Loading...
Searching...
No Matches
LambertianReflector.h
Go to the documentation of this file.
1#pragma once
2
6
7#include <memory>
8
9namespace ph
10{
11
16{
17public:
18 explicit LambertianReflector(const std::shared_ptr<TTexture<math::Spectrum>>& albedo);
19
20 ESurfacePhenomenon getPhenomenonOf(SurfaceElemental elemental) const override;
21
22 std::string toString() const override;
23
24private:
25 void calcBsdf(
26 const BsdfQueryContext& ctx,
27 const BsdfEvalInput& in,
28 BsdfEvalOutput& out) const override;
29
30 void genBsdfSample(
31 const BsdfQueryContext& ctx,
32 const BsdfSampleInput& in,
33 SampleFlow& sampleFlow,
34 BsdfSampleOutput& out) const override;
35
36 void calcBsdfPdf(
37 const BsdfQueryContext& ctx,
38 const BsdfPdfInput& in,
39 BsdfPdfOutput& out) const override;
40
41private:
42 std::shared_ptr<TTexture<math::Spectrum>> m_albedo;
43};
44
45// In-header Implementations:
46
47inline std::string LambertianReflector::toString() const
48{
49 return "Lambertian Diffuse, " + SurfaceOptics::toString();
50}
51
52}// end namespace ph
Input for BsdfEvalQuery.
Definition BsdfEvalQuery.h:20
Output for BsdfEvalQuery.
Definition BsdfEvalQuery.h:47
Input for BsdfPdfQuery.
Definition BsdfPdfQuery.h:19
Output for BsdfPdfQuery.
Definition BsdfPdfQuery.h:46
The environment a BSDF query is performed under.
Definition BsdfQueryContext.h:13
Input for BsdfSampleQuery.
Definition BsdfSampleQuery.h:21
Output for BsdfSampleQuery.
Definition BsdfSampleQuery.h:45
Lambertian diffuse model for an opaque surface. This model is double-sided.
Definition LambertianReflector.h:16
ESurfacePhenomenon getPhenomenonOf(SurfaceElemental elemental) const override
Get the phenomenon of a surface component. One can also setup query for a specific elemental....
Definition LambertianReflector.cpp:32
LambertianReflector(const std::shared_ptr< TTexture< math::Spectrum > > &albedo)
Definition LambertianReflector.cpp:23
std::string toString() const override
Definition LambertianReflector.h:47
A sample with arbitrary dimensions with fine-grained sampling control.
Definition SampleFlow.h:19
Describes how light interacts with a surface.
Definition SurfaceOptics.h:17
virtual std::string toString() const
Definition SurfaceOptics.h:104
Definition TTexture.h:12
The root for all renderer implementations.
Definition EEngineProject.h:6
ESurfacePhenomenon
Available surface phenomena.
Definition surface_optics_fwd.h:16
int SurfaceElemental
Definition surface_optics_fwd.h:30