Photon Engine 2.0.0-beta
A physically based renderer.
Loading...
Searching...
No Matches
AnisoTrowbridgeReitz.h
Go to the documentation of this file.
1#pragma once
2
4
5namespace ph
6{
7
13{
14public:
16 real alphaU,
17 real alphaV,
18 EMaskingShadowing maskingShadowingType);
19
20 std::array<real, 2> getAlphas(const SurfaceHit& X) const override;
21
22 real lambda(
23 const SurfaceHit& X,
24 const math::Vector3R& N,
25 const math::Vector3R& H,
26 const math::Vector3R& unitDir,
27 const std::array<real, 2>& alphas) const override;
28
29 real distribution(
30 const SurfaceHit& X,
31 const math::Vector3R& N,
32 const math::Vector3R& H) const override;
33
34 void sampleH(
35 const SurfaceHit& X,
36 const math::Vector3R& N,
37 const std::array<real, 2>& sample,
38 math::Vector3R* out_H) const override;
39
40private:
41 real m_alphaU;
42 real m_alphaV;
43 real m_rcpAlphaU2;
44 real m_rcpAlphaV2;
45};
46
47inline std::array<real, 2> AnisoTrowbridgeReitz::getAlphas(const SurfaceHit& /* X */) const
48{
49 return {m_alphaU, m_alphaV};
50}
51
52}// end namespace ph
Definition AnisoTrowbridgeReitz.h:13
std::array< real, 2 > getAlphas(const SurfaceHit &X) const override
Definition AnisoTrowbridgeReitz.h:47
real distribution(const SurfaceHit &X, const math::Vector3R &N, const math::Vector3R &H) const override
Distribution of the microfacet normal. The term. Also commonly knwon as the NDF (normal distribution...
Definition AnisoTrowbridgeReitz.cpp:44
real lambda(const SurfaceHit &X, const math::Vector3R &N, const math::Vector3R &H, const math::Vector3R &unitDir, const std::array< real, 2 > &alphas) const override
The function that appears in the masking-shadowing term. For isotropic distributions,...
Definition AnisoTrowbridgeReitz.cpp:25
void sampleH(const SurfaceHit &X, const math::Vector3R &N, const std::array< real, 2 > &sample, math::Vector3R *out_H) const override
Generate a microfacet normal H for the distribution. This samples all possible H vectors for the dist...
Definition AnisoTrowbridgeReitz.cpp:65
AnisoTrowbridgeReitz(real alphaU, real alphaV, EMaskingShadowing maskingShadowingType)
Definition AnisoTrowbridgeReitz.cpp:12
General information about a ray-surface intersection event.
Definition SurfaceHit.h:59
Trowbridge-Reitz distribution (GGX). See the original paper by Trowbridge et al. Trowbridge:1975:Aver...
Definition TrowbridgeReitz.h:14
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