2022-05-21 19:58:09 +02:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <cstdint>
|
|
|
|
#include "StringBase.h"
|
|
|
|
#include "DictionaryBase.h"
|
|
|
|
|
|
|
|
namespace Assets
|
|
|
|
{
|
|
|
|
// Represents the supported 3D material slots
|
|
|
|
enum class MaterialSlotType : uint32_t
|
|
|
|
{
|
|
|
|
// No valid mapping, but it's here
|
|
|
|
Invalid,
|
|
|
|
|
|
|
|
// Albedo color, different from diffuse
|
|
|
|
Albedo,
|
|
|
|
// Full color with lighing
|
|
|
|
Diffuse,
|
|
|
|
|
|
|
|
// Normal map, most likely XY compressed
|
|
|
|
Normal,
|
|
|
|
|
|
|
|
// Reflectivity
|
|
|
|
Specular,
|
|
|
|
|
|
|
|
// Glow / coloring
|
|
|
|
Emissive,
|
|
|
|
|
|
|
|
// Gloss is inverted roughness
|
|
|
|
Gloss,
|
|
|
|
// Roughness is inverted gloss
|
|
|
|
Roughness,
|
|
|
|
|
|
|
|
// Generalized lighting AO
|
|
|
|
AmbientOcclusion,
|
|
|
|
// More focused lighting AO
|
|
|
|
Cavity,
|
|
|
|
};
|
|
|
|
|
|
|
|
// Represents a 3D material and provided diffuse, normal, and specular images.
|
|
|
|
class Material
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
// Initialize a new default material.
|
|
|
|
Material();
|
|
|
|
// Initialize a new material.
|
2022-05-21 21:51:35 +02:00
|
|
|
Material(const String& Name, const uint64_t Hash);
|
2022-05-21 19:58:09 +02:00
|
|
|
// Destroy all material info.
|
|
|
|
~Material() = default;
|
|
|
|
|
|
|
|
// The unique name for this material.
|
2022-05-21 21:51:35 +02:00
|
|
|
String Name;
|
2022-05-21 19:58:09 +02:00
|
|
|
|
|
|
|
// Name of the source identifier for this material.
|
2022-05-21 21:51:35 +02:00
|
|
|
String SourceString;
|
2022-05-21 19:58:09 +02:00
|
|
|
// Hash of the source identifier for this material.
|
|
|
|
uint64_t SourceHash;
|
|
|
|
|
|
|
|
// The material texture slots
|
2022-05-21 21:51:35 +02:00
|
|
|
Dictionary<MaterialSlotType, std::pair<String, uint64_t>> Slots;
|
2022-05-21 19:58:09 +02:00
|
|
|
|
|
|
|
// The unique hash identifier for this material.
|
|
|
|
uint64_t Hash;
|
|
|
|
};
|
|
|
|
}
|