Files
Seele/src/Engine/Material/Material.h
T

44 lines
1.1 KiB
C++
Raw Normal View History

2023-01-21 18:43:21 +01:00
#pragma once
2023-10-24 15:01:09 +02:00
#include "ShaderExpression.h"
2023-10-26 18:37:29 +02:00
#include "Graphics/Descriptor.h"
2023-01-21 18:43:21 +01:00
namespace Seele
{
DECLARE_REF(MaterialInstance)
2023-10-24 15:01:09 +02:00
class Material
2023-01-21 18:43:21 +01:00
{
public:
2023-11-01 13:38:49 +01:00
Material();
2023-11-05 10:36:01 +01:00
Material(Gfx::PGraphics graphics,
2023-11-01 23:12:30 +01:00
Gfx::ODescriptorLayout layout,
2023-02-24 22:09:07 +01:00
uint32 uniformDataSize,
uint32 uniformBinding,
std::string materialName,
2023-11-11 22:39:17 +01:00
Array<OShaderExpression> expressions,
2023-11-05 10:36:01 +01:00
Array<std::string> parameter,
2023-02-24 22:09:07 +01:00
MaterialNode brdf);
2023-10-24 15:01:09 +02:00
~Material();
2023-11-01 23:12:30 +01:00
const Gfx::PDescriptorLayout getDescriptorLayout() const { return layout; }
2023-11-05 10:36:01 +01:00
OMaterialInstance instantiate();
2023-11-01 23:12:30 +01:00
const std::string& getName() const { return materialName; }
2023-01-21 18:43:21 +01:00
2023-10-24 15:01:09 +02:00
void save(ArchiveBuffer& buffer) const;
void load(ArchiveBuffer& buffer);
2023-01-21 18:43:21 +01:00
2023-02-24 22:09:07 +01:00
void compile();
2023-01-21 18:43:21 +01:00
private:
2023-10-24 15:01:09 +02:00
Gfx::PGraphics graphics;
uint32 uniformDataSize;
uint32 uniformBinding;
uint64 instanceId;
2023-11-01 23:12:30 +01:00
Gfx::ODescriptorLayout layout;
2023-01-21 18:43:21 +01:00
std::string materialName;
2023-11-11 22:39:17 +01:00
Array<OShaderExpression> codeExpressions;
2023-11-05 10:36:01 +01:00
Array<std::string> parameters;
2023-02-24 22:09:07 +01:00
MaterialNode brdf;
2023-01-21 18:43:21 +01:00
};
DEFINE_REF(Material)
2023-02-13 14:56:13 +01:00
2023-01-21 18:43:21 +01:00
} // namespace Seele