Photon Engine 2.0.0-beta
A physically based renderer.
Loading...
Searching...
No Matches
IsoTrowbridgeReitzTextured.h
Go to the documentation of this file.
1#pragma once
2
6
7#include <Common/assertion.h>
8
9#include <memory>
10
11namespace ph
12{
13
15{
16public:
18 const std::shared_ptr<TTexture<real>>& alpha,
19 EMaskingShadowing maskingShadowingType);
20
21 std::array<real, 2> getAlphas(const SurfaceHit& X) const override;
22
23private:
24 std::shared_ptr<TTexture<real>> m_alpha;
25};
26
27// In-header Implementations:
28
30 const std::shared_ptr<TTexture<real>>& alpha,
31 const EMaskingShadowing maskingShadowingType)
32
33 : IsoTrowbridgeReitz(maskingShadowingType)
34
35 , m_alpha(alpha)
36{}
37
38inline std::array<real, 2> IsoTrowbridgeReitzTextured::getAlphas(const SurfaceHit& X) const
39{
40 PH_ASSERT(m_alpha);
41
42 const real alpha = TSampler<real>().sample(*m_alpha, X);
43 return {alpha, alpha};
44}
45
46}// end namespace ph
Isotropic Trowbridge-Reitz distribution (GGX).
Definition IsoTrowbridgeReitz.h:11
Definition IsoTrowbridgeReitzTextured.h:15
IsoTrowbridgeReitzTextured(const std::shared_ptr< TTexture< real > > &alpha, EMaskingShadowing maskingShadowingType)
Definition IsoTrowbridgeReitzTextured.h:29
std::array< real, 2 > getAlphas(const SurfaceHit &X) const override
Definition IsoTrowbridgeReitzTextured.h:38
General information about a ray-surface intersection event.
Definition SurfaceHit.h:59
Common settings and operations for sampling a texture.
Definition TSampler.h:18
OutputType sample(const TTexture< OutputType > &texture, const SurfaceHit &X) const
Definition TSampler.h:32
Definition TTexture.h:12
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