9#include <Common/assertion.h>
60 bool inferMeasurability =
true);
128 operator bool ()
const;
134 real m_relativeIor{1};
135 bool m_isMeasurable{
false};
159 this->context = std::move(
context);
203 const bool inferMeasurability)
205 m_pdfAppliedBsdfCos = pdfAppliedBsdfCos;
208 if(inferMeasurability)
226 PH_ASSERT_IN_RANGE_EXCLUSIVE(m_cos, 0.0_r, 1.1_r);
234 return pdfAppliedBsdf.isFinite() ? pdfAppliedBsdf :
math::Spectrum(0);
241 PH_ASSERT_MSG(m_pdfAppliedBsdfCos.
isFinite(), m_pdfAppliedBsdfCos.
toString());
243 return m_pdfAppliedBsdfCos;
249 PH_ASSERT_MSG(std::isfinite(m_relativeIor) && m_relativeIor > 0, std::to_string(m_relativeIor));
251 return m_relativeIor;
257 return relativeIor * relativeIor;
262 return m_isMeasurable;
267 m_isMeasurable = measurability;
277 m_relativeIor = relativeIor;
280inline BsdfSampleOutput::operator bool ()
const
282 return isMeasurable();
The environment a BSDF query is performed under.
Definition BsdfQueryContext.h:13
Output for BsdfSampleQuery.
Definition BsdfSampleQuery.h:45
void setL(const math::Vector3R &L)
Definition BsdfSampleQuery.h:193
real getRelativeIor2() const
Definition BsdfSampleQuery.h:254
void setRelativeIor(real relativeIor)
Definition BsdfSampleQuery.h:275
real getRelativeIor() const
Definition BsdfSampleQuery.h:246
void setMeasurability(bool measurability)
Set measurability directly.
Definition BsdfSampleQuery.h:265
const math::Vector3R & getL() const
Definition BsdfSampleQuery.h:215
const math::Spectrum & getPdfAppliedBsdfCos() const
Definition BsdfSampleQuery.h:237
bool isMeasurable() const
Tells whether this sample has potential to contribute. All sampled data should be usable if true is r...
Definition BsdfSampleQuery.h:260
real getCos() const
Definition BsdfSampleQuery.h:223
math::Spectrum getPdfAppliedBsdf() const
Definition BsdfSampleQuery.h:231
void setPdfAppliedBsdfCos(const math::Spectrum &pdfAppliedBsdfCos, real cos, bool inferMeasurability=true)
Definition BsdfSampleQuery.h:200
Information for generating a BSDF sample.
Definition BsdfSampleQuery.h:141
Input inputs
Definition BsdfSampleQuery.h:147
BsdfQueryContext context
Definition BsdfSampleQuery.h:146
BsdfSampleQuery()=default
Output outputs
Definition BsdfSampleQuery.h:148
General information about a ray-surface intersection event.
Definition SurfaceHit.h:59
SurfaceHitReason getReason() const
Definition SurfaceHit.h:164
constexpr bool hasExactly(const FlagsSet &flagsSet) const
Checks whether this instance contains exactly the specified flags. No more, no less.
Definition TBitFlags.ipp:99
std::string toString() const
Definition TArithmeticArrayBase.ipp:825
bool isFinite() const
Definition TArithmeticArrayBase.ipp:585
Definition TTristimulusSpectrum.h:11
T lengthSquared() const
Definition TVectorNBase.ipp:44
LinearSRGBSpectrum Spectrum
Definition spectrum_fwd.h:33
The root for all renderer implementations.
Definition EEngineProject.h:6