6#include <Common/config.h>
7#include <Common/assertion.h>
8#include <Common/primitive_type.h>
23 const real signedPdfW = pdfA / dAPosToTargetPos.
normalize().
dot(dANormal) * distSquared;
24 return std::isfinite(signedPdfW) ? std::abs(signedPdfW) : 0.0_r;
54 PH_ASSERT_NE(Ng.
dot(V) * Ns.
dot(L), 0.0_r);
56 return std::abs((Ns.
dot(V) * Ng.
dot(L)) / (Ng.
dot(V) * Ns.
dot(L)));
78 PH_ASSERT_NE(Ng.
dot(V), 0.0_r);
80 return std::abs(Ns.
dot(V) / Ng.
dot(V));
101#if PH_STRICT_ASYMMETRIC_IMPORTANCE_TRANSPORT
117#if PH_STRICT_ASYMMETRIC_IMPORTANCE_TRANSPORT
T dot(const Derived &rhs) const
Definition TVectorNBase.ipp:14
Derived normalize() const
Normalize the vector. Notice that normalizing a integer typed vector will result in 0-vector most of ...
Definition TVectorNBase.ipp:50
T lengthSquared() const
Definition TVectorNBase.ipp:44
Miscellaneous math utilities.
Light transport algorithms.
Definition enums.h:6
real importance_scatter_Ns_corrector(const math::Vector3R &Ns, const math::Vector3R &Ng, const math::Vector3R &L, const math::Vector3R &V)
Definition lta.h:48
real pdfA_to_pdfW(const real pdfA, const math::Vector3R &dAPosToTargetPos, const math::Vector3R &dANormal)
Transform area domain PDF to solid angle domain PDF w.r.t. a position.
Definition lta.h:17
real tamed_importance_scatter_Ns_corrector(const math::Vector3R &Ns, const math::Vector3R &Ng, const math::Vector3R &L, const math::Vector3R &V)
Smoother version of importance_scatter_Ns_corrector().
Definition lta.h:94
real tamed_importance_BSDF_Ns_corrector(const math::Vector3R &Ns, const math::Vector3R &Ng, const math::Vector3R &V)
Smoother version of importance_BSDF_Ns_corrector(). See tamed_importance_scatter_Ns_corrector() for e...
Definition lta.h:111
real importance_BSDF_Ns_corrector(const math::Vector3R &Ns, const math::Vector3R &Ng, const math::Vector3R &V)
Definition lta.h:73
T safe_clamp(const T value, const T lowerBound, const T upperBound)
Clamps a value to [lowerBound, upperBound], fallback to lowerBound. If a floating-point value is non-...
Definition math.h:98