Photon Engine 2.0.0-beta
A physically based renderer.
Loading...
Searching...
No Matches
TCheckerboardTexture.h
Go to the documentation of this file.
1#pragma once
2
4
5#include <memory>
6
7namespace ph
8{
9
26template<typename OutputType>
27class TCheckerboardTexture : public TTexture<OutputType>
28{
29public:
31 real numUtiles,
32 real numVtiles,
33 const OutputType& oddValue,
34 const OutputType& evenValue);
35
37 real numUtiles,
38 real numVtiles,
39 const std::shared_ptr<TTexture<OutputType>>& oddTexture,
40 const std::shared_ptr<TTexture<OutputType>>& evenTexture);
41
42 void sample(const SampleLocation& sampleLocation, OutputType* out_value) const override;
43
46 void setOddTexture(const std::shared_ptr<TTexture<OutputType>>& oddTexture);
47
50 void setEvenTexture(const std::shared_ptr<TTexture<OutputType>>& evenTexture);
51
57 void setOddTextureScale(const math::Vector3R& sale);
58 void setEvenTextureScale(const math::Vector3R& scale);
60
61private:
62 std::shared_ptr<TTexture<OutputType>> m_oddTexture;
63 std::shared_ptr<TTexture<OutputType>> m_evenTexture;
64
65 real m_uTileSize;
66 real m_vTileSize;
67 math::Vector3R m_oddUvwScale;
68 math::Vector3R m_evenUvwScale;
69};
70
71}// end namespace ph
72
Definition SampleLocation.h:22
Texture representing checker patterns.
Definition TCheckerboardTexture.h:28
void sample(const SampleLocation &sampleLocation, OutputType *out_value) const override
Definition TCheckerboardTexture.ipp:50
TCheckerboardTexture(real numUtiles, real numVtiles, const OutputType &oddValue, const OutputType &evenValue)
Definition TCheckerboardTexture.ipp:14
void setEvenTextureScale(const math::Vector3R &scale)
Definition TCheckerboardTexture.ipp:112
void setOddTexture(const std::shared_ptr< TTexture< OutputType > > &oddTexture)
Sets the texture that is going to be used in odd cells.
Definition TCheckerboardTexture.ipp:73
void setOddTextureScale(const math::Vector3R &sale)
Sets the scale factors of cell texture. Larger u-, v- and w-scale makes texture appears to be larger ...
Definition TCheckerboardTexture.ipp:106
void setEvenTexture(const std::shared_ptr< TTexture< OutputType > > &evenTexture)
Sets the texture that is going to be used in even cells.
Definition TCheckerboardTexture.ipp:87
Definition TTexture.h:12
The root for all renderer implementations.
Definition EEngineProject.h:6