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

37 lines
1.2 KiB
C++
Raw Normal View History

2020-06-02 11:46:18 +02:00
#pragma once
#include "Asset/Asset.h"
#include "Graphics/GraphicsResources.h"
2020-06-02 11:46:18 +02:00
#include "ShaderExpression.h"
namespace Seele
{
DECLARE_REF(VertexShaderInput);
2020-09-19 14:36:50 +02:00
DECLARE_REF(Material);
2020-06-02 11:46:18 +02:00
class MaterialAsset : public Asset
{
public:
MaterialAsset();
MaterialAsset(const std::string &directory, const std::string &name);
2020-06-08 01:44:47 +02:00
MaterialAsset(const std::filesystem::path &fullPath);
2020-06-02 11:46:18 +02:00
~MaterialAsset();
2020-10-03 11:00:10 +02:00
virtual void beginFrame();
virtual void endFrame();
virtual void save() = 0;
virtual void load() = 0;
2020-10-03 11:00:10 +02:00
virtual const Material* getRenderMaterial() const = 0;
Gfx::SeBlendOp getBlendMode() const {return Gfx::SE_BLEND_OP_END_RANGE;}
Gfx::MaterialShadingModel getShadingModel() const {return Gfx::MaterialShadingModel::DefaultLit;}
2020-10-03 11:00:10 +02:00
// This needs to be called while the descriptorset is unused
void updateDescriptorData();
2020-10-14 01:49:43 +02:00
const Gfx::PDescriptorSet getDescriptor() const;
2020-06-02 11:46:18 +02:00
protected:
//For now its simply the collection of parameters, since there is no point for expressions
Array<PShaderParameter> parameters;
2020-10-03 11:00:10 +02:00
Gfx::PDescriptorSet descriptorSet;
Gfx::PUniformBuffer uniformBuffer;
uint32 uniformDataSize;
uint8* uniformData;
2020-06-02 11:46:18 +02:00
};
DEFINE_REF(MaterialAsset);
} // namespace Seele