Photon Engine 2.0.0-beta
A physically based renderer.
Loading...
Searching...
No Matches
TrowbridgeReitz.h
Go to the documentation of this file.
1#pragma once
2
4
5namespace ph
6{
7
14{
15public:
16 explicit TrowbridgeReitz(
17 EMaskingShadowing maskingShadowingType);
18
19 std::array<real, 2> getAlphas(const SurfaceHit& X) const override = 0;
20
21 real lambda(
22 const SurfaceHit& X,
23 const math::Vector3R& N,
24 const math::Vector3R& H,
25 const math::Vector3R& unitDir,
26 const std::array<real, 2>& alphas) const override = 0;
27
29 const SurfaceHit& X,
30 const math::Vector3R& N,
31 const math::Vector3R& H) const override = 0;
32
33 void sampleH(
34 const SurfaceHit& X,
35 const math::Vector3R& N,
36 const std::array<real, 2>& sample,
37 math::Vector3R* out_H) const override = 0;
38
39 void sampleVisibleH(
40 const SurfaceHit& X,
41 const math::Vector3R& N,
42 const math::Vector3R& V,
43 const std::array<real, 2>& sample,
44 math::Vector3R* out_H) const override;
45
47 const SurfaceHit& X,
48 const math::Vector3R& N,
49 const math::Vector3R& H,
50 const math::Vector3R& V) const override;
51
52private:
57 math::Vector3R sampleVNDFDirOnHemisphereDupuy(
58 const math::Vector3R& standardLocalV,
59 const std::array<real, 2>& sample) const;
60};
61
62}// end namespace ph
Definition ShapeInvariantMicrofacet.h:16
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
std::array< real, 2 > getAlphas(const SurfaceHit &X) const override=0
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...
void sampleVisibleH(const SurfaceHit &X, const math::Vector3R &N, const math::Vector3R &V, const std::array< real, 2 > &sample, math::Vector3R *out_H) const override
Same as sampleH(), but tries to take geometry term into consideration. This samples only potentially ...
Definition TrowbridgeReitz.cpp:19
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=0
The function that appears in the masking-shadowing term. For isotropic distributions,...
lta::PDF pdfSampleVisibleH(const SurfaceHit &X, const math::Vector3R &N, const math::Vector3R &H, const math::Vector3R &V) const override
Definition TrowbridgeReitz.cpp:56
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...
A sample from a Probability Density Function (PDF).
Definition PDF.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