Lugdunum  0.1.0
Material.hpp
Go to the documentation of this file.
1 #pragma once
2 
3 #include <string>
4 
10 #include <lug/Math/Vector.hpp>
11 
12 namespace lug {
13 namespace Graphics {
14 
15 // For friend
16 namespace Builder {
17 class Material;
18 } // Builder
19 
20 namespace Render {
21 
26  friend class ::lug::Graphics::Builder::Material;
27 
28 public:
29  struct TextureInfo {
31  uint32_t texCoord{0};
32  };
33 
34  struct Constants {
35  Math::Vec4f baseColor{1.0f, 1.0f, 1.0f, 1.0f};
36  Math::Vec3f emissive{0.0f, 0.0f, 0.0f};
37  float metallic{1.0f};
38  float roughness{1.0f};
39  float normalTextureScale{1.0f};
40  float occlusionTextureStrength{1.0f};
41  };
42 
43 public:
50  Material(const std::string& name);
51 
52  Material(const Material&) = delete;
53  Material(Material&&) = delete;
54 
55  Material& operator=(const Material&) = delete;
56  Material& operator=(Material&&) = delete;
57 
58  virtual ~Material() = default;
59 
60  // TODO: Setters which call ::lug::Graphics::Render::DirtyObject::setDirty()
61  void setIrradianceMap(const Resource::SharedPtr<SkyBox> irradianceMap);
62  void setPrefilteredMap(const Resource::SharedPtr<SkyBox> prefilteredMap);
63 
64  const Constants& getConstants() const;
65 
66  const TextureInfo& getBaseColorTexture() const;
67  const TextureInfo& getMetallicRoughnessTexture() const;
68  const TextureInfo& getNormalTexture() const;
69  const TextureInfo& getOcclusionTexture() const;
70  const TextureInfo& getEmissiveTexture() const;
71  const Resource::SharedPtr<SkyBox> getIrradianceMap() const;
72  const Resource::SharedPtr<SkyBox> getPrefilteredMap() const;
73 
74 protected:
83 };
84 
86 
87 } // Render
88 } // Graphics
89 } // lug
Resource::SharedPtr< SkyBox > _prefilteredMap
Definition: Material.hpp:82
#define LUG_GRAPHICS_API
Definition: Export.hpp:11
Resource::SharedPtr< Texture > texture
Definition: Material.hpp:30
Dummy class for a shared pointer.
Definition: Resource.hpp:66
Class for resource.
Definition: Resource.hpp:17
Class for Material. Is a Resource.
Definition: Material.hpp:25
TextureInfo _metallicRoughnessTexture
Definition: Material.hpp:77
Resource::SharedPtr< SkyBox > _irradianceMap
Definition: Material.hpp:81