6#include <Common/assertion.h>
40 const std::array<real, 2>& alphas)
const = 0;
50 const std::array<real, 2>& sample,
69 real
smithG1(real lambdaValue)
const;
111 return 1.0_r / (1.0_r + lambdaValue);
119 PH_ASSERT_GE(N.
dot(H), -1e-3_r);
130 PH_ASSERT_GE(N.
dot(H), -1e-3_r);
133 const real g1V =
smithG1(lambdaV);
135 const real vndf = g1V * ndf * std::abs(H.
dot(V) / N.
dot(V));
Definition Microfacet.h:22
Definition ShapeInvariantMicrofacet.h:16
virtual real lambda(const SurfaceHit &X, const math::Vector3R &N, const math::Vector3R &H, const math::Vector3R &unitDir, const std::array< real, 2 > &alphas) const =0
The function that appears in the masking-shadowing term. For isotropic distributions,...
real visibleDistribution(const SurfaceHit &X, const math::Vector3R &N, const math::Vector3R &H, const math::Vector3R &V) const
Definition ShapeInvariantMicrofacet.h:124
real geometry(const SurfaceHit &X, const math::Vector3R &N, const math::Vector3R &H, const math::Vector3R &L, const math::Vector3R &V) const override
Masking and shadowing due to nearby microfacets. The term.
Definition ShapeInvariantMicrofacet.cpp:20
real distribution(const SurfaceHit &X, const math::Vector3R &N, const math::Vector3R &H) const override=0
Distribution of the microfacet normal. The term. Also commonly knwon as the NDF (normal distribution...
real empiricalPhiCorrelation(const SurfaceHit &X, const math::Vector3R &L, const math::Vector3R &V) const
Definition ShapeInvariantMicrofacet.cpp:86
void sampleH(const SurfaceHit &X, const math::Vector3R &N, const std::array< real, 2 > &sample, math::Vector3R *out_H) const override=0
Generate a microfacet normal H for the distribution. This samples all possible H vectors for the dist...
EMaskingShadowing m_maskingShadowingType
Definition ShapeInvariantMicrofacet.h:96
real projectedDistribution(const SurfaceHit &X, const math::Vector3R &N, const math::Vector3R &H) const
Definition ShapeInvariantMicrofacet.h:114
lta::PDF pdfSampleH(const SurfaceHit &X, const math::Vector3R &N, const math::Vector3R &H) const override
Definition ShapeInvariantMicrofacet.h:99
real smithG1(real lambdaValue) const
Definition ShapeInvariantMicrofacet.h:109
virtual std::array< real, 2 > getAlphas(const SurfaceHit &X) const =0
ShapeInvariantMicrofacet(EMaskingShadowing maskingShadowingType)
Definition ShapeInvariantMicrofacet.cpp:12
General information about a ray-surface intersection event.
Definition SurfaceHit.h:59
A sample from a Probability Density Function (PDF).
Definition PDF.h:14
real value
Definition PDF.h:18
T dot(const Derived &rhs) const
Definition TVectorNBase.ipp:14
T absDot(const Derived &rhs) const
Definition TVectorNBase.ipp:26
The root for all renderer implementations.
Definition EEngineProject.h:6
EMaskingShadowing
Different types of masking and shadowing terms for microfacet distributions. Eric Heitz has published...
Definition enums.h:11