Lugdunum
0.1.0
include
lug
Graphics
Render
Material.hpp
Go to the documentation of this file.
1
#pragma once
2
3
#include <string>
4
5
#include <
lug/Graphics/Export.hpp
>
6
#include <
lug/Graphics/Render/DirtyObject.hpp
>
7
#include <
lug/Graphics/Render/Texture.hpp
>
8
#include <
lug/Graphics/Render/SkyBox.hpp
>
9
#include <
lug/Graphics/Resource.hpp
>
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
25
class
LUG_GRAPHICS_API
Material
:
public
Resource
,
public
DirtyObject
{
26
friend
class ::lug::Graphics::Builder::Material;
27
28
public
:
29
struct
TextureInfo
{
30
Resource::SharedPtr<Texture>
texture
;
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
:
75
Constants
_constants
;
76
TextureInfo
_baseColorTexture
;
77
TextureInfo
_metallicRoughnessTexture
;
78
TextureInfo
_normalTexture
;
79
TextureInfo
_occlusionTexture
;
80
TextureInfo
_emissiveTexture
;
81
Resource::SharedPtr<SkyBox>
_irradianceMap
;
82
Resource::SharedPtr<SkyBox>
_prefilteredMap
;
83
};
84
85
#include <
lug/Graphics/Render/Material.inl
>
86
87
}
// Render
88
}
// Graphics
89
}
// lug
lug::Graphics::Render::Material::_prefilteredMap
Resource::SharedPtr< SkyBox > _prefilteredMap
Definition:
Material.hpp:82
lug::Graphics::Render::DirtyObject
Definition:
DirtyObject.hpp:11
LUG_GRAPHICS_API
#define LUG_GRAPHICS_API
Definition:
Export.hpp:11
lug::Graphics::Render::Material::_occlusionTexture
TextureInfo _occlusionTexture
Definition:
Material.hpp:79
lug::Graphics::Render::Material::TextureInfo::texture
Resource::SharedPtr< Texture > texture
Definition:
Material.hpp:30
lug::Graphics::Render::Material::TextureInfo
Definition:
Material.hpp:29
lug::Graphics::Resource::SharedPtr
Dummy class for a shared pointer.
Definition:
Resource.hpp:66
lug::Graphics::Render::Material::_emissiveTexture
TextureInfo _emissiveTexture
Definition:
Material.hpp:80
Resource.hpp
lug::Graphics::Resource
Class for resource.
Definition:
Resource.hpp:17
SkyBox.hpp
lug
Definition:
Application.hpp:11
lug::Graphics::Render::Material
Class for Material. Is a Resource.
Definition:
Material.hpp:25
lug::Graphics::Render::Material::_normalTexture
TextureInfo _normalTexture
Definition:
Material.hpp:78
Material.inl
lug::Graphics::Render::Material::_constants
Constants _constants
Definition:
Material.hpp:75
Texture.hpp
lug::Graphics::Render::Material::_metallicRoughnessTexture
TextureInfo _metallicRoughnessTexture
Definition:
Material.hpp:77
DirtyObject.hpp
Vector.hpp
lug::Graphics::Render::Material::_baseColorTexture
TextureInfo _baseColorTexture
Definition:
Material.hpp:76
lug::Graphics::Render::Material::_irradianceMap
Resource::SharedPtr< SkyBox > _irradianceMap
Definition:
Material.hpp:81
Export.hpp
lug::Graphics::Render::Material::Constants
Definition:
Material.hpp:34
Generated by
1.8.13