Photon Engine 2.0.0-beta
A physically based renderer.
Loading...
Searching...
No Matches
TranslucentMicrofacet.h
Go to the documentation of this file.
1#pragma once
2
6
7#include <memory>
8
9namespace ph
10{
11
18{
19public:
21 const std::shared_ptr<DielectricFresnel>& fresnel,
22 const std::shared_ptr<Microfacet>& microfacet);
23
24 ESurfacePhenomenon getPhenomenonOf(SurfaceElemental elemental) const override;
25
26 std::string toString() const override;
27
28private:
29 void calcBsdf(
30 const BsdfQueryContext& ctx,
31 const BsdfEvalInput& in,
32 BsdfEvalOutput& out) const override;
33
34 void genBsdfSample(
35 const BsdfQueryContext& ctx,
36 const BsdfSampleInput& in,
37 SampleFlow& sampleFlow,
38 BsdfSampleOutput& out) const override;
39
40 void calcBsdfPdf(
41 const BsdfQueryContext& ctx,
42 const BsdfPdfInput& in,
43 BsdfPdfOutput& out) const override;
44
45private:
46 std::shared_ptr<DielectricFresnel> m_fresnel;
47 std::shared_ptr<Microfacet> m_microfacet;
48
49 static real getReflectionProbability(const math::Spectrum& F);
50
51 constexpr static SurfaceElemental REFLECTION = 0;
52 constexpr static SurfaceElemental TRANSMISSION = 1;
53};
54
55// In-header Implementations:
56
57inline std::string TranslucentMicrofacet::toString() const
58{
59 return "Translucent Microfacet, " + SurfaceOptics::toString();
60}
61
62}// 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
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
Microfacet based translucent surface model. Microfacet optical behavior modeled using the dielectric ...
Definition TranslucentMicrofacet.h:18
ESurfacePhenomenon getPhenomenonOf(SurfaceElemental elemental) const override
Get the phenomenon of a surface component. One can also setup query for a specific elemental....
Definition TranslucentMicrofacet.cpp:54
TranslucentMicrofacet(const std::shared_ptr< DielectricFresnel > &fresnel, const std::shared_ptr< Microfacet > &microfacet)
Definition TranslucentMicrofacet.cpp:38
std::string toString() const override
Definition TranslucentMicrofacet.h:57
Definition TTristimulusSpectrum.h:11
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