8#include <Common/primitive_type.h>
22 const std::shared_ptr<SurfaceOptics>& optics0,
23 const std::shared_ptr<SurfaceOptics>& optics1);
28 const std::shared_ptr<SurfaceOptics>& optics0,
29 const std::shared_ptr<SurfaceOptics>& optics1,
35 const std::shared_ptr<SurfaceOptics>& optics0,
36 const std::shared_ptr<SurfaceOptics>& optics1,
41 std::string
toString()
const override;
60 static real probabilityOfPickingOptics0(
const math::Spectrum& ratio);
62 std::shared_ptr<SurfaceOptics> m_optics0;
63 std::shared_ptr<SurfaceOptics> m_optics1;
64 std::shared_ptr<TTexture<math::Spectrum>> m_ratio;
74 "Lerped Surface Optics, "
75 "optics_0: " + m_optics0->toString() +
76 "optics_1: " + m_optics1->toString() +
80inline real LerpedSurfaceOptics::probabilityOfPickingOptics0(
const math::Spectrum& ratio)
84 const real weight0 = ratio.
abs().sum();
85 const real weight1 = ratio.
complement().abs().sum();
86 return math::clamp(weight0 / (weight0 + weight1), 0.0_r, 1.0_r);
Output for BsdfEvalQuery.
Definition BsdfEvalQuery.h:47
Output for BsdfPdfQuery.
Definition BsdfPdfQuery.h:46
The environment a BSDF query is performed under.
Definition BsdfQueryContext.h:13
Output for BsdfSampleQuery.
Definition BsdfSampleQuery.h:45
Linearly interpolate between two surface optics.
Definition LerpedSurfaceOptics.h:19
std::string toString() const override
Definition LerpedSurfaceOptics.h:71
ESurfacePhenomenon getPhenomenonOf(SurfaceElemental elemental) const override
Get the phenomenon of a surface component. One can also setup query for a specific elemental....
Definition LerpedSurfaceOptics.cpp:68
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
friend class LerpedSurfaceOptics
Definition SurfaceOptics.h:19
virtual std::string toString() const
Definition SurfaceOptics.h:104
Common settings and operations for sampling a texture.
Definition TSampler.h:18
Derived complement() const
Complements the array's elements. Effectively performing 1 - (*this)[i] for each element.
Definition TArithmeticArrayBase.ipp:502
Derived abs() const
Definition TArithmeticArrayBase.ipp:466
Definition TTristimulusSpectrum.h:11
T clamp(const T value, const T lowerBound, const T upperBound)
Clamps a value to [lowerBound, upperBound]. None of value, lowerBound and upperBound can be NaN,...
Definition math.h:77
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