-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathmaterial.h
43 lines (37 loc) · 928 Bytes
/
material.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#pragma once
namespace Framework
{
class Texture2D;
class TextureLib;
// Very simple, hard-coded set of parameters for now
struct Material
{
const char * m_mtlName;
Texture2D * m_pTexDiffuseColor;
Texture2D * m_pTexSpecColor;
Texture2D * m_pTexHeight;
rgb m_rgbDiffuseColor;
rgb m_rgbSpecColor;
float m_specPower;
float m_bumpScale;
bool m_alphaTest;
};
class MaterialLib
{
public:
// Asset pack that the material data is sourced from
comptr<AssetPack> m_pPack;
// Table of materials by name
std::unordered_map<std::string, Material> m_mtls;
MaterialLib();
Material * Lookup(const char * name);
void Reset();
};
// Load a material library from an asset pack and resolve texture
// references using the given texture library
bool LoadMaterialLibFromAssetPack(
AssetPack * pPack,
const char * path,
TextureLib * pTexLib,
MaterialLib * pMtlLibOut);
}