BRE12
MaterialTechnique.h
1 #pragma once
2 
3 #include <Utils\DebugUtils.h>
4 
5 struct ID3D12Resource;
6 
7 namespace BRE {
9 public:
10  enum TechniqueType {
11  COLOR_MAPPING = 0,
12  COLOR_NORMAL_MAPPING,
13  COLOR_HEIGHT_MAPPING,
14  TEXTURE_MAPPING,
15  NORMAL_MAPPING,
16  HEIGHT_MAPPING,
17  NUM_TECHNIQUES,
18  };
19 
20  MaterialTechnique(ID3D12Resource* diffuseTexture = nullptr,
21  ID3D12Resource* normalTexture = nullptr,
22  ID3D12Resource* heightTexture = nullptr)
23  : mDiffuseTexture(diffuseTexture)
24  , mNormalTexture(normalTexture)
25  , mHeightTexture(heightTexture)
26  {}
27 
28  ID3D12Resource& GetDiffuseTexture() const noexcept
29  {
30  BRE_ASSERT(mDiffuseTexture != nullptr);
31  return *mDiffuseTexture;
32  }
33 
34  void SetDiffuseTexture(ID3D12Resource* texture) noexcept
35  {
36  BRE_ASSERT(texture != nullptr);
37  mDiffuseTexture = texture;
38  }
39 
40  ID3D12Resource& GetNormalTexture() const noexcept
41  {
42  BRE_ASSERT(mNormalTexture != nullptr);
43  return *mNormalTexture;
44  }
45 
46  void SetNormalTexture(ID3D12Resource* texture) noexcept
47  {
48  BRE_ASSERT(texture != nullptr);
49  mNormalTexture = texture;
50  }
51 
52  ID3D12Resource& GetHeightTexture() const noexcept
53  {
54  BRE_ASSERT(mHeightTexture != nullptr);
55  return *mHeightTexture;
56  }
57 
58  void SetHeightTexture(ID3D12Resource* texture) noexcept
59  {
60  BRE_ASSERT(texture != nullptr);
61  mHeightTexture = texture;
62  }
63 
64  TechniqueType GetType() const noexcept;
65 
66 private:
67  ID3D12Resource* mDiffuseTexture{ nullptr };
68  ID3D12Resource* mNormalTexture{ nullptr };
69  ID3D12Resource* mHeightTexture{ nullptr };
70 };
71 }
72 
Definition: MaterialTechnique.h:8
Definition: Camera.cpp:8